Open Protofall opened 5 years ago
SDL also has a sound solution to consider
Note to use CDDA music I have to use mds4dc instead of cdi4dc? I'll have to look into getting CDDA to work sometime.
Note, sudo apt-get install libopenal-dev
will install OpenAL on Linux
Using OpenAL (MojoAL build). I've made a 2D audio API found here: https://github.com/Protofall/Homebrew-Tests/tree/master/KallistiOSTests/Audio2dAPI
For Moving Day I'm just copy-pasting the audio_assist.*
files into the code folder. Once Moving Day is done (Or v0.2 is complete), I'll add them to Crayon itself and rename some of the functions to match the Crayon naming convention (Also rename files from audio_assist.*
to audio.*
)
Note: To get MojoAL working on PC we do sudo apt-get install libsdl2-dev
instead of the normal openal software
There are a few bugs present. MojoAL has some bugs inheritted by ALdc such as delayed playback and weird effects. But then there's also a memory corruption specific to ALdc (At least I think it is) that prevents most programs working on redream.
Although I'm using OpenAL-Soft for PC and ALdc for Dreamcast, I'm going to move this issue to v0.3
I think I'll want to revise the audio code before adding it directly into Crayon since it could probably be improved. Also I should add a var to Crayon to check if disc reads are currently happening and if I try to use other of my load functions (ie load a spritesheet/txr) then it will either wait or exit the function with a special error code.
Also the ability to stream an audio file from RAM, not just from disc. Also on Dreamcast a buffer can only be 64KB - 1 Byte
max with a total Sound RAM of 2MB (Currently the streamer uses 0.5MB. So be careful of this.
I haven't gone into this that much. Consider OpenAL since Kazade recently ported it to the DC and it exists on PC.