Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 1110 [details]
Most of the Audio File Services Read functions (AudioFileReadBytes, AudioFileReadPackets) will return -1 when they encounter the EOF "error" (-39). However, from what I can tell this isn't really an error on iOS, it just means you have reached the end of the file. And the amount of data read will be specified in an out pointer.
This means on MT a kind of standard read/eval loop doesn't work properly, returning -1 on the last chunk of data (small test case attached)
(NOTE: You'll have to move 1.caf into your apps Documents directory)
The workaround for this issue is to just trim the file read to the length of the file, but that isn't very elegant.
For your test file I can't make AudioFileRead read more than 134640 bytes no matter what I do - maybe some data is discarded (headers, non-audio data, etc) when reading?
Oh, i forgot to add the header info in the CWL, but for a car it should be 4096 bytes.
And 134640 (the amount read with your test code) + 4096 = 138736 which is the size of the file.
Fixed, will be included in 5.1.3.