// create one enormous buffer for main menu music alGenBuffers(1, 0xbfc4e960, 0xbfc4e9ec, 0xbfc4e9ec, 0xbfc4e9bf) alBufferData(0xa105d38, 4355, 0xa921f008, 0x15b7c00, 44100) // latch menu al_src=0xa0c9e60, vsrc=0x9f34ce8 (loop=TRUE) alSourcefv(0xa0c9e60, 4100, 0x9f34ce8, 0x858a080, 0x86b4aa0) alSourcei(0xa0c9e60, 514, 1, 0x858a080, 0x86b4aa0) alSourcef(0xa0c9e60, 4129, 0, 0x858a080, 0x86b4aa0) alSourcef(0xa0c9e60, 4106, 0x3f800000, 0x858a080, 0x86b4aa0) alSourcef(0xa0c9e60, 4099, 0x3f800000, 0x858a080, 0x86b4aa0) alSourcei(0xa0c9e60, 4103, 1, 0x858a080, 0x86b4aa0) // play menu track alSourceQueueBuffers(0xa0c9e60, 1, 0xbfc577e4, 0x9f34cf4, 0x86b4aa0) alSourcePlay(0xa0c9e60, 1590, 0x9f34cd8, 0x86998dc, 1665) // second buffer for in-game music alGenBuffers(1, 0xbfc4e900, 0xbfc4e98c, 0xbfc4e98c, 0xbfc4e9bf) alBufferData(0xb3efd00, 4355, 0xa4f0e008, 0x126a5b8, 44100) // latch menu track after starting to fade it out (vs->gain may have changed) alSourcefv(0xa0c9e60, 4100, 0x9f34ce8, 1, 3) alSourcei(0xa0c9e60, 514, 1, 1, 3) alSourcef(0xa0c9e60, 4129, 0, 1, 3) alSourcef(0xa0c9e60, 4106, 0x3f800000, 1, 3) alSourcef(0xa0c9e60, 4099, 0x3f800000, 1, 3) alSourcei(0xa0c9e60, 4103, 1, 1, 3) // latch ingame al_src=0xa0b1870 vsrc=0xa38fa78 (loop=FALSE) alSourcefv(0xa0b1870, 4100, 0xa38fa78, 0x858a080, 0x86b4aa0) alSourcei(0xa0b1870, 514, 1, 0x858a080, 0x86b4aa0) alSourcef(0xa0b1870, 4129, 0, 0x858a080, 0x86b4aa0) alSourcef(0xa0b1870, 4106, 0x3f800000, 0x858a080, 0x86b4aa0) alSourcef(0xa0b1870, 4099, 0x3f800000, 0x858a080, 0x86b4aa0) alSourcei(0xa0b1870, 4103, 0, 0x858a080, 0x86b4aa0) // play ingame alSourceQueueBuffers(0xa0b1870, 1, 0xbfc57784, 0xa38fa84, 0x86b4aa0) alSourcePlay(0xa0b1870, 1590, 0xa38fa68, 0x86998dc, 5029) // update menu track (fading out, gain=0.6, loop=TRUE) alSourcefv(0xa0c9e60, 4100, 0x9f34ce8, 1, 3) alSourcei(0xa0c9e60, 514, 1, 1, 3) alSourcef(0xa0c9e60, 4129, 0, 1, 3) alSourcef(0xa0c9e60, 4106, 0x3f21f38b, 1, 3) alSourcef(0xa0c9e60, 4099, 0x3f800000, 1, 3) alSourcei(0xa0c9e60, 4103, 1, 1, 3) // !! reclaim menu track's al_src=0xa0c9e60 vsrc=0x9f34ce8 alSourceStop(0xa0c9e60, 1611, 0x44328000, 0x44278000, 0x43ca4416) alSourcei(0xa0c9e60, 4105, 0, 0x44278000, 0x43ca4416) // set buffer to 0 -> unqueues all buffers // create small buffer for sound clip alGenBuffers(1, 0xbfc4fbf0, 0xbfc4fc7c, 0xbfc4fc7c, 0xbfc4fcbf) alBufferData(0xb1c78a0, 4353, 0xb6d8a40, 6136, 44100) // !! latch soundclip (NOTE: we got a different vsrc but the same al_src as the menu track) alSourcefv(0xa0c9e60, 4100, 0xb5f6888, 0x858a080, 0x86b4aa0) alSourcei(0xa0c9e60, 514, 0, 0x858a080, 0x86b4aa0) alSourcef(0xa0c9e60, 4106, 0x3f51eb85, 0x858a080, 0x86b4aa0) alSourcef(0xa0c9e60, 4099, 0x3f8147ae, 0x858a080, 0x86b4aa0) alSourcei(0xa0c9e60, 4103, 0, 0x858a080, 0x86b4aa0) // !! soundclip has finished playing => unqueue // the al_src (while still serving the menu track) had an "unprocessed" buffer that // apparently still remains (the soundclip's buffer is now indicated as processed, but // attempting to remove it seems to affect the previous one from menuTrack) alSourceUnqueueBuffers(0xa0c9e60, 1, 0xbfc57fa8, 0x4042c921, -1)