Open hailiang194 opened 3 weeks ago
As what I investigated, we need:
As what I investigated, we need:
- Audio management(Thing used to control configuration of audio)
- Sound base data(Which is used to store information about a sound)
- Sound behavior(Play, Pause, Resume, etc.) Also, I saw that raylib has Music and Audio stream. Should we also implement them?
OK, So let see. We need thing to manage:
As what I investigated, we need:
- Audio management(Thing used to control configuration of audio)
- Sound base data(Which is used to store information about a sound)
- Sound behavior(Play, Pause, Resume, etc.) Also, I saw that raylib has Music and Audio stream. Should we also implement them?
OK, So let see. We need thing to manage:
- Audio device
- Sound
- MusicStream
- AudioStream Audio device, really clean but what the diffent between Sound, MusicStream and AudioStream. Let's investigate them
I saw a really clear answer here https://www.reddit.com/r/raylib/comments/1awj78f/music_vs_sound_vs_audio/
So basically, Sound is thing stay in RAM, MusicStream is stay in disk and audio is an audio buffer we can managed.
It's impossible that game have no sound. Now it's time to implement it As what I see, raylib already has the sound function. Let's investigate it. https://www.raylib.com/cheatsheet/cheatsheet.html#paudio
Audio device (manage the device)
This one allow us to initialize audio device and also set the volume of the app. To initialize and initialize, we have to do it at the start and close the game. All so we need a method to get and set volume for the app.
Sound (load fully on RAM, it is better to use for short audio)
This one can be loaded from file or sound wave, but we just use file. This one is able to play, resume and pause also set volume, pitch and pan
We need some thing to manage all of the sound and sound base class. The management class store all the sound and be able to unload all of them when the game is end. Sound base class must be able to play, pause and resume. Also they must be able to set volume, pitch and pan.
Music stream(also located in RAM and disk, it should be used for long audio)
This one can be loaded from file or memory, but we just use file. This one is able to play, resume and pause also set volume, pitch and pan
We need some thing to manage all of the sound and music base class. The management class store all the music and be able to unload all of them when the game is end. Music base class must be able to play, pause, resume and seek. Also they must be able to set volume, pitch and pan.
Audio stream(Audio buffer we can manage). This one is not yet implemented