Sample properties in playsound...
Torbjörn Andersson
torbjorn.e.andersson at tietoenator.com
Fri Oct 5 10:34:32 EDT 2001
Ryan C. Gordon wrote
> NewSampleFromFile() is just a convenience function; if you need to
> specify something different ("mysound.bin" is really an MP3 file, for
> example), then you should do:
>
> SDL_RWops *rw = SDL_RWFromFile("mysound.bin", "rb");
> Sound_Sample *sample = Sound_NewSample(rw, "MP3", desired, bufsize);
Yes, that makes sense. What I was thinking was that maybe it would make
sense to have something like
$ playsound --ext MP3 foobar.gif
just for testing purposes. Then again, maybe not...
> My thought is that with decoders like RAW, if no desired format is
> specified, than the decoder's open() method fails; we can pick a
> sensible default, but if that sensible default is wrong, you get a lot
> of jarring noise; I'd rather have the decoder politely refuse.
Ok, so only the MOD and MIDI decoders need fixing to handle the NULL
case? Does the included - untested - patch look sensible?
Torbjörn Andersson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: null.diff.gz
Type: application/x-gzip
Size: 640 bytes
Desc: not available
URL: <http://icculus.org/pipermail/sdlsound/attachments/20011005/0c370a44/attachment.gz>
More information about the sdlsound
mailing list