NateRickard / Plugin.AudioRecorder

Audio Recorder plugin for Xamarin and Windows
MIT License
164 stars 68 forks source link

Streams not cleaned up in WaveRecorder when Exception occurs #26

Closed walterg2 closed 6 years ago

walterg2 commented 6 years ago

Problem Statement: While using the AudioRecorder plugin, if a situation occurs where the AudioStream implementation throws an exception (the easiest one to replicate is to deny access to the Microphone), the WaveRecorder does not dispose of the FileStream and BinaryWriter objects. This makes it so you cannot clean up the directory and file that is requested the wav file to be saved to.

NateRickard commented 6 years ago

@walterg2 I've released v1.0.2-pre where I attempted to handle this with some additional cleanup. However, I can't reproduce the exception when I'm debugging... tried to decline the iOS mic prompt but it seems to allow me to continue to use the APIs w/o throwing errors. Can you install and verify this release takes care of the issue you're seeing?

NateRickard commented 6 years ago

Closing this issue but would be great if anyone could confirm this is fixed in the latest releases.