Sdl audio jittering

Gabriel schrieb:

Ok. You can’t in a clean way.
I guess you decode the .oggs on loading and use them as sounds in
sdl_mixer. Or something equally complicated. I haven’t seen a good way
yet.

Good way as in.

THE_Sound *s = mix_loadafilethatcontainsaudiodata(“bla.mp3”);
THE_Sound *paralell = mix_loadafilethatcontainsaudiodata(“bananarama.ogg”);
mix_play(s);
mix-play(paralell);
//be happy

Actually yes, I do it almost like you say. Ripping my source to show
only the relevant lines,

   Mix_Chunk* m_pData;
   SDL_RWops* pRWOps = SDL_RWFromMem(pResource->getData(),
   pResource->getSize());
   m_pData = Mix_LoadWAV_RW(pRWOps, false);
   [...]
   return Mix_PlayChannel(0, m_pData, 0);

Instead of keeping telling me that the thing I’ve been doing for ages
doesn’t work, why don’t you just try it and see that it works?

   --Gabriel

wait…
are you decompressing the mp3 beforehand and then read use
Mix_LoadWAV_RW to create a mix_chunk from the decompressed data?

Really? I just tried loading a .mp3 through Mix_LoadWAV (through the
SDL_Mixer’s playwave example) and it didn’t work (Couldn’t load a.mp3:
Unrecognized sound file type)…

Ricardo Cruz schrieb:> And it is a documented behavior, so it should work well in all systems:

http://www.libsdl.org/cgi/docwiki.cgi/Mix_5fLoadWAV

I’m really (happily) suprised about this. I really think you should change
the function name. You just need to add a macro like:
#define Mix_LoadSample Mix_LoadWAV
This will not break API or ABI compatibility and it would be not misleading.

Cheers,
Ricardo

Em Quarta 16 Novembro 2005 04:52, o Gabriel escreveu:

Havin Mix_LoadWAV_RW load other formats too is a bit strange after all.
And if sdl_mixer is capable of that why didn’t they add a generic
load_compressedformatintosound() ?

As I said in the other email, I think there’s little doubt that the name
is indeed misleading. But hey, it works :slight_smile:

   --Gabriel