1. SDL2 and Sound

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

new topic     » topic index » view message » categorize

2. Re: SDL2 and Sound

ChrisB said...

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: SDL2 and Sound

Ok, thanks.

Yor so loud library seems more flexible anyway.

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

4. Re: SDL2 and Sound

ChrisB said...

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: SDL2 and Sound

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: SDL2 and Sound

ChrisB said...

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu