naudio

change wav file ( to 16KHz and 8bit ) with using NAudio

拥有回忆 提交于 2019-11-27 01:59:24
问题 I want to change a WAV file to 8KHz and 8bit using NAudio. WaveFormat format1 = new WaveFormat(8000, 8, 1); byte[] waveByte = HelperClass.ReadFully(File.OpenRead(wavFile)); Wave using (WaveFileWriter writer = new WaveFileWriter(outputFile, format1)) { writer.WriteData(waveByte, 0, waveByte.Length); } but when I play the output file, the sound is only sizzle. Is my code is correct or what is wrong? If I set WaveFormat to WaveFormat(44100, 16, 1), it works fine. Thanks. 回答1: A few pointers: You

naudio record sound from microphone then save

做~自己de王妃 提交于 2019-11-26 22:55:22
问题 I'm having some issues with naudio and saving sound recordings. The code I currently have works to the point where it saves the wav file, but when I open it up, Windows Media Player returns an error: "Windows Media Player encountered a problem while playing the file" I have two buttons, a "Record" button, which turns into the stop button after it's pressed. And I have a "Save" button which when clicked, saves the recording to sample.wav . NAudio.Wave.WaveIn sourceStream = null; NAudio.Wave

Stream wrapper to make Stream seekable?

大憨熊 提交于 2019-11-26 22:53:58
问题 I have a readonly System.IO.Stream implementation that is not seekable (and its Position always returns 0). I need to send it to a consumer that does some Seek operations (aka, sets the Position) on the stream. It's not a huge seek -- say +/- 100 from the current position. Is there an existing Stream wrapper that will add a buffering ability to the stream for simple Seek operations? Update: I should add that my consumer is the NAudio Mp3FileReader. I really just need a way to play a (slowly

How to record and playback with NAudio using AsioOut

丶灬走出姿态 提交于 2019-11-26 21:45:35
问题 I'm trying to get the sound input and send output directly with less latency possible with C#. I'm using the library NAudio that supports ASIO for better latency. In particular, I use the AsioOut object for recording and another for playback initialized with a BufferedWaveProvider , which is filled in a Callback function: OnAudioAvailable , which allows me to use the ASIO buffers. The problem is that I hear the sound with various glitches and with a bit of delay . I think the problem is in

NAudio fft result gives intensity on all frequencies C#

末鹿安然 提交于 2019-11-26 17:49:38
问题 I have a working implementation of NAudio's wasapi loopback recording and the FFT of the data. Most of the data I get is just as it should be but every once in a while (10 sec to minutes intervals) it shows amplitude on almost all frequencies. Basicly the picture is rolling from right to left with time and frequencies going on logarithmic scale from lowest frequencies on the bottom. The lines are the errors. As far as i can tell those are not supposed to be there. I get the audio buffer and

Play audio from a stream using C#

£可爱£侵袭症+ 提交于 2019-11-26 00:39:55
问题 Is there a way in C# to play audio (for example, MP3) direcly from a System.IO.Stream that for instance was returend from a WebRequest without saving the data temporarily to the disk? Solution with NAudio With the help of NAudio 1.3 it is possible to: Load an MP3 file from a URL into a MemoryStream Convert MP3 data into wave data after it was completely loaded Playback the wave data using NAudio\'s WaveOut class It would have been nice to be able to even play a half loaded MP3 file, but this