Hello Friends,
I'm using Silverlight to record an audio in .wav format and to store.
When I'm using SaveFileDialog Box then it save the file.
Here is the following code.
Stream stream = saveFileDialog.OpenFile();
WavManager.SavePcmToWav(_sink.BackingStream,stream,_sink.CurrentFormat);
stream.Close();
public static void SavePcmToWav(Stream rawData,Stream output, AudioFormat audioFormat)
{
if (audioFormat.WaveFormat != WaveFormatType.Pcm)
throw new ArgumentException("Only PCM coding is supported.");
BinaryWriter bwOutput = new BinaryWriter(output);
But When I want to do this without savefiledialog then it gives me an error
File Operation is not Permitted. Access Denied.
FileStream stream = new FileStream(@"E:/Audio/abc.wav",FileMode.Create);
WavManager.SavePcmToWav(_sink.BackingStream,stream,_sink.CurrentFormat);
stream.Close();
public static void SavePcmToWav(Stream rawData,FileStream output, AudioFormat
audioFormat)
{
if (audioFormat.WaveFormat != WaveFormatType.Pcm)
throw new ArgumentException("Only PCM coding is supported.");
BinaryWriter bwOutput = new BinaryWriter(output);
I Checked BinaryWriter takes an Stream argument. But I didn't find a way how to pass my custom path to Stream so that BinaryWriter write the wave file at my specified location.
Thanks.