SDL_Mixer - Load OGGs as samples, not music

I’d like to use OGGs for my sound FX, as well as my music.

Mix_LoadMUS can load OGGs just fine, but only works for
the special ‘music’ channel.

There appears to be no function equivalent to Mix_LoadWAV
for loading OGGs.

If need be, I can do this ahead of time, caching out the
uncompressed OGGs to WAVs. I’m open to using other
libraries besides SDL_Mixer as well, but hopefully nothing
too complex.

Suggestions?

I’d like to use OGGs for my sound FX, as well as my music.

SDL_sound is just the thing, you can find it at:
http://www.icculus.org/

See ya,
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Mix_LoadWAV can load oggs too.On 5/19/06, Phil Steinmeyer wrote:

I’d like to use OGGs for my sound FX, as well as my music.

Mix_LoadMUS can load OGGs just fine, but only works for
the special ‘music’ channel.

There appears to be no function equivalent to Mix_LoadWAV
for loading OGGs.

If need be, I can do this ahead of time, caching out the
uncompressed OGGs to WAVs. I’m open to using other
libraries besides SDL_Mixer as well, but hopefully nothing
too complex.

Suggestions?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hello Phil,

Friday, May 19, 2006, 1:35:09 AM, you wrote:

PS> I’d like to use OGGs for my sound FX, as well as my music.

PS> Mix_LoadMUS can load OGGs just fine, but only works for
PS> the special ‘music’ channel.

PS> There appears to be no function equivalent to Mix_LoadWAV
PS> for loading OGGs.

PS> If need be, I can do this ahead of time, caching out the
PS> uncompressed OGGs to WAVs. I’m open to using other
PS> libraries besides SDL_Mixer as well, but hopefully nothing
PS> too complex.

PS> Suggestions?

If you check the source, you will see that Mix_LoadWAV() handles more
than just wav format, and one of them is Ogg. It works because one of
my game ports uses it ;)–
Best regards,
Peter mailto:@Peter_Mulholland

Peter Mulholland wrote:

Hello Phil,

Friday, May 19, 2006, 1:35:09 AM, you wrote:

PS> I’d like to use OGGs for my sound FX, as well as my music.

PS> Mix_LoadMUS can load OGGs just fine, but only works for
PS> the special ‘music’ channel.

PS> There appears to be no function equivalent to Mix_LoadWAV
PS> for loading OGGs.

PS> If need be, I can do this ahead of time, caching out the
PS> uncompressed OGGs to WAVs. I’m open to using other
PS> libraries besides SDL_Mixer as well, but hopefully nothing
PS> too complex.

PS> Suggestions?

If you check the source, you will see that Mix_LoadWAV() handles more
than just wav format, and one of them is Ogg. It works because one of
my game ports uses it :wink:

then…
shouldnt Mix_LoadWAV() be renamed into something linke Mix_Load_Sound() ??
otherwise it ALWAYS will lead to confusions for beginners. or it should
be stated clearly in the docs wich file formats can be loaded.

just because im lazy to try the latest sdl_mixer, whats the actual
status concerning loading oggs via sdl_rwops - either as a music stream
or a sound effect? what works, what not? in my version of sdl_mixer, i
had to patch it into the source by myself.

and another question: i experience some sorts of sound lags ( im using
already 1.2.7 , but the older version from 16.07.2005) if i play wav
files with sdl mixer its just about some milliseconds - maybe 20 or so.
but these short delay gives alread the impression that the sound lags
behind an action, for example a bump of a falling block. anyone else
experienced such delays?

Hello !

then… shouldnt Mix_LoadWAV() be renamed into something linke
Mix_Load_Sound() ??
otherwise it ALWAYS will lead to confusions for beginners. or it should be
stated clearly in the docs wich file formats can be loaded.

What about adding some dummy functions to SDL Mixer
that just use Mix_LoadWAV() but may be named Mix_LoadMP3()
and Mix_LoadOGG() ?

CU

then… shouldnt Mix_LoadWAV() be renamed into something linke
Mix_Load_Sound() ??
otherwise it ALWAYS will lead to confusions for beginners. or it should be
stated clearly in the docs wich file formats can be loaded.

What about adding some dummy functions to SDL Mixer
that just use Mix_LoadWAV() but may be named Mix_LoadMP3()
and Mix_LoadOGG() ?

IMHO, better to change it to Mix_LoadSound() (or similar) and just
provide a dummy function or macro that maps the out-dated Mix_LoadWAV to
it. Kinda like SDL_AllocSurface().On Fri, May 19, 2006 at 10:20:22PM +0200, Torsten Giebl wrote:


Steaphan Greene
Lecturer, Computer Science, Binghamton University
GPG public key: http://www.cs.binghamton.edu/~sgreene/gpg.key.txt
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060519/84e5828e/attachment.pgp

Perhaps it’s time to rename “Mix_LoadWAV” to “Mix_LoadSound”, and have calls
to “Mix_LoadWAV” report a "this function is deprecated; use Mix_LoadSound"
message during compilation? ;^)On Fri, May 19, 2006 at 11:11:31AM +0100, Peter Mulholland wrote:

If you check the source, you will see that Mix_LoadWAV() handles more
than just wav format, and one of them is Ogg. It works because one of
my game ports uses it :wink:


-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/

Hello !

If you check the source, you will see that Mix_LoadWAV() handles more
than just wav format, and one of them is Ogg. It works because one of my
game ports uses it :wink:

Perhaps it’s time to rename “Mix_LoadWAV” to “Mix_LoadSound”, and have
calls to “Mix_LoadWAV” report a "this function is deprecated; use
Mix_LoadSound"
message during compilation? ;^)

+1, maybe using the name Mix_LoadSample,
for me it sounds clearer than Mix_LoadSound.

CU