A library to play Vorbis files with SDL?

What is a good library to play Vorbis data with SDL2? Must be in C and
free software. I tried vorbisfile but I’m hating it (and I’m having
some odd error I can’t seem to be able to track down). I thought of
SDL_mixer but I can’t find the SDL2 version (was that library
ported?). Is there anything else?

What I need:

  • I should be able to make it use PhysicsFS somehow
  • I’m just uploading the entire sound into memory (this is for sound effects)
  • I don’t care about bitstreams past the first one (for now at least)

Any suggestions?

2012/10/25 Sik the hedgehog <sik.the.hedgehog at gmail.com>

What is a good library to play Vorbis data with SDL2? Must be in C and
free software. I tried vorbisfile but I’m hating it (and I’m having
some odd error I can’t seem to be able to track down). I thought of
SDL_mixer but I can’t find the SDL2 version (was that library
ported?). Is there anything else?

What I need:

  • I should be able to make it use PhysicsFS somehow
  • I’m just uploading the entire sound into memory (this is for sound
    effects)
  • I don’t care about bitstreams past the first one (for now at least)

Any suggestions?

SDL_mixer works just fine with SDL2 (at least the checkout from HG), to
play ogg files it uses libvorbis/libogg or Tremor (which is a good idea for
mobile platforms), I use this setup regularly in my engine.–
Gabriel.

Actually better question: how does SDL_mixer work exactly? Does it
actually involve SDL or does it just fill a buffer and it’s up to the
program to send it to SDL? (never used SDL_mixer before, heck, this is
my first SDL game, period)

2012/10/25 Gabriel Jacobo :> 2012/10/25 Sik the hedgehog <@Sik_the_hedgehog>

What is a good library to play Vorbis data with SDL2? Must be in C and
free software. I tried vorbisfile but I’m hating it (and I’m having
some odd error I can’t seem to be able to track down). I thought of
SDL_mixer but I can’t find the SDL2 version (was that library
ported?). Is there anything else?

What I need:

  • I should be able to make it use PhysicsFS somehow
  • I’m just uploading the entire sound into memory (this is for sound
    effects)
  • I don’t care about bitstreams past the first one (for now at least)

Any suggestions?

SDL_mixer works just fine with SDL2 (at least the checkout from HG), to play
ogg files it uses libvorbis/libogg or Tremor (which is a good idea for
mobile platforms), I use this setup regularly in my engine.


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It uses SDL and sends the data on its own.On 26/10/12 02:43, Sik the hedgehog wrote:

Actually better question: how does SDL_mixer work exactly? Does it
actually involve SDL or does it just fill a buffer and it’s up to the
program to send it to SDL?

What is a good library to play Vorbis data with SDL2? Must be in C and
free software. I tried vorbisfile but I’m hating it

Are you using libvorbis, or libvorbisfile? libvorbisfile is really easy
(here’s my data, give me back uncompressed audio), libvorbis is pretty
miserable to use directly.

–ryan.

Note to self: swapping the file and buffer parameters in the read
callback is not a good idea. Also thanks to gdb for being so unhelpful
and not even showing me where it crashed (had to use valgrind for that
and in the end it was still all guessing).

Also huh, I thought I had replied to the mailing list? kicks gmail

2012/10/26 Sik the hedgehog <@Sik_the_hedgehog>:> Using vorbisfile, the problem is that it’s still pretty annoying.

Maybe I’m asking for too much, basically there’s still the whole
bitstream separation issue as well as the lack of downsampling (e.g.
there are tons of possible channel combinations and I have to handle
every one of them, which gets really annoying).

First I’ll see if I can fix some crash when trying to open the file
(WTF uninitialized memory?), then I’m going to check what I do with
it. Passing structs as function parameters (as opposed to pointers)
doesn’t feel very nice though… (yes, ov_open_callbacks does that
facepalm)

2012/10/26 Ryan C. Gordon :

What is a good library to play Vorbis data with SDL2? Must be in C and
free software. I tried vorbisfile but I’m hating it

Are you using libvorbis, or libvorbisfile? libvorbisfile is really easy
(here’s my data, give me back uncompressed audio), libvorbis is pretty
miserable to use directly.

–ryan.