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.
The AudioFile::WritePackets calculates the length of the packets to write using the length of the AudioStreamPacketDescription array, but this is incorrect. Its possible to pass AudioFileWritePackets NULL for inPacketDescriptions but still have valid packet data - this is the norm when generating audio.
From a quick look it doesn't look like it's possible to calculate the packet size (and the number of packets), so a new overload would be required:
public int WritePackets (bool useCache, long inStartingPacket, int numPackets, IntPtr buffer, int count)
does that sound like it would solve your problem?
The ideal would probably be the new overload and obsoleting the old one which isn't a very common usage IMO. It might be a good time to fix the error results too. I think it would be easier if it just returned the error rather than the length (like the iOS functions).
Up to you guys though, I'm p/invoking it myself now, so I don't really care.
Fixed, will be included in 5.1.3.
I just added the a new overload.