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

How to read MIDI notes with NAudio?

I need to read MIDI files in order to do further processing with the notes. I tried to do so with NAudio like this MidiFile midi = new MidiFile("Test.mid"); foreach (MidiEvent note in midi.Events[1]) { …
bytecode77
  • 14,163
  • 30
  • 110
  • 141
0
votes
1 answer

NAudio 1.7 MediaFoundationEncoder

I have a problem with MediaFoundationEncoder I need to record from input device file in AAC format, I write the following code: private Timer timer; private static IWaveIn _waveIn; private static IWaveProvider _provider; public void…
Roman Badiornyi
  • 1,509
  • 14
  • 28
0
votes
1 answer

NAudio - Changing Bitrate of Recorded WAV file

i am trying to implement audio recording using NAudio to a Wav file, but the default bitrate set by the WasapiLoopbackCapture class can't be changed programmatically. I am recording the audio output to a MemoryStream (recordedStream in snippet…
Faris Zacina
  • 14,056
  • 7
  • 62
  • 75
0
votes
2 answers

Six channel output with NAudio? (Or suggestions for other .NET library that supports it?)

I've written a method in C# using NAudio that successfully outputs 2 channel sound, but fails at 6 channel sound. When using WaveOut, I get 'MmException was unhandled: InvalidParameter calling waveOutOpen' Here's my code: public class…
Simon Crowe
  • 105
  • 1
  • 7
0
votes
1 answer

Sending directly from a WAV file to a DirectShow Sound Card

I am using VB.net to integrate sending a wave file to a specific speaker (exactly what is done in the sample file). But, I am having trouble decoding what is actually done in the sample file because what I am looking for is much more simple. What is…
0
votes
1 answer

Is there a way to Play a WAV File Synchronously in NAudio?

I might be wrong on this, but it appears that my WAV file in NAudio is playing asynchronously, and if I call it from a library, I can hear the WAV start, but it exits (and stops playing) almost immediately. If I run it from a Form (which stays open)…
MarkJoel60
  • 537
  • 2
  • 6
  • 24
0
votes
1 answer

Using Naudio to amplify Microphone Input

I have played with the Naudio examples, and am able to amplify a WAV file that is opened in using the "WaveFileStream" function. (Code Example: AudioPlaybackPanel) This works fine: I add a variable declaration, so I can access the channel later: …
MarkJoel60
  • 537
  • 2
  • 6
  • 24
0
votes
2 answers

How convert mp3 to wave with n audio whit out save it to hard disk?

How convert mp3 to wave with n audio whit out save it to hard disk? i saw this sample public static void Mp3ToWav(string mp3File, string outputFile) { using (Mp3FileReader reader = new Mp3FileReader(mp3File)) { …
user2326338
  • 35
  • 1
  • 6
0
votes
1 answer

How split mp3 using Naudio?

How can i cut a certain time of mp3 file and convert it to wave with N audio with out save any file in hard disk? (i want result in byte array!)
user2326338
  • 35
  • 1
  • 6
0
votes
1 answer

WPF Bind Value of Library (no PropertyChanged Event)

I am building a Music Player with the NAudio Library. Now it's time to build a clock for the current Time. Actually my way of doing this, is by binding the Text Property of a Textblock to the CurrentPosition Property (which gives me, who would have…
trialgod
  • 302
  • 1
  • 15
0
votes
0 answers

NAudio stream to Windows Mediaplayer

I have Windows MediaPlayer embed on a page. I have a audio file(WAV) in MemoryStream I got from a byte[] array. I need to use NAudio to play that file in memory. how can I point the src of the MediaPlayer to the in memory file?
user1594067
  • 107
  • 1
  • 9
0
votes
1 answer

Program Freezes with NAudio

This may be pretty simple, but I have a WPF Application that has a button, a text area, and another button. If I click on Button 1, then the program creates a WaveOutEvent called player and plays the audio file. However, once it starts playing, I…
m00nbeam360
  • 1,357
  • 2
  • 21
  • 36
0
votes
1 answer

NAudio - Playback stops if called Play() again

I'm programming a game and using NAudio with WaveOut. The sound is played when a collision occurs. The problem is the sound plays some times and after a few seconds if the collision happens again, the sound isn't played. I'm using this code. WaveOut…
Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91
0
votes
1 answer

Naudio StreamMixToDisk error

I am having problems with typing a wav file name and having nAudio accept it as StreamMixToDisk. Public Sub SetupAudio() 'Setup the Mixer mixer = New WaveMixerStream32() mixer.AutoStop = False If waveOutDevice Is Nothing Then …
StealthRT
  • 10,108
  • 40
  • 183
  • 342
0
votes
1 answer

Send synchronized audio and video data over the network

I have separately sent Audio and Video over the network but i want to send synchronized audio video data over the network.if any one could me to the solution it would be greatly appreciated. p.s: i am using Naudio for audio and DirectShow for…
Ali
  • 557
  • 1
  • 9
  • 30