Hi, I have this code to decode ogg data: unsigned long PSS_OggStream::DecodeOggVorbis(OggVorbis_File *psOggVorbisFile, char *pDecodeBuffer, unsigned long ulBufferSize, unsigned long ulChannels) { int current_section; long lDecodeSize; unsigned long ulSamples; short *pSamples; unsigned long ulBytesDone = 0; while (true) { #ifdef WIN32 lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, ulBufferSize - ulBytesDone, 0, 2, 1, ¤t_section); #elif MACOSX // El cuarto parametro es lo del big endian de los cojones lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, ulBufferSize - ulBytesDone, 1, 2, 1, ¤t_section); #endif if (lDecodeSize > 0) { ulBytesDone += lDecodeSize; if (ulBytesDone >= ulBufferSize) break; } else { break; } } return ulBytesDone; } This works fine on Windows, but on MacOSX, after ov_read call, pDecodeBuffer is full of 128, -128, 0... I mean, non sense data. Any idea??? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20110715/f149ff9f/attachment.htm
Hello there! Am 15.07.2011 13:48, schrieb Juan Miguel Mart?n Mu?oz:> #ifdef WIN32 > lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, > ulBufferSize - ulBytesDone, 0, 2, 1, ¤t_section); > #elif MACOSX // El cuarto parametro es lo del big endian de los cojones > lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, > ulBufferSize - ulBytesDone, 1, 2, 1, ¤t_section); > #endif> > This works fine on Windows, but on MacOSX, after ov_read call, > pDecodeBuffer is full of 128, -128, 0... I mean, non sense data. > > Any idea???Modern Macs use Intel x86 hardware, so therefor they use little endian byte ordering as well (afaik). Have you tried ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, ulBufferSize - ulBytesDone, 0, 2, 1, ¤t_section); on MacOSX? Regards Christian
Hi Christian! thank for the reply. I have tried with "0" too and I got the same result :( 2011/7/15 Christian Lins <christian at lins.me>> Hello there! > > Am 15.07.2011 13:48, schrieb Juan Miguel Mart?n Mu?oz: > > #ifdef WIN32 > > lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, > > ulBufferSize - ulBytesDone, 0, 2, 1, ¤t_section); > > #elif MACOSX // El cuarto parametro es lo del big endian de los cojones > > lDecodeSize = ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, > > ulBufferSize - ulBytesDone, 1, 2, 1, ¤t_section); > > #endif > > > > > This works fine on Windows, but on MacOSX, after ov_read call, > > pDecodeBuffer is full of 128, -128, 0... I mean, non sense data. > > > > Any idea??? > > Modern Macs use Intel x86 hardware, so therefor they use little endian > byte ordering as well (afaik). Have you tried > > ov_read(psOggVorbisFile, pDecodeBuffer + ulBytesDone, > ulBufferSize - ulBytesDone, 0, 2, 1, ¤t_section); > > on MacOSX? > > Regards > Christian > _______________________________________________ > Vorbis-dev mailing list > Vorbis-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/vorbis-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20110715/2bff3dc4/attachment.htm
The only other thing that might have gone wrong is that instead of "unsigned" "signed" is to be used for the audio data. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20110717/f64e56f5/attachment.pgp