Reputation: 1809
Does anyone know how to create an audio file (.wav, .mp3, etc.) in c#? Specifically for a windows phone 7.
Upvotes: 2
Views: 1800
Reputation: 16826
When you are working with the microphone, you get a constantly increasing buffer (for the time of recording). The total byte array represents PCM contents when saved. So to say, that is the WAV file with missing header information. Here is a great blog post on how to add that header information: http://damianblog.com/2011/02/07/storing-wp7-recorded-audio-as-wav-format-streams/
If you decide to convert the content to MP3, you will have to implement your own conversion layer since the OS itself (Windows Phone) lacks the capabilities to do this.
Upvotes: 4