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

New Post: Which version of NAudio should I use to introduce the "effects and effectstream" code used for the Skype Voice changer

$
0
0

there is no effects framework per se, but the ISampleProvider interface is designed to make it as easy as possible to implement one. Just implement ISampleProvider, and in the Read method, you can do whatever DSP you like on the samples you read out of your source sample provider.


New Post: NAudio 1.6 on .Net 4.0 framework

$
0
0

Hi Mark,
I re-built the NAudio 1.6 source code to target .Net 4.0 Client Profile. The build succeeded with no errors. My app seems to run fine with 4.0 as the target .Net framework.

Are there any gotchas you are aware of with running NAudio with .Net 4.0 ? I'd prefer not to require users to install multiple .Net versions. The app runs on Windows 8/7/Vista/XP.

I only rebuilt these two assemblies, not the whole NAudio solution or demos.
NAudio.dll
NAudio.WindowsMediaFormat.dll

New Post: Mic input to effectStream Output

$
0
0

Thank you for advise to modify. Now I can take an IWaveProvider into EffectStream but it have warning about effects have null parameter when I click play Mic input it had show error about effects. Please help me to take effect pass Mic real-time and show me for example to take Mic input pass effectStream. Because I have dead line to present project on 8 Feb but now it have problem. Thank you very much.

public class EffectStream : IWaveProvider
    {
        private EffectChain effects;
        public IWaveProvider sourceIn;
        private object effectLock = new object();
        private object sourceLock = new object();

        public EffectStream(EffectChain effects, IWaveProvider sourceStreamIn)
        {
            this.effects = effects;
            this.sourceIn = sourceStreamIn;
             //effects have null
            foreach (Effect effect in effects)
            {
                InitialiseEffect(effect);
            }
        }

New Comment on "MP3"

$
0
0
How to convert an wav file to mp3 using Naudio or can we able to convert the wave file to mp3 using Naudio. . .

New Post: NAudio 1.6 on .Net 4.0 framework

$
0
0
NAudio does not need to be rebuilt to work with .NET 4.0. I use it all the time in .NET 4 applications. There is no need to have .NET 3.5 installed.

New Post: NAudio 1.6 on .Net 4.0 framework

$
0
0
Thanks Mark. I thought if an assembly was built with .Net 2.0, you needed to have .Net 2.0 framework installed on the users machine. So this is good news. It makes my integration easier. I still have to rebuild NAudio to 'sign' the assemblies, but that's the only extra step for me -- piece of cake.

BTW, my integration project with NAudio is almost complete. It's working and sounding great!! And the coding is 10 times eaiser than DirectSound. I can't wait to get rid of DirectSound as a pre-req. Most potential users don't have DirectX 9.0c installed and just give up immediately. Thanks to you and your compadres for your excellent work. You guys rock. I'll be sending a donation as soon as I get it published.

New Post: NAudio 1.6 on .Net 4.0 framework

$
0
0
great, glad you are finding it useful. If you want to send me a link to your app, I'll include it in the list of things using NAudio.

Mark

New Post: NAudio 1.6 on .Net 4.0 framework

$
0
0
Hey thanks. That would be great. I messaged you the link. :-)

New Post: NAudio Error question

$
0
0
ok I tryed to lunch you code examples, but I get alot error and when I try to read the code its a little hard to understand it.
Can you make a simple mixing example with two wave file so when you press a button or something to mix the both sounds ?

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

$
0
0
Hello,

Can any one tell me if naudo have the option for increasing or decreasing Gain of a wav file? if yes, then let me know how?

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

$
0
0
Hi,

I guess you want to control the playback volume? If you use WaveOut you can easily control it with something like this:
WaveOut.Volume =  20
This would e.g. set a volume of 20%.

New Post: NAudio API Programmers Guide.

$
0
0
Just a suggestion from a humble newbie to NAudio. It might be worth creating a wiki style API Programmers Guide.

The tutorials are great for getting started. But in some cases I just copied code from a sample not knowing what the values really mean to performance, memory usage, etc.

And if it is a wiki style, discussion members could contribute to it and correct it overtime.

Most importantly it would free up more of Mark's time to do coding rather than answering the same newbie questions for the millionth time. :-)

Just my 2 cents.

New Post: Get/access excact peak levels -> Stuck in no mans land -> but yet so close :-/

$
0
0
I got it to work with this:

