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
5
votes
1 answer

Adding Beep or Silence for a given duration in an Audio file || NAudio || C#

I am using NAudio to record and play the audio file. Now, I want to add silence or beep in an audio file for a given duration. Could you please suggest the NAudio provider name in order to achieve it?
Arindam Rudra
  • 604
  • 2
  • 9
  • 24
5
votes
0 answers

Record screen with input and output audio using with C# SharpAvi and NAudio

I m trying to making an application which can record the screen and at the same time can record the input and output audio. I checked so many things on web but couldt find anything that can do it together. I tried to do something with sharpavi and…
Sercan
  • 51
  • 2
5
votes
1 answer

Sending playing Audio using NAudio

I have managed to send audio from a microphone using the code found here. However I have not been able to do this using NAudio. The code from CodeProject has explicit code to encode and decode such as: G711.Encode_aLaw G711.Decode_uLaw to translate…
TheWommies
  • 4,922
  • 11
  • 61
  • 79
5
votes
1 answer

Playing a .wav file using naudio, playback stops after 1 sec

I'm using the naudio lib in C# and want to play a simple file. The problem is, the playback stops after 1 second. I cant figure out the reason why it does that. using System; using System.Collections.Generic; using System.Linq; using…
Spiderschwein
  • 61
  • 2
  • 9
5
votes
1 answer

Using NAudio to decode mu-law audio

I'm attempting to use NAudio to decode mu-law encoded audio into pcm audio. My service is POSTed the raw mu-law encoded audio bytes and I'm getting an error from NAudio that the data does not have a RIFF header. Do I need to add this somehow? The…
Sean
  • 2,453
  • 6
  • 41
  • 53
5
votes
1 answer

join two wav files in NAudio before first wav end

I use this function to join two wav files public static void Concatenate(string outputFile, ArrayList sourceFiles) { byte[] buffer = new byte[1024]; WaveFileWriter waveFileWriter = null; try { …
zey
  • 5,939
  • 14
  • 56
  • 110
5
votes
2 answers

NAudio - MediaFoundationReader: constructor doesn't take a delivered m4a-URL (from a youtube-Link)

I am trying to play an M4A (MP4 Audio) file directly from the internet using a URL. I'm using NAudio with the MediaFoundation to achieve this: using (var reader = new MediaFoundationReader(audioUrl)) //exception using (var wave = new…
PHilgarth
  • 285
  • 1
  • 3
  • 19
5
votes
2 answers

Using NAudio with SpeechSynthesizer

I would like to use NAudio together with SpeechSynthesizer, but I cannot make it work without writing a .wav file to disk first. I cannot figure out why, I tried both RAW wave data and wave with headers, see the following examples... Example 1 -…
E. Malmqvist
  • 310
  • 2
  • 11
5
votes
0 answers

NAudio - How to change frequency at runtime (Doppler)

I'd like to know if there is a way to change the frequency(pitch) and volume of the audio while playing in NAudio. I'd like to simulate the Doppler effect. The observer is in the middle and does not move. While the moving object is going to the…
Rok
  • 787
  • 9
  • 17
5
votes
1 answer

Using Vorbis and NAudio to play OGG files

I'm trying to play OGG file stream with NVorbis and NAudio, as described in the documention i'm trying to access VorbisWaveReader class, without success, here is my code: using System; using System.Collections.Generic; using System.Text; using…
Shai Katz
  • 1,603
  • 12
  • 22
5
votes
1 answer

Convert wav streamed over HTTP to mp3, in real-time

Background: I am consuming a service which returns data with a MIME type of audio/wav. I need to provide a playback mechanism for this audio (currently built as an MVC application). As an example, my endpoint looks something like…
LiquidPony
  • 2,188
  • 1
  • 17
  • 19
5
votes
2 answers

How to calculate FFT using NAudio in realtime (ASIO out)

I am programming clone of guitar (violin) Hero as a final project for this school year. The idea is to take input from my electric violin, analyse it via FFT, do some logic and drawing and output it through speakers. Perhaps some steps in parallel…
Lucause
  • 113
  • 1
  • 1
  • 7
5
votes
2 answers

How to read Bit rate of .wav file in C#

given that I have a .wav file, what would be best way to read its Bit rate property in C#. I have tried Shell, and asked a question Is "Bit rate" property fixed in index 28? with no asnwers so for. Also I now believe Shell is not the best way to…
ahsant
  • 1,003
  • 4
  • 17
  • 25
5
votes
2 answers

Convert WasapiLoopbackCapture wav audio stream to MP3 file

I am able to capture system audio which is generated by speaker with the help of WasapiLoopbackCapture (naudio). but the problem is it capture wav file and size of wav file very large (almost 10 to 15 MB/Min). I have to capture 2-3 hour audio and…
Aman Sharma
  • 311
  • 1
  • 8
  • 22
5
votes
1 answer

Create live audio stream from line in device for HTML5

I am using NAudio to capture an audio signal from my line in device into a byte array. I can successfully send that byte array across my WLAN via UDP broadcast and receive it on another computer. Once the byte array has been received, I am able to…
Scott
  • 81
  • 4