1. SDL2 and Sound
- Posted by ChrisB (moderator) Nov 03, 2022
- 565 views
Hi Andy
Can't see a simple way to play a sound, would expect something like (pseudocode, and a bare minimum)
ptr = load_sound_file("sound file") play_sound(ptr) pause / volume / locate (ptr) unload_sound(ptr)
What you have in euSDL2 doesn't look like the SDL2 docs, or it does in some places, so I'm having difficulty referencing what I think are the legacy SDL sound functions with the current SDL (2.07 +) SDL sound functions.
Do you have any examples for performing the most basic sound functions using euSDL2?
Cheers
Chris
2. Re: SDL2 and Sound
- Posted by Icy_Viking Nov 03, 2022
- 545 views
Hi Andy
Can't see a simple way to play a sound, would expect something like (pseudocode, and a bare minimum)
ptr = load_sound_file("sound file") play_sound(ptr) pause / volume / locate (ptr) unload_sound(ptr)
What you have in euSDL2 doesn't look like the SDL2 docs, or it does in some places, so I'm having difficulty referencing what I think are the legacy SDL sound functions with the current SDL (2.07 +) SDL sound functions.
Do you have any examples for performing the most basic sound functions using euSDL2?
Cheers
Chris
I don't have any examples of sound using SDL 2's built in sound. SDL 2's built in sound functions are cumbersome and I tried to wrap them best I could. I think your best bet would be to use SDL2 Mixer for sound. I plan to remake that wrapper with Greg's FFI library in the near future. I already re-wrote SDL 2 using the FFI library, so that it could better handle structs.
3. Re: SDL2 and Sound
- Posted by ChrisB (moderator) Nov 03, 2022
- 549 views
Ok, thanks.
Yor so loud library seems more flexible anyway.
Cheers
Chris
4. Re: SDL2 and Sound
- Posted by Icy_Viking Nov 03, 2022
- 531 views
Ok, thanks.
Yor so loud library seems more flexible anyway.
Cheers
Chris
No problem. I hope to get around to rewriting SDL Mixer 2 in the very near future as well as the other SDL add-on libraries. I forgot about SoLoud until you mentioned it. SoLoud is a pretty flexible audio library. You should be able to mix and match SDL and SoLoud. SDL for graphics/display and SoLoud for SFX and Music and Sound.
5. Re: SDL2 and Sound
- Posted by ChrisB (moderator) Nov 04, 2022
- 516 views
Yes, just because you load one dll, doesn't mean you can't load another.
As a technical point, if you are using ffi for sdl2, will you still be able to use soloud in it's 'native form, or will all libraries need to be ffi compliant?
Cheers
Chris
6. Re: SDL2 and Sound
- Posted by Icy_Viking Nov 04, 2022
- 515 views
Yes, just because you load one dll, doesn't mean you can't load another.
As a technical point, if you are using ffi for sdl2, will you still be able to use soloud in it's 'native form, or will all libraries need to be ffi compliant?
Cheers
Chris
I'm not sure about mixing and matching an FFI library with one that wasn't written with the FFI library. I'd assume it would work, though.