Blorbtool.py not seeming to work?

So, I’ve been trying to use blorbtool.py to package multiple .AIFF files for use in a z5 game - specifically, using ZIL. I don’t know if that’s important.

I created the .blb out of 2 .AIFF files, the first time just by simply IMPORTing the files in and then I SAVEd it as a file with the same name as the .z5 file which I was playing the sounds using. I made a routine where I could decide which audio piece I could use by entering a number. Only 1 and 2 worked, which isn’t surprising. But none of the others worked. I tried renaming the Lurking Horror blorb file to the game name, and playing the sound numbers - they all worked accordingly. I think. The first few sounded glitched, though apparently they’re meant to be like that?

Later, I tried recreating the blorb file but using import Exec 1 (filename). Tried playing. It didn’t work.

Does anyone know how to make it work, and why the Lurking Horror blorb is working but the others aren’t?

Looking at the blorbtool.py source code, it seems “import” requires four arguments: USE, NUM, TYPE, and FILENAME.

So to put Z-code into a blorb, this command works for me:

import Exec 0 ZCOD filename.z5

P.S. use the “index” command to get a list of what is in the current blorb, perhaps post that here.

Oh… I used that command to import the audio files not the game.

I’m not sure how that one works there. Are you packaging the game in a zblorb file? I was trying to make the blorb file separate from the Z5 file.

I know nothing about what audio file formats, bit depths or sample rates you can use with ZIL, or even if it’s really ZIL that is handling the audio side of the equation. But the copy of the Lurking Horror’s audio I have is of 8-bit AIFs, probably sampled at 11khz on average, which nobody would generate these days and the average DAW cannot even open.

I point this out in case ZIL can’t handle a more typical AIF (e.g. 16bit/44hkz), given that such AIFs were never shipped with games in the time of z5 for space, datarate and other tech reasons.

-Wade

1 Like

Huh, I didn’t know that.

I’m not sure but I don’t really think it’s to do with ZIL and more the Z-machine, since my game follows the same standards as Inform games released as a .Z5 file.

Yeah, sorry I’m always kinda sloppy when talking about formats vs languages vs engines. But people usually get what I meant :slight_smile:

-Wade

1 Like

This is what I got from the most recent one:

>index
4 resources:
  'Exec' 1: 'FORM'/'AIFC' (4253440+8 bytes, start 72)
  'Exec' 3: 'FORM'/'AIFC' (12231890+8 bytes, start 4253520)
  'Exec' 2: 'FORM'/'AIFC' (2213176+8 bytes, start 16485418)
  'Exec' 4: 'FORM'/'AIFC' (668224+8 bytes, start 18698602)

I notice it says AIFC. That is a compressed (in terms of size, not audio quality) version of an AIF, proprietary to Apple. So that’s not actually a straight AIFF file.

Now I’m not sure if the tool is returning the wrong file type, or if you are actually using AIFC files, but I doubt AIFC would be something you could use.

EDIT - In which case, you would want to convert to or use straight AIFF and try that.

-Wade

1 Like

Oh, huh. When I tried entering something else, it gave me:

>import aifs NewLockNew_Alert.aiff
This IFF file has form type 'b'AIFC'', not 'b'aifs''.

So I just followed that. But it wouldn’t make sense that it’s an AIFC, now that you mention it. (Although when I try to play the AIFF file on my Windows laptop, I am given this:
image

Laugh, we’re getting down a rabbit hole here. When it says ‘This IFF file…’, we finally hit a file type I don’t know. I looked it up and wikipedia says " Interchange File Format (IFF ) is a generic digital container file format originally introduced by Electronic Arts (in cooperation with Commodore) in 1985 to facilitate transfer of data between software produced by different companies.

So that’s pretty vintage. I know a lot about audio files, but hadn’t heard of IFF, and I don’t know much about blorbtool’s abilities/limitations, or z5’s ability to play back various audio files. At the byte level, it’s easy for old tools and engines to read the wrong file format on newer formats they’re not aware of.

Are any of the audio files you’re trying to use very small? If you could PM me one as an attachment, or go to wadeclarkeDOTcom, use the email me form and attach one, I could look at it and at least identify the qualities of the file you’re trying to use, if you like. That would remove one set of variables from the equation.

-Wade

1 Like

Oh, huh. I just used a converter to change from AIFF to AIFF and now they can all be played normally on the media player. I suspect you were right about AIFC not being right. Just a sec - let me try uploading these to a blorb and if it doesn’t work, then I’ll send you one…

1 Like

It’s lookin’ good. It now tells me they’re AIFF, not AIFC. So I think this is one step closer…

1 Like

Yay!

-Wade

1 Like

Welp. They aren’t actually being played in the game. That’s not good. Now the problem is finding out how to import the files properly…

YAY!! It works!

To get it to work, I just had to study the index of the Lurking Horror sound effects. Now, it works!

1 Like

Terrific. I’m glad we didn’t have to wade through further unknowns.

-Wade

1 Like

IFF is what blorb files themselves are! It’s an old standard for how to put a bunch of chunks of binary data into a single file, and used to be everywhere, though it’s less common now.

IFFs themselves have a four-byte tag at the beginning called the “form type”. Blorbs themselves use the tag IFRS (“Interactive Fiction ReSource”). But AIFFs are also IFFs, and use the tag AIFF for uncompressed audio (“Audio IFF”) and AIFC for compressed audio (“Audio IFF, Compressed”); the blorb standard allows AIFF, but not AIFC.

2 Likes

But uncompressed audio is almost always not the right choice. So can you convert it to an .ogg?

1 Like

I should probably have noticed 75% of “AIFF” is IFF…

-Wade

1 Like