naudio

WaveOut versus WaveOutEvent

只谈情不闲聊 提交于 2019-12-24 03:08:08
问题 I'm using NAudio with WaveOutEvent Klangwiedergabegeraet; private void Play(string Dateiname) { Klangwiedergabegeraet = new WaveOutEvent(); Klangwiedergabegeraet.DeviceNumber = comboBox1.SelectedIndex; ISampleProvider StueckchenHalter = null; StueckchenHalter = CreateInputStreamS(Dateiname); Klangwiedergabegeraet.Init(new SampleToWaveProvider(StueckchenHalter)); Klangwiedergabegeraet.Play(); } private void Cancel() { if (Klangwiedergabegeraet != null) { Klangwiedergabegeraet.Stop();

Real time audio playback from mic. c#

别等时光非礼了梦想. 提交于 2019-12-23 12:12:45
问题 I am looking to create an application that will allow me to record from my mic and playback the recording through other pc's. At this point however I would just like it to play back on my own computer so I can get it working. I have been looking at NAudio for the past few hours and it seems like it may be able to help me achieve this goal. I am just wondering if anyone else has had any experience with this and if it is at all possible? Thanks, Stuart 回答1: There is an example project on

NAudio - Cannot set line control mute value

孤人 提交于 2019-12-23 05:46:08
问题 I'm using NAudio to do a few tasks: Locate the "Stereo Mix" source line Un-mute the "Stereo Mix" source line by enabling any line controls present Mute all other source lines on the same input device by disabling any line controls present The program I've written can perform task 1 okay, but tasks 2 and 3 fail. Specifically, this block of code causes the ArgumentException to be thrown: if( control.IsBoolean ) { BooleanMixerControl boolControl = (BooleanMixerControl)control; boolControl.Value

How to record audio from microphone (Line-In) and playback device (speakers Line-Out) to one MP3 file

假如想象 提交于 2019-12-23 04:30:54
问题 I am trying to record audio from the microphone and speakers to one MP3 file. How to achieve this in C# with NAudio? I have already recorded audio from microphone, but I can't figure out how to record from speakers, and then mix to one MP3 file. 回答1: You'd need to record the microphone and the speakers separately, then mix them, then convert to MP3. To record the speakers, you should look at WasapiLoopbackCapture . One caveat is that WASAPI Loopback Capture doesn't always return data if

Windows 8.1 WPF application mixerSetControlDetails returns MMSYSERR_ERROR

旧巷老猫 提交于 2019-12-23 03:26:08
问题 Edit After modifying the NAudio source code and a little debugging, I found that the mixerSetControlDetails function, which is called when I set the Value property, returns MMSYSERR_ERROR . Is there a way to get further information about why mixerSetControlDetails failed? I'm also open to other ways to accomplish same thing on C#. Original I have some code that computes energy in voice and sets the microphone boost level according to this computed value using NAudio. I have no problem reading

Get default output audio device with NAudio

ε祈祈猫儿з 提交于 2019-12-22 18:09:00
问题 I want to get the default output audio device (i.e. my speakers) using NAudio, to get the master sound volume as in this question. I am trying to use MMDeviceEnumerator.GetDevice() , but the id it takes is a string, not the device number. Here's the code I've written so far: var enumerator = new MMDeviceEnumerator(); for (int i = 0; i < WaveOut.DeviceCount; i++) { var cap = WaveOut.GetCapabilities(i); Console.WriteLine("{0}: {1}", i, cap.ProductName); var device = enumerator.GetDevice(???); }

Trying to understand buffers with regard to NAudio in C#

落爺英雄遲暮 提交于 2019-12-22 10:11:04
问题 I'm a chemistry student trying to use NAudio in C# to gather data from my computer's microphone (planning on switching to an audio port later, in case that's pertinent to how this gets answered). I understand what source streams are, and how NAudio uses an event handler to know whether or not to start reading information from said stream, but I get stumped when it comes to working with the data that has been read from the stream. As I understand it, a buffer array is populated in either byte

How to play a spotify music stream

泪湿孤枕 提交于 2019-12-21 21:30:59
问题 First of all, i am new to audio-programming, so bear with me. I am trying to play spotify music with NAudio or BASS.Net or any other .net audio-library. As far as i known, libspotify delivers music as raw PCM data. what is the sample rate of spotify stream (libspotify)? From the spotify docs: Samples are delivered as integers, see sp_audioformat. One frame consists of the same number of samples as there are channels. I.e. interleaving is on the sample level. When i try to play a song, spotify

Converting a WAV file to a spectrogram

烂漫一生 提交于 2019-12-20 09:25:41
问题 Hi im very new to this thing so please bear with me. I am trying to convert a WAV file to a spectrogram but arent sure how to begin with. I read on something that says to read the PCM data(which i think is my WAV file) and store it in an array in the WavReader class before apply the FFT on it and converting it to GUI. Im currently using Naudio to achieve this but could not find anything that shows how to convert the WAV file to a spectrogram. Thanks Edit : I found out about converting PCM to

How do I create a seekbar in C#\NAudio Music Player?

依然范特西╮ 提交于 2019-12-20 09:04:21
问题 I am new to both NAudio and C# and I managed to create a simple MP3 player where you can choose a file and play it. It also has a play/pause button. I would now like to add a seek bar but have no clue on how to do this. Also is it possible to have seekbar in waveform style? The openButton click Handler private void openButton_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Filter = "Audio File|*.mp3;"; if (open.ShowDialog() != DialogResult.OK) return;