Questions tagged [naudio]

NAudio is an open source audio library for .NET, supporting audio playback, recording and sample manipulation as well as reading and writing various audio file formats.

NAudio is an open source .NET audio and MIDI library, containing dozens of useful audio related classes intended to speed development of audio related utilities in .NET. It has been in development since 2002 and has grown to include a wide variety of features. While some parts of the library are relatively new and incomplete, the more mature features have undergone extensive testing and can be quickly used to add audio capabilities to an existing .NET application. NAudio can be quickly added to your .NET application using NuGet.

Features:

  • Play back audio using a variety of APIs
  • WaveOut
  • DirectSound
  • ASIO
  • WASAPI (Windows Vista and above)
  • Decompress audio from different Wave Formats
  • MP3 decode using ACM or DMO codec
  • AIFF
  • G.711 mu-law and a-law
  • ADPCM
  • G.722
  • Speex (using NSpeex)
  • SF2 files
  • Decode using any ACM codec installed on your computer
  • Record audio using WaveIn, WASAPI or ASIO
  • Read and Write standard .WAV files
  • Mix and manipulate audio streams using a 32 bit floating mixing engine
  • Extensive support for reading and writing MIDI files
  • Full MIDI event model
  • Basic support for Windows Mixer APIs
  • A collection of useful Windows Forms Controls
  • Some basic audio effects, including a compressor

Official Website: http://naudio.codeplex.com/

Official Website on github: https://github.com/naudio/NAudio

Useful Links:

FAQ:

1557 questions
0
votes
1 answer

Wave header corrupted for an NAudio recorded array of bytes

I record sound using NAudio API by using Wave in class , but when i play the recorded byte array it gives error "wave header is corrupted". can you please point me to the solution. waveInStream = new WaveIn(); writer = new…
Ali
  • 557
  • 1
  • 9
  • 30
0
votes
1 answer

XNA NAudio WaveChannel32 print line when replay end

I'm using NAudio WaveChannel32 to replay recorded sound, now I wish to print some lines automatically when the Replay has finished. So in the XNA Update function, it's like : if(*Replay has finished*) // Do Something else //Do some other…
Jeff Tung
  • 99
  • 2
  • 10
0
votes
0 answers

Audio Input Capturing from multiple devices

I'm using the NAudio library to capture Audio Input in C#: int _deviceID; double _previewVal; private void PreviewData() { WaveIn waveIn = new WaveIn(); waveIn.DeviceNumber = _deviceID; waveIn.DataAvailable += waveIn_DataAvailable; …
René Martin
  • 518
  • 4
  • 16
0
votes
1 answer

NAudio multiple WaveOut objects

Currently I am constructing a synthesizer. i am wondering if there is anyway of having multiple waveOut() objects due to me wanting my synth to be polyphonic (multiple keys pressed at the same time).
frz
  • 59
  • 8
0
votes
1 answer

Playing mp3 file with NAudio

I followed the tutorial on NAudio's website on how to load and play an mp3 file, but even though I put the audio file in the right directory, whenever I run, the program crashes with "vshost32.exe has stopped working." Any ideas? I'm using Visual…
m00nbeam360
  • 1,357
  • 2
  • 21
  • 36
0
votes
2 answers

Compress Audio upon writing to file

I am trying to create a recorder from audio coming out from soundcard and this is my progress so far, the problem is the recorded audio when saving to file is so large like a song can reach up to hundreds of megabyte. here's my code using…
Vincent Dagpin
  • 3,581
  • 13
  • 55
  • 85
0
votes
3 answers

calculating fft with complex number in c#

I use this formula to get frequency of a signal but I dont understand how to implement code with complex number? There is "i" in formula that relates Math.Sqrt(-1). How can I code this formula to signal in C# with NAduio library?
0
votes
1 answer

Raise wave file volume with NAudio

I am an audio noob I am looking to embed audio in an html page by passing the data as a string such as < Audio src="data:audio/wav;base64,AA....." /> doing that works, but I need to raise the volume. I tried working with NAudio but it seems like…
Fragilerus
  • 1,829
  • 3
  • 15
  • 22
0
votes
1 answer

How to select sound device to play sounds?

I have a webbrowser in my form, I want to choose where I want to listen the sounds. I have 2 playback devices, Speakers and Headphones. I want to make a combobox to select the output of the sounds of my form/app. I was reading about NAudio and…
dkapa
  • 267
  • 1
  • 5
  • 15
0
votes
2 answers

Hamming window generates a line

I have an audio file and read all data from the sound card buffer. Then, I convert byte[] to float[] to use them for hamming window. The waveform of the audio is: after using hamming window: is the waveform of audio with hamming window right?…
Cengaver
  • 87
  • 2
  • 9
0
votes
1 answer

Merging WAV files in c#

I am working on Regional Language Text to Voice converter in C#. I have wav files for individual characters. I want to merge them to get a resultant word's single WAV file. Im using NAudio library. It supports the concatenate method which takes…
codingyo
  • 329
  • 1
  • 5
  • 17
0
votes
1 answer

implementing FftPitchDetector in C#

I've added FftPitchDetector.cs into my project, but I'm not sure how to use it. My code: private void sourceStream_DataAvailable(object sender, NAudio.Wave.WaveInEventArgs e) { if (waveWriter == null) return; byte[]…
Jeff Tung
  • 99
  • 2
  • 10
0
votes
1 answer

IndexOutOfRangeException while running FFTPitchDetector

I'm facing some problems on implementing FFTPitchDetector. What I actually want to do is to get real-time frequency from guitar input, I not so sure how to use the functions in FftPitchDetector.cs. Any idea? private void…
Jeff Tung
  • 99
  • 2
  • 10
0
votes
1 answer

Multichannel player for mono channels

I'm new in audio programming and I have a task to do and I don't know how. If you could guide me in the right direction it would mean a lot to me. I want to play differents mp3 files through all the channel of one sound device, for instance in a 7.1…
Efrain
  • 1
  • 1
0
votes
1 answer

Recording and playing MP3 audio

I have followed the different threads on how to record and play MP3 but I still always get this exception trying to play MP3 files that I have recorded: mp3filereader does not support sample rate changes So here is my code to record :…
blop
  • 3
  • 1
  • 2