Quantcast
Channel: NAudio
Viewing all 5831 articles
Browse latest View live

Updated Wiki: Home

$
0
0

NAudio Overview

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.

NAudio demo project showing an MP3 file playing:
naudiodemo.png

NAudio WPF Project showing waveform visualisation and spectrum analyser:
NAudioWPF.png

Latest News

For the latest news and more documentation on NAudio, visit Mark Heath's blog.
  • 9 Sep 2012 ASIO Recording Support added
  • 19 Dec 2011 NAudio 1.5 Released. Read the release notes
  • 20 Apr 2011 NAudio 1.4 Released. Read the release notes
  • 15 Apr 2011 NAudio demo now shows how to select output devices (for WaveOut, DirectSound, WASAPI and ASIO), and can play 8 bit, 16 bit, 24 bit, and 32 bit float WAV files. Fixed a longstanding ASIO issue.
  • 7 Nov 2010 Major improvements to Mp3FileReader
  • 10 Oct 2009 Version 1.3 Released. Read the release notes
  • 20 Sep 2009 We are getting close to feature complete for 1.3. Last chance to get in any feedback on the API
  • 26 Aug 2009 WPF Waveform drawing demo project including FFT added
  • 28 Feb 2009 Lots of new stuff is being added and planned, so do check out the Source Code tab to have a sneak peak at what's coming in 1.3
  • 26 June 2008 Version 1.2 Released. Read the release notes

NAudio 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

Projects Using NAudio

NAudio currently is used to support a number of audio related utilities, some of which may be moved to be hosted on CodePlex in the future. If you have used NAudio for a project, please get in touch so we can post it here.

More Info

For more information, please visit the NAudio Documentation Wiki

Donate

NAudio is a free open source project that is developed in personal time. You can show your appreciation for NAudio and support future development by donating.
Donate

Source code checked in, #fa5734da62b3

$
0
0
updated MSBuild and nuspec to use Release build for future NAudio releases

Source code checked in, #849013186362

$
0
0
added new OffsetSampleProvider class

Source code checked in, #c6d01cf28a7d

$
0
0
More unit tests for OffsetSampleProvider, and improved property validation

New Post: Question about MP3 Streaming

$
0
0

I'd make my own custom IWaveProvider that uses BufferedWaveProvider but can be told that there is no more data to come. Then, in the Read method, if that flag is set and the bufferedWaveProvider has no queued bytes, return 0

New Post: wav to ogg encode

New Post: wav to ogg encode

$
0
0

I'm afraid that class is no longer a supported part of NAudio. It was written a long time ago and never worked properly.

New Post: Updated WaveformPainter

$
0
0

hi kg6ypi, thanks for sharing this, it looks very cool. I probably won't replace the standard waveform painter as this will increase memory consumption and reduce performance for those who are happy to use a single color. However, I'm sure your version could prove useful to some people. WaveFormPainter was only ever intended to be a very simple example of how you could do waveform drawing, with the idea that people would take the code and customise it for their own use. That is why my WPF waveform drawing controls are not part of the NAudio assembly.



New Post: Updated WaveformPainter

$
0
0

OK, what I will do is make another class that extends WaveformPainter, and call it ColoredWaveformPainter   or something, and re-post the code.  If you want to add it in, that would be great; if not, no worries.

I have really been wanting a "WaterfallPainter" type control. I figured doing this was some baby steps, hihi.

Source code checked in, #1ff89cae620d

$
0
0
improved buffer creation for both multiplexing providers

Source code checked in, #6f9474968941

$
0
0
Made SampleChannel converting to stereo optional This means that AudioFileReader will no longer force mono to stereo

Source code checked in, #b0c2c909702f

$
0
0
utility method on WaveFileWriter to write an ISampleProvider to a file as 16 bit PCM

Source code checked in, #56ba2357b0e8

$
0
0
standardising the way temporary audio buffers are created

New Post: wav to ogg encode

$
0
0

Understood :( I'm beating my head everywhere to find a way to do that in c# mono-compatible! Anyway thanks, I've got another question but I'll search a bit and ask that in another discussion eventually!

Commented Issue: drumsamplepatternprovider array clear [16362]

$
0
0
In this section of Read:

if (samplesRead < count)
{
Array.Clear(buffer, offset + samplesRead, count - samplesRead);
samplesRead = count;
}

buffer is being Cleared as a byte[] at runtime, but the next 2 parameters are sample based (ie off by factor of 4).

Read parameter signature is a float[] so this does confuse me a bit. i worked around by ()*4 the 2nd 2 params.
Comments: that looks fine.

New Post: Adding some silence to an MP3

$
0
0

I've just started trying out NAudio and was able to read in my MP3 file and then break it up into some smaller chunks that I saved back out to disk.  I've got a lot to learn about audio data but I was successful in doing this much so far (with some help from some example code).

What I'd like to be able to do is add X seconds of silence to my MP3 - at the start or end of the MP3 file for a project I'm working on with my kids. 

My initial approach was that I'd construct an MP3Frame object and thought that perhaps it would suffice to create a zero-filled data block of the appropriate size and then write that frame out before/after our music clip.  But there's no public constructor for MP3Frame (unless I missed something here) and so I'm assuming that's not the way to go about this.

I need to spend more time looking through the docs and example code on this but if someone's done something like this, I would appreciate some tips.  Not looking for you to write my code for me, just some direction.

I was thinking I might be able to use MP3Frame.LoadFromStream() and then adjust the frame's properties to accomplish this.

Ideas?

 

Thanks,

Matt

New Post: Adding some silence to an MP3

$
0
0

hi Matt,

You have two options. First, you use NAudio to add silence to the beginning (see for example the OffsetSampleProvider I recently added), and then convert the whole thing back to MP3 using LAME.exe.

Second, you could convert a short blank WAV file to MP3, and extract one frame from that to use as your "silence" MP3 frame. Then you could insert multiple instances of that at the start and end of your MP3.

Mark

New Post: leveraging drummachinedemo

$
0
0

i've been using this code base for a simple metronome app i'm working on.

couple things i did to make it useful for my application..

1.  i had also updated the patternsequencer to smooth out tempo changes. nice to see the recent updates to that code, so i'm switching over to the official code base for this.

2. i have no use for the hardcoded stepsPerBeat = 4, so i've hardcoded to 1.  To make the code reuseable that should be a property

3. I added an event to patternsequencer to pass up an event when a sample is written to drive GUI updates.  The delay really isnt necessary given the buffering/sample size, but at least in my imagination it seems to provide a tighter gui update.

mixerInputs.Add(sampleProvider);
FireSequencerEvent(currentStep, 1000 * sampleProvider.DelayBy / this.drumKit.WaveFormat.SampleRate);

this event needs to be visible to drum machine clients, which i made visible by making some things public, but it should be passed up.

Source code checked in, #6531ffb004f9

New Post: A working MIDI tutorial, please?

$
0
0

Hello,

After taking OpenSebJ's tutorial on MIDI, I realized that it didn't work. This was some time ago, maybe even a year or more, and I haven't noticed any changes to it since. I'm really interested in NAudio. Would someone be willing to make a tutorial for us noobs?

 

Thanks

Viewing all 5831 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>