NateRickard / Plugin.AudioRecorder

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

Can't change the default filepath #30

Closed j0k3r87 closed 5 years ago

j0k3r87 commented 5 years ago

Hello I am using your Plugin to record and save an audio file. If I leave the Filepath parameter blank it works fine, but if I set the parameter to "Filepath = PCLStorage.FileSystem.Current.LocalStorage.Path" I always get the error that I don't have permission to access that directory. That occurs in UWP and Android, even though I followed your instructions.

Is there any way I can solve that problem?

NateRickard commented 5 years ago

One thing that looks off - the Filepath should be the full path to an actual file, not a directory, which it appears LocalStorage.Path is. So maybe if you added a filename to your path, e.g. Path.Combine(PCLStorage.FileSystem.Current.LocalStorage.Path, "myfile.wav") it would work? Also, there may be a different permission needed in the manifest depending on what that path maps to on that OS.

@ryanwersal added this ability in #15 so he may have ideas on this as well.

j0k3r87 commented 5 years ago

Hello Nate, your suggestion works like a charm :-) After I added the filename it works how it is supposed to.

Thank you very much !