lindbergh-loader
lindbergh-loader copied to clipboard
Fix libsegaapi
The sound is currently rubbish because:
- OpenAL allows you to create a sound buffer, fill it and then ask it to play. You may not modify the sound buffer whilst it's playing.
- The Lindbergh API relies on the idea that you can modify the buffer whilst it's playing
We currently get around this by
- When the lindbergh updates, we stop the audio, remember the position, reset the buffer with the new data, set the position back and play the audio again. This sort of works but causes lots of horrible noise.
What we need to do:
- Use the OpenAL queue method and queue the audio properly
Things to reference:
https://github.com/teknogods/OpenSegaAPI https://github.com/JayFoxRox/Lindbergh-Emulator/blob/master/segaapi/segaapi.c
Other issues are that we don't implement any of the other functions that libsegaapi has
In Outrun there is sfdplay which plays audio and can be used to debug