-
Notifications
You must be signed in to change notification settings - Fork 5
Audio
Rena Kunisaki edited this page Jan 28, 2021
·
7 revisions
These are all found under /audio
. This does not include /streams.
- midi.wad
- starfox.h.bak - old list of SFX IDs (don't match final)
- starfoxm.poo, starfoxs.poo - pool file
- starfoxm.pro, starfoxs.pro - project file
- starfoxm.sam, starfoxs.sam - sample file (the actual audio data)
- starfoxm.sdi, starfoxs.sdi - sample directory
Presumably m=music, s=sfx
https://github.com/axiodl/amuse is able to parse the audio data. Of course, it does not build, and has some utterly insane dependencies (why the shit does an audio decoder want a 3D graphics library!?)
- .proj: project structure, what belongs to which group
- .pool: all data except samples
- .sdir: locations of samples needed by groups
- .samp: sample data
/audio/data:
- EmptyN .bin 256K where N is 0..7
- Music .bin 2.5K
- Sfx .bin 38K
- Streams.bin 20K
XXX where is this struct used?
Offset | Type | Name | Description |
---|---|---|---|
000000 | ushort | id | used to look up entry |
000002 | ushort | ? | flags? if FFFF, don't play |
000004 | byte | ? | |
000005 | byte | ? | |
000006 | byte | ? | |
000007 | byte | ? | |
000008 | u32 | offset | high byte: index into something 8 bytes; low 3 bytes: offset |
00000c | u16 | rate | higher = lower pitch |
00000e | u16 | pitch | higher = higher pitch - #samples? |
000010 | int | length | high byte = flags? |
000014 | u32 | repeatStart | repeat from this point... |
000018 | u32 | repeatEnd | ...to this one (if this isn't 0) |
00001c | u32 | variation | distorts in various random ways |
Offset | Type | Name | Description |
---|---|---|---|
000000 | u16 | id | |
000002 | u8 | baseVolume | |
000003 | u8 | volumeRand | volume = rand(baseVolume - volumeRand, baseVolume + volumeRand) |
000004 | u8 | basePan | 127=center |
000005 | u8 | panRand | never used, works same as volumeRand |
000006 | u16 | ? | |
000008 | u16 | range | how far from source object to silence |
00000a | u16[6] | fxIds | actual sound to play (not same as id) (XXX are these the IDs in starfox.h.bak?) |
000016 | u8[6] | fxChance | chance to pick each sound |
00001c | ushort | randMax | sum of fxChance |
00001e | u8 | ? | maybe queue slot? high 4bits are idx into sfxTable_803db248 |
00001f | u8 | idxs | two 4-bit values: numIdxs (# items in fxIds), prevIdx (previously played index) |
Pseudocode to play a sound effect:
if id == 0xAB:
//no idea what this is, just some kind of whoosh or creak.
//it alternates between two different sounds every time it's played.
//this check seems unnecessary though since the normal random
//selection avoids repeats and so would have the same effect.
entry->prevIdx ^= 1
idx = entry->prevIdx
else:
n = random between 1 and entry->randMax
idx = the index of value n in entry->fxIds
//eg if randVals = [10, 20, 30] and n = 22,
//then idx = 2, since randVals[2] >= n
//avoid playing the same sound twice in a row.
//if we chose the same one as last time, use the next one.
if entry->prevIdx == idx:
idx += 1
if idx > entry->numIdxs: idx = 0
entry->prevIdx = idx
outId = entry->randVals[idx]
if outId is 0, don't play
//compute the volume:
if entry->volumeRand == 0:
outVolume = entry->baseVolume
else: outVolume = rand(
entry->baseVolume - entry->volumeRand,
entry->baseVolume + entry->volumeRand)
//same calculation here, but result is cast to float.
//panRand is 0 in every sound effect though
if entry->panRand == 0:
outPan = (float)entry->basePan
else: outPan = rand(
entry->basePan - entry->panRand,
entry->basePan + entry->panRand)
u8 sfxTable_803db248[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0};
outField6 = (float)unk06
outRange = (float)range
outTable1E = sfxTable_803db248[unk1E >> 4]
out1ELow = unk1E & 1
out1EHigh = (unk1E >> 3) & 1
(names made up by me)
ID | Name |
---|---|
001D | FoxClimbUp |
001F | KrystalHurt |
0024 | FoxHurt |
0025 | FoxClimbUp2 |
0026 | FoxFallScream |
0027 | FoxLandOof |
0029 | FoxGrabLedge |
002E | FoxRoll |
002F | ClimbOutOfWater |
0049 | RecoverHealth |
0058 | GenericItemPickup |
0069 | ToggleDisguise |
006F | Clang |
0098 | MenuOpen |
009E | ElectricCrackle |
00BA | SplashBA |
00C0 | StaffTakeOut |
00C1 | StaffPutAway |
00C2 | SmackC2 |
00C3 | SmackC3 |
00E7 | RobotTalk |
00E8 | RobotHover |
00E9 | RobotZap |
00F3 | PipF3 |
00F4 | DootF4 |
00F5 | MenuOpenF5 |
00F7 | CMenuEquip |
00FB | Ding |
00FC | TitleScreenZip |
00FD | Squak |
00FF | TitleScreenOpenMenu |
0100 | TitleScreenCloseMenu |
010A | SpellCastFailed |
013D | TrickyDigging |
016C | BallBounce |
017B | Thud17B |
017C | Thud17C |
020E | FoxFallScream1 |
020F | FoxFallScream2 |
0285 | Drip |
0286 | CameraTurnBehindPlayer |
0287 | Drop |
0288 | Whoosh288 |
0289 | Whoosh289 |
028B | Whoosh28B |
028C | TickTickTick |
028D | CymbalCrash |
029D | TrickyFinishFlame |
02CB | KrystalGrabLedge |
02D0 | KrystalFallScream |
034D | Tricky_WaitUpFox |
034E | Tricky_WaitForMe |
034F | Tricky_Hey |
0350 | Tricky_GetOff |
0351 | Tricky_LookAtThis |
0352 | Tricky_ImHungry |
0353 | Tricky_Yawn2 |
0354 | Tricky_Yawn |
0355 | Tricky_LetsPlay |
0356 | Tricky_Cool |
0357 | Tricky_Sniff |
0358 | Tricky_BadGuy |
0359 | Tricky_Food |
035A | Tricky_TheresSomethingNear |
035B | Tricky_GetMFox |
035C | Tricky_Yeah |
035D | Tricky_ImNotDoingIt |
035E | Tricky_Hello |
035F | Tricky_HiFella |
0360 | Tricky_Dumdedum |
0361 | Tricky_Laugh |
0362 | Trick_Chewing |
0363 | Tricky_MmmmTasty |
0364 | Tricky_ImStuffed |
0365 | Tricky_WhereAreWeGoing |
0378 | FoxAttack378 |
037B | TitleScreenChangePage |
037C | CMenuClose |
0382 | IceSpell |
038D | WarningBeep |
0394 | Burning |
0395 | PutOutFlame |
0397 | TextPip |
0398 | KrystalClimbUp |
0399 | KrystalLandOof |
03CD | KrystalRoll1 |
03CE | KrystalRoll2 |
03D8 | StaticyRadarBeep |
03DC | TrickySpewingFire |
03E5 | PauseMenuOpen |
03E8 | HagabonWhir |
03EB | ElectronicChime3EB |
03EC | ElectronicChime3EC |
03ED | MapChangeMode |
03EE | MenuOpen3EE |
03EF | MenuClose3EF |
03F0 | MapZoom |
03F1 | Pip3F1 |
03F2 | PauseMenuClose |
03F4 | RobotActivate |
03F7 | TrickyCommandDecoy |
03F8 | TrickyCommandFind |
03F9 | TrickyCommandFlame |
03FA | TrickyCommandGoGetIt |
03FB | TrickyCommandWhistle |
03FC | TrickyCommandStay |
03FF | ZipUp |
0400 | ZipDown |
0401 | MenuSlide |
0402 | Chime |
0405 | Blip |
0408 | CMenuOpen |
0418 | TitleScreenSelect |
0419 | TitleScreenCancel |
041A | TitleScreenBeep |
041B | ZipUp41B |
041C | Zap |
0420 | WarpIn |
0427 | RollInWater |
042B | Splash42B |
0467 | Warping |
0470 | EvilLaugh |
0471 | Woosh471 |
0472 | Woosh472 |
047B | GlassSmash |
04A2 | Teleport |