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

New Post: Mixing Example (2 MP3 inputs)

$
0
0

1. create an AudioFileReader for each MP3 file

2. then add them as inputs to MixingSampleProvider (AddMixerInput)

3. Use SampleToWaveProvider or SampleToWaveProvider16 to convert back to an IWaveProvider to enable playback using

 


New Post: WaveOutEvent buffers is null

$
0
0

hi, thanks. It is a bit odd - almost as though you are starting to play at the exact instant you shut down? But I will add your fix and update the readme

Mark

Source code checked in, #4ee23975e206

$
0
0
fixing a shutdown issue with WaveOutEvent reported by Brandon Hansen

New Post: Echo recorded voice

$
0
0

I guess it could be the garbage collector getting in the way. Also, have you tried with WaveInEvent and WaveOutEvent?

New Post: WaveOut NumberOfBuffers and DesiredLatency

$
0
0

yes, I agree that the DesiredLatency property isn't ideal for those who want exact control over buffer sizes. I don't want to break existing code, but I will have a think about how I can make it easier to do this.

Mark

Source code checked in, #dd6a2d18abd0

$
0
0
fixing issue 16360 with modification suggested by biermeester

Commented Issue: AudioEndpointVolumeCallback causes AccessViolation [16360]

$
0
0
I noticed that once I read some values from an AudioEndpointVolume, my application would crash when I changed the volume manually afterwards. After some searching, I traced the problem to AudioEndpointVolumeCallback where OnNotify gets called when the volume changes.

In this method Marshal.PtrToStructure is used, which causes an access violation, causing the crash.

I'm running Win7 x64 and the latest Naudio (b3a412ad55a8)
Comments: thanks, I've checked in your change. If possible could you build the latest NAudio code and try it out?

New Post: System.Drawing and System.Windows.Forms references

$
0
0

yes, I would like to move the WinForms suff out in the future. But it shouldn't stop you using NAudio in a non WinForms context.


New Post: WaveOutEvent stops playing sound after some hours of playing

$
0
0

that is strange. Is the Read method of the BufferedWaveprovider still being called when the sound stops playing? Did you get a PlaybackStopped event at any point?

New Post: how to amplify grabbed recorded voice bytes from microphone?

$
0
0

you need to convert the incoming data into samples (use BitConverter.ToInt16 if it is 16 bit). Then you can multiply the sample value. But you need to beware of clipping when doing integer arithmetic, which is why most audio applications convert to floating point, before doing any DSP, and then hard limit the audio before going back down to 16 bit.

New Post: how to amplify grabbed recorded voice bytes from microphone?

$
0
0

Just wanted to add that perception of loudness of sound is a logarithmic function, and not proportional to the voltage (floats in this case).

I remember seeing some DSP code in the latest branch. Is there a class to convert the bytes into floats taking the bitrate into account?

New Post: System.Drawing and System.Windows.Forms references

$
0
0

It's working fine in my non-WinForms project, thanks for commenting on my request ^^

New Post: Repeated Start/StopRecording does not work

$
0
0

File: WaveInEvent.cs

Method: StopRecording()

Line: 188

MmException.Try(WaveInterop.waveInStop(waveInHandle), "waveInStop");

Build: naudio_b3a412ad55a8

New Post: How to use XNA microphone class with NAudio

$
0
0

Hi, I want to know if we can directly use the PCM data that we get using the microphone class inside XNA. Without making the recording with the function wavein

thanks in advancec

New Post: Converting a Naudio-generated Wav file to PCM

$
0
0

Hi,

 

What is the best way to convert a WAV file created by NAudio (from a MP3 source file) to a PCM file? I need to have a 16Khz 16bit PCM output file. I tried to use  the following piece of code but I receive the A"cmNotPossible calling acmStreamSize" error:

......

WaveStream waveStream = new WaveFileReader(outputFileName);

                        WaveFormat targetFormat = default(NAudio.Wave.WaveFormat);

                        targetFormat = WaveFormat.CreateCustomFormat(WaveFormatEncoding.Pcm, 16000, 1, 16000, 1, 16);

                        using (WaveStream convertedStream = new WaveFormatConversionStream(targetFormat, waveStream))
                        {
                            WaveFileWriter.CreateWaveFile(pcmFilename, convertedStream);
                        }
I just need to remove the first 44 bytes of the WAV file.

Thanks.


New Post: Error with Backgroundworker and MIDI

$
0
0

mark can post some example of how do this "If you really want to use a background thread, create just one background thread and let that send events in a loop / read from a queue"

I need find way to send midi in faster way, without thread affect all application.
Right now send midi act like a bottleneck, specially affecting the UI thread making all work slow when send midi.
Bets regards!

New Post: how to amplify grabbed recorded voice bytes from microphone?

$
0
0

Hi, thanks for replying, I have this code sample:

            Int16 int16 = BitConverter.ToInt16(buffer, 0);
            int16 *= 2;
            buffer = BitConverter.GetBytes(int16);
but not worked !
any help please?

New Post: Converting a Naudio-generated Wav file to PCM

$
0
0

are you sure that wav header is always 44 bytes long?
take a look at the documentation

by the way you don t have to remove anything. If you convert the file it will only convert the audio data.

New Post: how to amplify grabbed recorded voice bytes from microphone?

$
0
0

I had this code:

            Int16 int16 = BitConverter.ToInt16(buffer, 0);
            int16 *= 2;
            buffer = BitConverter.GetBytes(int16);

of course it doesnt work, but I check the buffer array of bytes, I found the lenght of array is 8820 bytes and after multiplying by two, I found the array of byte (buffer) is going to two bytes only !!!!

so BitConverter.ToInt16 does not work with me ! do I need to do foreach loop and multiply each byte?

please help !

New Post: Converting a Naudio-generated Wav file to PCM

$
0
0

I think so (I read different documentations on the net). In my case, it works because when I remove the first 44 bytes of my Naudio Wave file, the result is a PCM file containing only the data. The file is valid because the remote service I use can decode it without problem.

 

Viewing all 5831 articles
Browse latest View live


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