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
7
votes
2 answers

How to write NAudio WaveStream to a Memory Stream?

I have a program that takes in mp3 data in a byte array. It has to convert that mp3 data into wav format and store it in a byte data. I am trying to use NAudio for this purpose. I am using the following code for this purpose. Stream inputStream =…
gibraltar
  • 1,678
  • 4
  • 20
  • 33
7
votes
4 answers

NAudio - seeking and navigation to play from the specified position

I'm using NAudio library in a C# application. I'm trying to seek an audio (*.mp3 file) to the position I want. However I didn't figure out how to do it. //Play the file starting from 16th second waveStream.Seek(16, SeekOrigin.Begin); And ... It…
Alexandre
  • 13,030
  • 35
  • 114
  • 173
6
votes
2 answers

Fading sound in/out

I have a background sound playing in an endless loop. I want it to fade out when the user does press a button. I tried the following: A DirectSoundOut is initiated with the WaveStream A Timer changes the volume of the WaveChannel32. The…
Christian Kirst
  • 123
  • 3
  • 8
6
votes
1 answer

NAudio Volume Changing

class Sound { private NAudio.Wave.BlockAlignReductionStream stream = null; private NAudio.Wave.DirectSoundOut output = null; private string fileName; public Sound(string fileName) { this.fileName = fileName; } …
user1139211
  • 115
  • 1
  • 2
  • 5
6
votes
2 answers

Trimming mp3 files using NAudio

Is it possible to trim a MP3 file using NAudio? I am looking for a way to take a standard mp3 file and take a part of it and make it a seperate mp3.
user1018864
  • 61
  • 1
  • 2
6
votes
1 answer

Naudio 'NoDriver calling acmFormatSuggest' error on wav exported with imovie

I am trying to convert a .wav to an .mp3 file. My code usually works but now I have gotten a .wav file that was exported with Imovie and I get the error 'NoDriver calling acmFormatSuggest'. The internet suggest my machine is missing a codec. But if…
Sjors Miltenburg
  • 2,540
  • 4
  • 33
  • 60
6
votes
2 answers

Recording with NAudio using C#

I am trying to record audio in C# using NAudio. After looking at the NAudio Chat Demo, I used some code from there to record. Here is the code: using System; using NAudio.Wave; public class FOO { static WaveIn s_WaveIn; static void…
John Smith
  • 1,351
  • 3
  • 16
  • 21
6
votes
1 answer

Screen recording as video, audio on SharpAvi - Audio not recording

Requirement: I am trying to capture Audio/Video of windows screen with SharpAPI Example with Loopback audio stream of NAudio Example. I am using C#, wpf to achieve the same. Couple of nuget packages. SharpAvi - forVideo capturing NAudio - for Audio…
Gopichandar
  • 2,742
  • 2
  • 24
  • 54
6
votes
2 answers

Enabling recording devices programmatically

Enabling recording devices programmatically I want to enable the disabled device in Sound - Recording devices list programmatically I was able to get a list of disabled devices using Naudio But there is no way to enable it using Naudio. so I tried…
Ebram
  • 1,042
  • 1
  • 13
  • 26
6
votes
3 answers

Raw Audio from NAudio

I want to record raw audio from WASAPI loopback by NAudio and pipe to FFmpeg for streaming via memory stream. As from this document, FFmpeg can get input as Raw However, I got result speed at 8~10x! Here is my code: waveInput = new…
Ken
  • 63
  • 7
6
votes
1 answer

Convert audio stream to frequency

I've managed to successfully get a stream of audio data going to an output device (speaker) using NAudio: private void OnDataAvailable(object sender, WaveInEventArgs e) { var buffer = e.Buffer; var bytesRecorded =…
Adam Short
  • 498
  • 7
  • 28
6
votes
1 answer

How transfer system mic audio stream to attached device mic audio stream

I am trying to attach USB device used for tele calling which have pnp sound controller for mic and speaker. Now i have two speaker and two mic for input output as shown in image below.. Now my motive is to transfer audio stream from system mic to…
Hot Cool Stud
  • 1,145
  • 6
  • 25
  • 50
6
votes
1 answer

C# - Microphone noise detection

I am using nAudio Library to capture microphone input. But I have run into a problem. I am using the code(which I have modified slightly) from an nAudio sample app. The codes generates a WAV file based on mic input and renders it as a wave. Here is…
imran2155
  • 111
  • 1
  • 11
6
votes
2 answers

Play multiple .wav files simultaniously with Naudio or Win API

Hi All I have an application which receives simultaneously wav data through multiple threads from different UDP ports: Is it possible to play all received wav data at same time, simultaneously, using Wave Out API? Is it possible to play all…
T M
  • 3,195
  • 2
  • 31
  • 52
6
votes
2 answers

Is Media Foundation supported on Windows 2012 64 bit server?

Is Media Foundation supported on Windows 2012 64 bit server? We can not have Windows 7 or Windows 8 as the server and that's the reason we are opting for Windows 2012 server. As NAudio 1.7 is released now, we would like to utilize the new…
sainath sagar
  • 499
  • 2
  • 10
  • 28