search for: pcmtotal

Displaying 5 results from an estimated 5 matches for "pcmtotal".

2005 Nov 05
1
buffer overruns for small files
...9kb file, so <= 8), it seems that I get an inaccurate value for ov_pcm_total. Though ov_read returns zero, I overflow the buffer and crash on ov_clear. These are my TRACE statements: >= 10kb: Opening Audio File 'no_0.ogg' vi->channels = '2' vi->rate = '44100' pcmTotal = '15341' pcmTotal * vi->channels * 2 = '61364' BufferSize = '61364' dwBufferLength = '61364' BufferSize = '61364' dwBufferLength - BufferSize = '0' ------------ < 10kb: Opening Audio File 'Steel guitar_4.ogg' vi->channels = '2...
2015 Dec 02
2
A few questions about libvorbis from a newbie
First off, I don't even know if this is the right place to ask these kind of questions, but I haven't been able to find answers anywhere else, so 1. I have found that "pcmTotal * vorbisInfo->channels * 2" gives the uncompressed size of every ogg vorbis file I have used. What is a more robust way of getting the full uncompressed file size? 2. How do I read a certain amount of ms of data? For example, I have been using sizeUncompressed / seconds / 4 (using the abov...
2005 Nov 01
2
predictability of buffer size for decoding
...ttle less than 10% too small. I "solved" that by padding the result with an extra 20 percent. However, I have been told that I should be able to rely on the value of ov_pcm_total. char* m_pDataVorbis; . . . OggVorbis_File vf; . . . vorbis_info* vi = ov_info(&vf,-1); . . . int pcmTotal = ov_pcm_total(&vf, -1); m_pDataVorbis = new char[pcmTotal * vi->channels * 2]; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20051101/33d6782e/attachment.html
2015 Dec 04
1
A few questions about libvorbis from a newbie
Sorry about the personal reply Ian. I hope keeping the subject the same is the way to reply to the list (I have never used a mailing list before). The last thing I am not grasping is how *pcm_total *works without a concept of sample size? If the sample size is whatever I decide to read it as, how does it calculate the number of samples (of one channel I'm assuming because we have to multiply
2015 Dec 04
1
A few questions about libvorbis from a newbie
...s (e.g. 4096 samples per block when audio information is sparse, or 256 samples per block when dense). So when the decoder fetches a block from the Ogg stream, it can determine the number of samples inside it just by reading the "blocksize" flag in the block header (thus you can calculate pcmtotal as the sum of blocksizes). However, libvorbis uses a different approach to calculate pcmtotal. It is dictated in the Vorbis I spec that all encoders must populate the absolute granularity field (I recall this field is left for implementation-defined use) of each Ogg packet with "the total num...