I expanded on things that Graham did to create my
blorbtools package. These include Graham’s original Perl-based scripts for creating and manipulating Blorb files.
Once you have some sound files, you then need to make a
blurb file. This is the manifest @Warrigal speaks of. It maps the sound files to meaningful constants that can be used in an Inform6 program and indicates what executable you wish to include. This is what I used for
Uninvited (GitHub - DavidGriffith/uninvited: A reimplementation of Uninvited in Inform):
storyfile "uninvited.z5" include
sound Bark "sound/dogbark.aiff"
sound Cathedral "sound/cathedral.aiff"
sound DoorClose "sound/doorclose.aiff"
sound CellDoor "sound/celldoor.aiff"
sound Explosion "sound/explode.aiff"
sound Faucet "sound/faucet.aiff"
!sound Fire "sound/fire.aiff"
sound Spray "sound/spray.aiff"
sound Match1 "sound/match1.aiff"
sound Match2 "sound/match2.aiff"
sound MatchFumble "sound/fumble.aiff"
sound Thunder1 "sound/thunder1.aiff"
sound Thunder2 "sound/thunder2.aiff"
sound Thunder3 "sound/thunder3.aiff"
sound ZombieAttack "sound/zombiegroan.aiff"
sound ZombieRun "sound/zombiehiss.aiff"
Then you need to call
pblorb to get Inform6 code implementing these constants. I modified
pblorb to emit ZIL constants if that’s what you want.
pblorb -i foo.blurb -o blurb.inf
Here’s what the output for
! Reading from sound/uninvited.blurb
! pblorb 3.1 [executing on Monday 17 April 2023 at 04:29:13]
! The blorb spell (safely protect a small object as though in a strong box)
! Creating Inform6 manifest from sound/uninvited.blurb
Constant SOUND_Bark = 3;
Constant SOUND_Cathedral = 4;
Constant SOUND_DoorClose = 5;
Constant SOUND_CellDoor = 6;
Constant SOUND_Explosion = 7;
Constant SOUND_Faucet = 8;
Constant SOUND_Spray = 9;
Constant SOUND_Match1 = 10;
Constant SOUND_Match2 = 11;
Constant SOUND_MatchFumble = 12;
Constant SOUND_Thunder1 = 13;
Constant SOUND_Thunder2 = 14;
Constant SOUND_Thunder3 = 15;
Constant SOUND_ZombieAttack = 16;
Constant SOUND_ZombieRun = 17;
! Manifest complete.
To play a sound with Inform6, you can either use Z-machine assembly directly or use L. Ross Raszewski’s
sound.h library. It’s very basic, but it does work. I’ve been meaning to expand it to, among other things, make it cross-compatible with Glulx output as much as is possible.
blurb.inf somewhere near the beginning of the your program. Now you can compile the program. Then call
pblorb again, without the
-z options to indicate that
pblorb should generate a Blorb file:
pblorb foo.blurb -o foo.zblorb
It’ll read the manifest again and build the Blorb.
I have a
soundtestpackage that I used in figuring out sound programming and getting Frotz to do sound and graphics which I’ll upload to the IF Archive in a couple days.