C# Audio Tutorial 7 : Recording to a Wave File

C# Audio Tutorial 7 : Recording to a Wave File

In this tutorial we build upon Tutorial 6 by adding the ability to write the WaveIn data to a wave file. This tutorial is nice and short because we start wit…


For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.

Thanks for your time, man. Great video! You prepared for it.?

Hi does anyone knows how to save a byte array to mp3 file and to specify
the sample rate of the file??? ?

hi thanks for that , how can i get the Wave in byte[] while i record it ?

you are amazing….thanks for your video?

Hey, Thank you so much for the tutorials, really a great help in my
personal project! I am really looking to take this one step farther, even
though I am pretty inexperienced with naudio and I am not sure if it is
even possible. I really want to be able to inject the audio file recorded
to play through the microphone. Is this even possible??

Hello +GiawaVideos,
how do you edit your existing code to allow the program to record 2 or more
devices to the same wav file? :)?

Hi Giawa

Is it possible to convert these files with a android packager (apk) in
order to run on android? ?

Thanks, It was really useful i wish i found this earlier today :/ wasted my
whole day searching?

Thanx for the tutorial. I just wanna ask that can i use this code in
windows 8.1 App as well?? I mean Is that compatible with Windows 8

Hello Giawa, Is it possible to process the sound streams without recording
into a file? Thanks in advance..?

Thank You GIAWA! I trust You! And I’ll try to undestand if You’re right!
Thank you for your precious advice! Anyway, somewere, I’ve reed that the
soundboard, only send you GROUPS of samples. It read them, convert them
into digital format, store them into a buffer and every(for ex.256
readings) send them to you. So They say that ACTUAL REAL-TIME with a sound
card isn’t possible! If you are so kind, comment this thing please. Aniway
Thanks!!!!!!!! I’m going to your tutorial 🙂

@vetshamino The code is available to download from the link included in the
video description. It’s located in the RAR file as a .cs code file. Good

love that starcraftII icon 😉

I downloaded your sample code. Added the Naudio Reference, But for some
reason my list is coming up empty, meaning I do not see any listed audio
devices. The app compiles fine without any errors or warnings. I am using
C# 2010 Any Suggestions !!!

When I run this compiled, I get an UE that tells me my channels should be
greater than 1 (it’s -1). The microphone works well with Dragon
NaturallySpeaking (just tested it to be sure). I haven’t monkeyed with your
code and am compiling in VS 2010. Should I be doing something I am not?

can u make ur own decoder to play all audio file? thanks 🙂

Hi NABUKENAEZER, This could occur if there are no DirectSound inputs on
your computer. Do you have a mic plugged in? It could also be that the
correct drivers for your sound card are not installed (if your sound card
supports things like audio loopback then you will need these drivers, as
Windows does not normally have built-in drivers for the more advanced
functionality of the sound card). A safe bet is to check control panels to
see if the audio inputs are listed. Good luck! Giawa