[Vorbis-dev] I have problems encoding 11025SpS, 16bits, Mono sound.

rezprom at mail.bg rezprom at mail.bg
Tue Mar 7 08:35:51 PST 2006


Hello.
I am trying to implement ogg vorbis compression in my
recorder.
I am using DirecSound with one second long buffer.

Everything works except that, when i compress the 11025SpS,
16bit, Mono sound the result
is awful(link:
http://www.qsl.net/lz1abc/Oggtestfile11025_16bit_Mono.ogg);
All the other combinations from
8000,11025,22050,44100SpS/16,8bit/Mono,Stereo works.

Here is the code i use:

float
**inputBuffer=vorbis_analysis_buffer(&vd,params.iSampleRate/2);

if (params.iBitsPerSample == 8) {
		unsigned char *pReadBuff = (unsigned char *)pReadBuffer;

		for(i=0;i<params.iSampleRate/2;i++) {
			for(int j=0;j<params.iStereo;j++) {
				inputBuffer[j][i]=((int)(pReadBuff[i*params.iStereo +
j])-128)/128.0f;
            }
        }
     }
	 else {
		 for(i=0;i<params.iSampleRate/2;i++) {
			for(int j=0;j<params.iStereo;j++) {
				inputBuffer[j][i]=((int)(pReadBuffer[i*2*params.iStereo
+2*j +1]<<8) |
					(pReadBuffer[i*2*params.iStereo+2*j] & 0xff))/32768.0f;
             }
         }
     }



My buffer half a second long. I encode on the fly and write
the data into .ogg files.

P.S. NOw when i try with 11024Samples per Sec 16bit,Mono it
works fine....

Porti


-----------------------------

“БЯЛА КНИГА на българските телекомуникации, услуги и технологии”
Регистрирай се и я изтегли БЕЗПЛАТНО!
www.jnn-marketing.com/WPTelecom.htm 



More information about the Vorbis-dev mailing list