Hi all,
I have a strange bug. I m trying to convert wav file into ogg file. I changed the JUCE OGG format writer code to accept VBR mode. And also to accept various constant bitrate modes from -1 to 10. ( it was “Low Quality” , “Medium Quality” and “High Quality” )
[code]//The Changes is done for providing option for variable bitrates
int iReturnValue = 1;
Maybe if you use vbr mode you’re supposed to use different functions for writing the data?.. Or if samples are missing at the end, perhaps there’s an extra flush required when it’s finished?
but i m using CBR mode for encoding… Wait i will revert back and test with the original code u had…
And i Also checked with the flush before…
if we use the flush before deleting the filestream then the sample count is improved but not exact…
for example if i had 10000 samples in wav file, i get 5728 samples without using flush and around 7000 odd samples if i use flush in the destructor…
Sorry u have written code only for VBR i guess…
I searched in the net and most of the libraries use thre modes VBR , CBR and ABR
and all the libraries use more or less the same code as u used for writing. But the difference i found out was only in loops start and end.
I tried reverting back my code… But the problem is still same…
I used wave file of 441000 samples to convert to ogg and i found in the oggreader that it has only 438404 samples in it.
Here is the screen shot my app which shows sample missing at the end.
Well, that’s not necessarily a bug - it’s a block-based format so will probably round things to the nearest block, and if the last few samples are empty, there’s no reason why it’d bother storing them. Try a file that doesn’t have any silence at the end.
Well I used one wave file with dense samples at the end but result is still same…
I used file of 161920 samples, resultant ogg file has 160896 samples in it here is the screen shot.