Protofall / Crayon-Game-Framework

My own library for making games on the Dreamcast
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Crayon: Figure out a sound/music solution #153

Open Protofall opened 5 years ago

Protofall commented 5 years ago

I haven't gone into this that much. Consider OpenAL since Kazade recently ported it to the DC and it exists on PC.

Protofall commented 5 years ago

SDL also has a sound solution to consider

Protofall commented 5 years ago

Note to use CDDA music I have to use mds4dc instead of cdi4dc? I'll have to look into getting CDDA to work sometime.

Protofall commented 4 years ago

Note, sudo apt-get install libopenal-dev will install OpenAL on Linux

Protofall commented 4 years ago

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.*)

Protofall commented 4 years ago

Note: To get MojoAL working on PC we do sudo apt-get install libsdl2-dev instead of the normal openal software

Protofall commented 4 years ago

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.

Protofall commented 4 years ago

Although I'm using OpenAL-Soft for PC and ALdc for Dreamcast, I'm going to move this issue to v0.3

Protofall commented 4 years ago

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.

Protofall commented 3 years ago

For OGG support, Kazade recommends this

Also I should modify my audio code to be able to stream audio from RAM (Currently only allow from disc)

Apparently this streams straight to the acia. And stream direct driver here.