lindbergh-loader icon indicating copy to clipboard operation
lindbergh-loader copied to clipboard

Fix libsegaapi

Open bobbydilley opened this issue 3 years ago • 1 comments

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

bobbydilley avatar Dec 30 '22 15:12 bobbydilley

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

bobbydilley avatar Nov 19 '23 15:11 bobbydilley