aod6060 / dsge

This is a simple 2D engine for my projects.
MIT License
1 stars 0 forks source link

Sound System #2

Open aod6060 opened 1 month ago

aod6060 commented 1 month ago

If Graphic gives game atmosphere then sound give it ambient. This will be next system after that I'll be working on after the render is almost done. This will be an interesting one because I want to try and implement normal audio and 2D positioning audio without using something like OpenAL but SDL_mixer. It should be a fun challenge. There are 2 particular function which they are.

  1. Mix_SetPanning(int channel, Uint8 left, Uint8 right);
  2. Mix_SetPosition(int channel, Sint16 angle, Uint8 distance);

From looking at the documentation it looks like the only one I'll need is Mix_SetPosition, however, I'm adding in panning to play it safe. However, if the audio system is set to mono then these to function are foobar. If this doesn't work I might have to look at using openal with mp3/ogg files.

aod6060 commented 1 month ago

Here is the introduction video for this issue. dsge_intro_to_sound_system_gh

aod6060 commented 3 weeks ago

Finally I'm going to get started on this issue... Yes something that has nothing to do with the render.

aod6060 commented 3 weeks ago

Alright I've added a bunch of stuff to the sound api. I'm going in a different direction from the initial commit. Instead of a pure function api I've decided to add in structures that will help with using the sound api. They are

  1. MusicPlayer
  2. SoundFXPlayer
  3. SoundFXPlayer2D

All three of them wrap up apart of the api. SoundFXPlayer2D will handle 2D positional sound in the engine.

aod6060 commented 3 weeks ago

Here is a preview video of what I have done so far with the sound system. Mostly focused on the music section of SDL_Mixer api but man its really cool. sound_system_progress_1_preview_1_gh

aod6060 commented 3 weeks ago

I ran into an interesting issue. However, I have fixed which requred me to remove "SoundFXPlayer2D" from the project. Basically if I played the regular SoundFXPlayer it would try to to detect isPlaying in the SoundFXPlayer2D class and would do change the direction of the regular sound player. The fixed will be determined during the time of play.

aod6060 commented 3 weeks ago

Alright I'm currently done with with the sound system. Its pretty much functional now. If I need to add something to I'll do that at a later date. Also I'm going to get started on a "sound_demo" which will show off the sound system.

aod6060 commented 3 weeks ago

Here the second preview video for the Sound System Progress video.

sound_system_progress_1_preview_2_gh

aod6060 commented 3 weeks ago

Alright I've finished the whole progress video for the sound system which will release at 9:00am in the morning. Well I hope ya'll will enjoy my rambling. sound_system_progress_1_gh