I’m using fmod 4.24.00 on linux. Calling readData() on an ogg vorbis sound created with OPENONLY always returns FMOD_ERR_FILE_EOF, whereas the same code works fine with other formats. The file plays with no problems when opened as a stream.
- snzk asked 9 years ago
Yes it would seem the OGG codec reports end of file in this case, however it isn’t the end of the file, this is just the decoder not being able to provide size you request.
If you stick to multiples of the sample size you should be fine. I will fix our code to report invalid parameter in the case of a failure from OGG.
Is the problem perhaps just that the ogg file is smaller than the "lenbytes" you are requesting? It is normal for readData() to return FMOD_ERR_FILE_EOF when it has read / decoded the whole file. You should check the value of "read" returned by the function. The value will most likely be less than "lenbytes" but greater than 0, this is an indication of successfully reading the whole file.
If you are still having problems, please check the offlinedecoding example application and substitute in the ogg file you are having problems with to ensure it works correctly.
Thanks for the reply. I discovered the problem: readData() will return EOF if I request a size that is not a multiple of the sample size, but it will read up to the closest multiple (I was trying to read only one channel of a single sample so I got nothing). However, wav/flac/mp3 don’t behave this way.
- snzk answered 9 years ago
Please login first to submit.