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

New Post: Convert WaveStream to double-array (or apply FFT directly)


New Comment on "WAV"

$
0
0
So... is this page going to be updated ever?

New Post: Can you do a iSampleProvider chain?

$
0
0
If you have a couple ISampleProviders, for instance: one to perform a BassTreble adjustment and then let's say another do perform some kind of filter adjustment, how can you make it them work together in one player. I can see individual ISampleProvider examples in the source download, don't haven't seen (as far as I can tell) a way to chain them?

Am I missing something? Or, do I have to build one ISampleProvider which would a list of other ISampleProviders similar to the effect chain in the skype example?

Paul

New Post: How to increase or decrease Gain of a audio track ?

$
0
0
a WAV file does not have a "gain". You can examine the value of each individual sample though. Probably the easiest solution is to use AudioFileReader, which has a Volume property which you can use to amplify. (1.0 means leave unchanged). Then to go back to a 16 bit WAV file you use SampleToWaveProvider16 and pass this into WaveFileWriter.CreateWaveFile.

Mark

New Post: Determine which mp3 files are silent with NAudio?

$
0
0
To do this, you need to examine the PCM samples individually. Mp3FileReader actually emits PCM in its Read method. It will be even easier if you use AudioFileReader as the samples will come as floating point numbers (with 1.0 as maximum value). Then you just examine each sample in a small range (e.g. 20ms) and check that none go over a certain minimum threshold. If so, you cen say that that block is silent.

New Post: Convert WaveStream to double-array (or apply FFT directly)

$
0
0
I am certainly not a DSP or FFT expert, but as I understand it, you calculate the magnitude of the FFT output by taking the square root of the sum of squares of the real and imaginary parts of the output, which will always be positive. The ouput is like coordinates, so you have to calculate phase and magnitude yourself.

New Post: Is there a voice activity detection with naudio available or how would you implement it?

New Post: Network Chat Multi-Client Program

$
0
0
Is it also possible to check the buffer to see if a certain percentage of it is filled before playing the audio? For example, if a client's bufferedwaveprovider isn't 25% - 75% filled, then the waveOut is paused and once I received sufficient data I can resume playing.

New Post: Drum Machine

$
0
0
Hello,guys I want to make a drum Machine like the one in the examples,but when I open the examples I have 640 errors, so I decided instead reapairing it and trying to modify it, to make my own.
So actually what I did till now is to draw 4x4 matrix and each row is processed from timer which check each position every 100ms, I mean if the timer want to see the third row the value of the integer will be 300ms when I divide - 300/100 = 3 i get the index of the current row.
Then I have 4 wav files loaded and I add them to the mixer if some of the rectangles are clicked then I convert the 32bit mixer output to 16bit again and play it threw DirectSoundOut.
What I dont understand is why the mixer is not mixing my inputs and how to play them more smoothly somehow ?
 void AddToMixer(WaveFileReader file)
        {
            var toAdd = new WaveChannel32(file);
            toAdd.PadWithZeroes = false;
            toAdd.Volume = 1.0f;
            mixer.AddInputStream(toAdd);
        }

New Post: Dynamic Modulation of Sine Waves

$
0
0
Can I create sinewaves that are modulated with slider UI control and output in real time? I've written single sine wave data into wave file but never output dynamically.

Thank you

New Post: WaveIn.Device not giving proper result if audio service is stopped

$
0
0
I'm not quite sure what you are asking, but the important thing to realise is that NAudio is simply calling Windows APIs when you ask it what devices there are. It doesn't change anything that Windows reports. Maybe there is another API, or a flag we can use in an existing API, but you would need to search MSDN for that answer.

New Post: Drum Machine

$
0
0
well the drum machine demo is meant to show how I would go about approaching this problem. So long as you are reading from your mixer, it will read from each of its inputs.

New Post: Can you do a iSampleProvider chain?

$
0
0
yes, that is the idea of ISampleProviders. Just make lots of implementations of them. In the Read method, read from the source ISampleProvider, and apply the effects. No need to have a single class managing them all unless you need to swap them in and out, or change their order etc.

Mark

New Post: Dynamic Modulation of Sine Waves

$
0
0
You can just put the sine wave provider into WaveOut, and it will play in real-time. (latency won't be particularly great though - probably 200ms or so).

For smooth frequency transitions, you need to implement a glide/portamento algorithm, or there will be jumps in the sine wave. If you do a google search, you should find some discussion of algorithms. In the future I hope to write a blog-post on how to do this, as I have done something similar using wavetables in the past.

New Post: Is there a voice activity detection with naudio available or how would you implement it?

$
0
0
You would start recording with WaveIn, and then examine each sample, to see if any went about a certain threshold (depends on the noise threshold of your microphone).

New Post: Can you do a iSampleProvider chain?

$
0
0
Is there a way to couple the ISampleProvider's with the BufferedWaveReader? Right now, without any effects, we have a BufferedWaveReader reading in the samples, filling in the buffer and we are hearing the audio. How would we plugin a ISampleProvider within the stream?

Is there an example that we can use that utilizes this combo where one format is byte[] and another is float[]?

Paul

New Post: Dynamic Modulation of Sine Waves

$
0
0
I see. For now latency should not be an issue. I will try utilizing WaveOut - thank you!

New Post: Can you do a iSampleProvider chain?

$
0
0
there is an adapter class - something like Pcm16WaveToSampleProvider (assuming you have 16 bit audio in your BufferedWaveProvider)

New Post: Find a fairly precise frequency of wave

$
0
0
I'd like to read the data off a wave, say that the wave has different tones at every half second or so, what I'd like to do is split them up and read off which frequency they have.. how would i do this with NAudio?

Is there also a way to read this data off a live linein/mic input? Where would I find the data to do so?

Thanks!

New Post: Pitch Detection

$
0
0
Hi,

Firstly, I'd just like to say thank you for NAudio, it's a brilliant library.

I'm having difficulty in trying to extract pitches from a single channel wave file. I have taken a look at Autotune.NET and used the piece of code to read the wave file into a buffer
using (WaveFileReader reader = new WaveFileReader(file))
{
                IWaveProvider stream32 = new Wave16ToFloatProvider(reader);

                byte[] buffer = new byte[4096];
                int bytesRead;

                do
                {
                    bytesRead = stream32.Read(buffer, 0, buffer.Length);
                } while (bytesRead != 0);
However, I am not sure what the next step would be to go ahead and get pitches from it.

Any help or advice would be much appreciated.

Thanks!
Viewing all 5831 articles
Browse latest View live


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