[Vorbis] Recorded webm file can be played, but much faster than expected

LuoGang leonardoluo at hotmail.com
Tue Aug 7 00:13:49 PDT 2012


I am a new developer on Vorbis. Now I want to create a audio-only webm file from the micrphone. Vorbis encoder is necessary for the creation. 

Here is the procedure of the steps: 
1. Initialize Vorbis environment. 
2. Generate the header and export to the output stream. 
3. Get the PCM samples of certain size. 
4. Divide the original PCM data into Vorbis block. 
5. Encode the block into Ogg packet. 
6. Export the Ogg packet to the output stream. 
7. Loop to 3rd step, until the microphone collection ends. 
8. Clear Vorbis environment. 
The generated webm file is something OK. I can hear something when playing it. However, the playback speed will be much faster than expected. E.g. If I record the voice for about 30 seconds, then the generated webm file can only be played for 2-3 seconds. The generated file can be parsed normally by libwebm program, but the block granulepos seems not normal. Most of the differences of the adjacent granulepos's are 2-3 millisecond, also few are 12-13 or 22-23 milliseconds. 
Is there anything wrong with my steps? Any clue? 
 
If you need more information for the investigation, please let me know. 
 
Would someone reply at his earliest? Thanks in advance.

Best regards, Garfield 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis/attachments/20120807/267c8260/attachment.htm 


More information about the Vorbis mailing list