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

NAudio crash on x86 code

Like in subject, everything works fine in AnyCPU, but when I change to x86 -> application crash. I work under Win 7 x64. Edit: (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"} Stack: at…
apocalypse
  • 5,764
  • 9
  • 47
  • 95
0
votes
1 answer

NAudio how to read value of position in wav and how to get total number of blocks

I am new to NAudio API and I have a few simple questions. I am trying to make a graph of each channel of a wav file. I have a WaveStream from a WaveFileReader and I would like read the wav at each BlockAlign and get the the channel data (the…
user1819780
  • 105
  • 11
0
votes
1 answer

C# NAudio Volume

As title, I just searched very thoroughly on the web, still not having an answer. I'm working with WaveChannel32 like this : WaveChannel32 volumeStream and setting the volume like : volumeStream.Volume, the default value is 1 but if it increase,…
giiYanJ
  • 3
  • 2
  • 8
0
votes
1 answer

C# NAudio Trackbar

I'm working with a player with NAudio, refer to http://naudio.codeplex.com/wikipage?title=MP3. Everything worked fine but when I'm coding a trackbar, which show the current time and duration, even can seek into any position of the song, so I used…
giiYanJ
  • 3
  • 2
  • 8
0
votes
3 answers

Naudio - 'WaveOut' does not contain a constructor that takes '3' arguments

this question derives from my previous thread Play mp3 from internet without FileOpenDialog I really hope someone knows anything about this. I was told to use a WebRequest to start a download stream and then play the stream instead of playing a…
Kenny Bones
  • 5,017
  • 36
  • 111
  • 174
0
votes
1 answer

.NET 4 C++ NAudio eating memory

I am using NAudio to play Mp3 files in my .NET 4 app. First of all I initialize WaveOut: IWavePlayer^ waveOutDevice = gcnew WaveOut(); Then I have 2 buttons. Play button :(code) volumeStream = gcnew WaveChannel32(gcnew Mp3FileReader(gcnew…
iamnp
  • 510
  • 8
  • 23
0
votes
1 answer

NAudio - Play mp3 from internet without FileOpenDialog?

I noticed in the NAudio Demo from the latest version of NAudio that if Filename is empty, then it opens a fileopendialog. So if I paste a http link in that window and click OK, I've noticed that the FileName string looks something like…
Kenny Bones
  • 5,017
  • 36
  • 111
  • 174
0
votes
1 answer

Exception on Resampling

When I using ResamplerDmoStream and selecting Anything except WaveOutput (e.g. WASAPI, DirectSound) I've getting below exception: Unable to cast COM Object NAudio.DMO.ResamplerMediaComObject to interface type Naudio.Dmo.IMediaObject ... Exception…
Deviser
  • 95
  • 1
  • 9
0
votes
2 answers

How to configure stereo outputs of a soundcard as two separate outputs and send audio to each from different audio inputs?

I am trying to send audio data to the right and left output channels of a soundcard's output port separately. The right and left channels should get data from two different audio sources.. Is it possible with NAudio?
ress
  • 1
0
votes
4 answers

Loss of double precision C#

I am experiencing precision loss when im using doubles and i cant seem to find where the precision is lost. I am writing a software synthesizer and for some reason the input frequency for an oscillator(sound-wave generator) gets heavily aliased…
DOOMDUDEMX
  • 644
  • 1
  • 8
  • 24
0
votes
1 answer

Detect current volume level while a file is playing using Naudio

So I have IWavePlayer waveOutDevice; WaveStream mainOutputStream; WaveChannel32 volumeStream; private WaveStream CreateInputStream(string fileName) { WaveChannel32 inputStream; if (fileName.EndsWith(".mp3")) …
Peter Fren
  • 93
  • 3
  • 9
0
votes
2 answers

NAudio - bitrate vs sampling rate

for raw PCM data with sampling rate - say Fs - what bit rate or sample rate to use? Can I set WaveFormat sample rate parameter to same as Fs?
David
  • 11
  • 1
  • 3
0
votes
1 answer

Why my events don't fire in a service?

I made a windows form application that listens from the microphone and detects sound patrons. Now i want to do the same but in a service. I use Naudio and this event: myWave = new WaveIn(); ... myWave.DataAvailable += new…
0
votes
2 answers

How do I know when the sound to microphone is begin?

I have one problem. How do create program, that throw exception, while begin sound in microphone. Microphone always on, that is noise is always too. Roughly, if I speak to microphone, program throw exceprion. I'm using NAudio. Please help
Alexander Mashin
  • 49
  • 1
  • 1
  • 7
0
votes
1 answer

NAudio: All mixer inputs must have the same WaveFormat

I converted a WaveProvider16 to a SampleProvider using Pcm16BitToSampleProvider. I then added it to a MixingSampleProvider. The logs did indicate that both are IeeeFloat. But the program halted at the AddMixerInput line and the error was All…
user523234
  • 14,323
  • 10
  • 62
  • 102
1 2 3
99
100