naudio

NAudio WasapiLoopbackCapture ComException (0x88890003)

ε祈祈猫儿з 提交于 2019-12-08 03:29:37
问题 I am trying to use the WasapiLoopbackCapture class (NAudio 1.7.1.17) and ending up with the COMException (0x88890003). The recording format is WaveFormat(44100, 16, 2) . I have multiple playback devices on my system and have tried setting each one as the default device with the same results. I have also verified that each of those devices has (44100, 16, 2) listed as a supported format. Console Output: WasapiCapture_RecordingStopped. Exception: System.Runtime.InteropServices.COMException

“Must be already floating point” when converting an audio file into wav file

我的梦境 提交于 2019-12-08 00:13:41
问题 Here I have a code for covering a audio file into wav format for better quality and reducing file size. Here I am using naudio file compression source code and I got an exception when I try to convert that file. Must be already floating point public string ConvertToWAV(string tempFilePath, string tempFileName, string audioType) { //Try to transform the file, if it fails use the original file FileInfo fileInfo = new FileInfo(tempFilePath + tempFileName); byte[] fileData = new byte[fileInfo

Start recording wave using naudio when sound input reachs a certain level

荒凉一梦 提交于 2019-12-07 20:00:19
问题 I am trying to create an app that allows me to record a wav file everytime the input volume is greater than a given volume. I have the code to record the sound off a button but i would like to automate it, my code below: public partial class Form1 : Form { private WaveIn waveIn; private WaveFileWriter writer; String outputFilename = @"c:\test.wav"; public Form1() { InitializeComponent(); int sampleRate = 22000; int channels = 1; waveIn = new WaveIn(); waveIn.WaveFormat = new WaveFormat

Remove the headers from several WAV files, and then concatenate the remaining data into one RAW file

随声附和 提交于 2019-12-07 10:49:23
问题 I have a RAW audio file which is made up of several concatenated, smaller WAV files. I can open and play this file as 48,000, 8 bit PCM, signed, mono, in Sound Forge. What I would like to do, in C#, is programmatically overwrite each individual WAV within the file with new data of equal or smaller length, which I think I'm fairly close to being able to do. I can do a File.ReadAllBytes on the RAW file, loop through the byte array, and determine the start and end location of each WAV. I then

NAudio: Using ASIO to record audio and output with a guitar

流过昼夜 提交于 2019-12-07 08:21:58
问题 I am currently working on a SR. design project which is a windows forms app which will allow for users to plug in their guitar and create distortions in real time and play it with input and output, and auto tab it into ASCII tabs. Currently I am trying to get the real time listening portion working, I have the recording and implementation of distortions working just fine just having some issues using ASIO. I've looked at this post How to record and playback with NAudio using AsioOut but it

NAudio WaveStream and multiple channels

拟墨画扇 提交于 2019-12-07 04:25:03
问题 I have a WaveStream, and I can read WaveFormat to obtain number of channels. When I read from that WaveStream am I reading the first channel or data from all the channels mixed? I want to do a user control to display WaveForm, but I'm not sure if my control displays it properly. 回答1: When you are reading from WaveStream, you are reading all channel samples, one by one. First you are reading the first channel, and the second sample is the first sample of the second channel. If you put them in

From naudio.Wave.WaveIn to Stream ?

微笑、不失礼 提交于 2019-12-06 16:28:05
问题 I copied this code and i don't understand it but i know what it does when it's finished (output -- sourceStream) ... NAudio.Wave.WaveIn sourceStream = null; NAudio.Wave.DirectSoundOut waveOut = null; NAudio.Wave.WaveFileWriter waveWriter = null; sourceStream = new NAudio.Wave.WaveIn(); sourceStream.DeviceNumber = 2; sourceStream.WaveFormat = new NAudio.Wave.WaveFormat(16000, NAudio.Wave.WaveIn.GetCapabilities(2).Channels); NAudio.Wave.WaveInProvider waveIn = new NAudio.Wave.WaveInProvider

NAudio - Play an audiofile, wait for 2 seconds, play the audio file again

℡╲_俬逩灬. 提交于 2019-12-06 16:15:16
I'm new to NAudio c# but I am currently able to load an audio file and play it in my program. Now, I want to achieve being able to loop this audio file but not until after every 2 second interval. How can I achieve this? For an accurate 2 second wait, I'd create my own IWaveProvider that in the Read method, read from your source file, then when it finished, returned 2 seconds of silence, and then started reading from the start of the source file again. For a rough solution, you can just use a timer after the PlaybackStopped event fires to kick off a new playback. recursiveContradiction Make a

NAudio WasapiLoopbackCapture ComException (0x88890003)

佐手、 提交于 2019-12-06 14:56:43
I am trying to use the WasapiLoopbackCapture class (NAudio 1.7.1.17) and ending up with the COMException (0x88890003). The recording format is WaveFormat(44100, 16, 2) . I have multiple playback devices on my system and have tried setting each one as the default device with the same results. I have also verified that each of those devices has (44100, 16, 2) listed as a supported format. Console Output: WasapiCapture_RecordingStopped. Exception: System.Runtime.InteropServices.COMException (0x88890003): Exception from HRESULT: 0x88890003 at System.Runtime.InteropServices.Marshal

Trouble converting an MP3 file to a WAV file using Naudio

本小妞迷上赌 提交于 2019-12-06 12:28:02
Naudio Library: http://naudio.codeplex.com/ I'm trying to convert an MP3 file to a WAV file, but I've run in to a small error. I know what's going wrong, but I don't really know how to go about fixing it. Here's the piece of code I'm running: private void button1_Click(object sender, EventArgs e) { using(Mp3FileReader reader = new Mp3FileReader(@"path\to\MP3")) { using(WaveFileWriter writer = new WaveFileWriter(@"C:\test.wav", new WaveFormat())) { int counter = 0; while(reader.Read(test, counter, test.Length + counter) != 0) { writer.WriteData(test, counter, test.Length + counter); counter +=