Hi, I fixed the distorted audio bug in the XMMS plugin. A small follows below: --- vorbis.c.orig Mon Oct 11 04:05:14 1999 +++ vorbis.c Mon Oct 11 13:47:42 1999 @@ -161,7 +161,7 @@ /* XXX figure out something to put for the bitrate and how to calculate the length of the stream */ vorbis_ip.output->open_audio(FMT_S16_LE, od.vi.rate, od.vi.channels); - vorbis_ip.set_info(filename, 128000, 0, od.vi.rate, od.vi.channels); + vorbis_ip.set_info(filename, -1, 128000, od.vi.rate, od.vi.channels); while(i < 2) { while(i < 2 && ogg_sync_pageout(&od.oy, &od.og) == 1) { @@ -219,9 +219,11 @@ vorbis_synthesis(&od.vb, &od.op); vorbis_synthesis_blockin(&od.vd, &od.vb); if((samples = vorbis_synthesis_pcmout(&od.vd, &pcm)) > 0) { + gint16 *outptr = pcmout; + for(s = 0; s < samples; s++) for(c = 0; c < od.vi.channels; c++) - pcmout[(s * od.vi.channels + c) * sizeof(gshort)] = pcm[c][s] * 32767; + *(outptr++) = pcm[c][s] * 32767; vorbis_audio_out(pcmout, samples * od.vi.channels * sizeof(gshort), od.vi.channels); vorbis_synthesis_read(&od.vd, samples); --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
> I fixed the distorted audio bug in the XMMS plugin. A small follows > below:Thanks. If Tony doesn't see it today (I'm pretty certain he will), I'll get it into CVS. (Note to Tony; once I get this integrated into autoconf with the rest of Vorbis, use 'sizeXX' for specific word sizes, in this case 'size16' would give you the equivalent of gshort). Monty --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
On Mon, 11 Oct 1999, Peter Alm wrote:> Hi, > > I fixed the distorted audio bug in the XMMS plugin. A small follows > below:Thanks, it sounds a lot better than before. I tried a second time using the file writer plugin and using decode_example, then dumping the results of each to a Mac (I'm not at home and this machine has no sound card) There was a very audible crackle in the sound from the xmms plugin whereas there was none in the decode_example... I may try figuring out what exactly rint() was doing tonight and see if I can't get the code from decoder_example to work again. BTW, this computer (a K6-2 450MHz w\ 128MB RAM) was able to decode in real-time with room to spare. Not that I'm saying you don't need to optomise the algorithm, but it was encouraging... Tony Arcieri --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/