while (wave.Position < wave.Length)
        {
            wPosTilSecs = Convert.ToInt32(Math.Round(Convert.ToDouble(wave.Position / 88723)));
            read = wave.Read(buffer, 0, 8192);
            for (int i = 0; i < read / 4; i++)
            {
                if (i < 5000){
                    chart1.Series["wave"].Points.Add(BitConverter.ToSingle(buffer, Convert.ToInt32(Math.Round(secondCounter*10))));
                    chart1.Series["wave"].Points.Add(BitConverter.ToSingle(buffer, i*4));                          
                }            
                areal += buffer[i];       
                if (buffer[i] > 4)
                     {
                    if (areal > 196000)
                         {
                             peaker +=1;
                         }
                     }
                if (i % 512 == 0) { secondCounter += 0.0057305; optaellerIbyteCycles = 0; Console.WriteLine("sec: " + secondCounter);

                }
                       if (i%32==0) {                              
                           if (BitConverter.ToSingle(buffer, i * 4) > 0.04 || BitConverter.ToSingle(buffer, i * 4)< 0.01)
                           {
                               sw.Write("Y-value PEAK?: " + BitConverter.ToSingle(buffer, i * 4));
                               sw.Write("\t\n");

                               sw.Write("sec PEAK?:: " + secondCounter.ToString());
                               sw.Write("\t");
                           }
                           else {
                               if (i % 16384 == 0)
                               {
                                   sw.Write("Y-value no-peak: " + BitConverter.ToSingle(buffer, i * 4));
                                   sw.Write("\t\n");

                                   sw.Write("sec no-peak: " + secondCounter.ToString());
                                   sw.Write("\t");
                               }
                           }
                           peaker = 0;                 
                      }                      
               }                  
            areal = 0;
            textBox1.Text = Convert.ToString(countPeaks);
            textBox2.Text = Convert.ToString(wp);               
        }

The line: if (BitConverter.ToSingle(buffer, i * 4) > 0.04 || BitConverter.ToSingle(buffer, i * 4)< 0.01)
  • is the core to the solver, as the waveform I was drawing with the MS Visual Studio standard chart showed a the confusing range og -1 to 1. The 'buffer' variable outputs values from 0.003 to 0.098 (I did not see that range from buffer earlier, and I just had to amp up the detail via a txt-stream to a notepad-file in order to discover it -> otherwise my small induvidual wave-inputs did not show over a time period of 5-6 secs.)

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

$
0
0
Hi,
Is it possible to find the gain of a particular wav file...


Regards,

Hinshin

New Post: Audio stops playing with Wasapi driver

$
0
0
I'm facing some issues with my application - Practice#.
One some machines, the playback stops playing randomly - there is no error or exception, but I can see that a native thread is exiting with error 0 when the playback halts.
NAudio doesn't report back about a failure.

I managed to replicate this consistently, it happens with many different test cases. Important to note that an another machine (also Windows 7 Pro 64 bit) none of these issues ever happen.

So I suspected it was the sound driver and/or card.
One of the weird ways to reproduce the issue, was to run in debug mode then simply set a break point anywhere in the code in VS.NET Express, not even in a running place that triggers the break point. That would break the audio playback immediately and kill the thread !!??!!

I currently use the driver WasapiOut, and I simply changed it to WaveOut.
Now the problems never replicate.

This is the WasapiOut creation, latency was set to 125msec:
m_waveOutDevice = new WasapiOut(global::NAudio.CoreAudioApi.AudioClientShareMode.Shared, m_latency);

And the WaveOut creation:
m_waveOutDevice = new WaveOut();

I guess I can stay with WaveOut for now, but I don't like this workaround.
With DirectSoundOut I had different issues in the past, it would also get stuck occasionally

Audio initialization processing is running on a non UI thread.

Any ideas?

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

$
0
0
Ah, I see.

I think I'm already doing something wrong when reading the bytestream from the mp3-file. Can you confirm that instead of byte[8] I have to use byte[16] as buffer since I'm reading 16 bit audio?
using (Mp3FileReader mp3 = new Mp3FileReader(filename))
            {
                //Convert byte- to double-array
                double[] real = new double[mp3.Length / 8];
                byte[] buffer = new byte[8];
                int read;
                int count = 0;
                
                while ((read = mp3.Read(buffer, 0, buffer.Length)) > 0)
                {
                    real[count] = BitConverter.ToInt16(buffer, 0) / 32768.0;
                    count++;
                }

                //Seperate to mono
                double[] mono = new double[real.Length / 2];
                for (int i = 0; i < real.Length; i += 2)
                {
                    mono[i / 2] = real[i];
                }

New Post: Detect digital silence in a wave file

$
0
0
You have to use the BitConverter class to turn the raw bytes into samples. If you are using the very latest NAudio code, you can make use of ReadNextSampleFrame on the WaveFileReader class, which improves on TryReadFloat (which only worked on mono audio files), which simplifies getting samples as floating point values.

New Post: Mic input to effectStream Output

$
0
0
Do you actually have any effects in your effects chain?

New Post: Network Chat Multi-Client Program

$
0
0
choppy audio is usually because you can't fill the bufferedwaveprovider fast enough. Maybe your netwrok connection is not good enough. You also might need to allow some buffering time to give smoother playback.

Source code checked in, #3935c492baf1

$
0
0
ability to query IWMStreamConfig for a WaveFormat structure
Viewing all 5831 articles
Browse latest View live


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