Questions tagged [naudio]
NAudio is an open source audio library for .NET, supporting audio playback, recording and sample manipulation as well as reading and writing various audio file formats.
1,564
questions
0
votes
0
answers
9
views
NAudio Only picking up Microphone input sound when another app is using the same microphone
I am trying to create an application that records the mic input and puts its volume in a progress bar as a sort of noise-o-meter. I have the audio input devices set and all working but the mic is only ...
2
votes
1
answer
26
views
C# Naudio - Ear Blasting sound recorded from default devices (Microphone & Playback)
Hi I am looking to record sound coming from default recording device (current microphone) and the sound coming from the desktop (default playback device) into one file. However all I get is a very ...
0
votes
0
answers
13
views
How to restart naudio after "Buffer Full" error and PlayBackStopped set on Play
Does anyone know how to Restart naudio playback after it produces a "Buffer Full" error and the player status is PlayBackStopped?
I am streaming audio to naudio using a BufferedWaveProvider....
0
votes
0
answers
15
views
NAudio giving Buffer Full when used with TCP audio stream
I have written the following code which reads data from a TCP Client and attempts to write it to a BufferedWaveProvider by using AddSamples. The audio that is read is also written to an audio file. ...
0
votes
0
answers
12
views
NAudio API and the output device
My question is simple,
When choosing which Api to use Wasapi or Asio, does the choosing process depends on the output device if it supports Wasapi , Asio etc so do we need to have info about the ...
0
votes
1
answer
39
views
C# Naudio WaveOutEvent stop outputting audio when reached silent even when audio is playing
I am currently working on a project which is using Naudio on Unity. I have done my equalizer part of code. But I realize that when the WaveOutEvent hits the silent part of the playing audio, it will ...
-1
votes
1
answer
13
views
VB.net NAudio problem with mixing two wav files
I am not a c# programmer, but I have successfully implemented several NAudio functions in my VB project.
I am stuck on how to set up the signal chain for sending two wave files to a mixer and then to ...
1
vote
1
answer
42
views
Audible "popping" while applying a BiQuad low pass filter to an audio stream using NAudio
Context: I'm a software engineer with very little exposure into the core principles of audio engineering. I have an open source plugin that plays audio in response to application & user behavior. ...
1
vote
0
answers
27
views
NAudio pcm record with "winmm.dll" - Casual "AccessViolationException" on waveInPrepareHeader
My application (.NET 7), sometimes crash when I'm trying to start recording using NAudio WaveIn with the following error
System.AccessViolationException: Attempted to read or write protected memory. ...
0
votes
1
answer
25
views
Getting multiple audio samples from naudio GetAsInterleavedSamples using asioOut
After checking out this link:
Writing multiple wav files from NAudio asioOut, I wanted to be able to get separate wave samples into different files, but it's not working. I'm only getting zero-byte ...
0
votes
0
answers
63
views
NAudio - 'Unable to cast COM object of type 'System.__ComObject' to interface type 'NAudio.MediaFoundation.IMFSourceReader'
in my GUI app I am implementing audio player using NAudio. The way it is working now is that I am creating AudioFileReader, which I then pass into VolumeSampleProvider constructor as a source ...
0
votes
0
answers
43
views
How to apply a Low pass filter to my .WAV audio file using NAudio
I am trying to get an audio sample, extract its volume, normalize another file based on the first one's volume, then try to eliminate as much static noise with a low pass filter as possible and then ...
0
votes
1
answer
39
views
Unstable app work when playing fast on a MIDI keyboard (NAudio)
When I press the keys on the MIDI keyboard very quickly, my application is unstable, silence may occur and all WAV-files will be played at once in a few seconds. It works well if you don't play too ...
0
votes
0
answers
60
views
How can I use NAudio MediaFoundationEncoder to encode an AAC audio file? Plus I'd like clarification on MediaFoundationEncoder encoding
Apologies I'm quite new to programming and I need some assistance.
I'm trying to make a desktop app, one of the features of which records audio from the microphone and saves an AAC file.
So far, I ...
0
votes
1
answer
57
views
NAudio is not playing 16 bit byte data
I am trying to play the sound of my acoustic data coming from piezo sensor.
I am %100 sure that the sample rate is 10000Hz the data is 16 bits and mono audio.
This is what I did to play the sound
var ...
0
votes
0
answers
102
views
Implement a reverb effect class in Naudio
I have a C# class with a reverb effect implementation based on the Schroeder algorithm. I would like to implement this to a custom NAudio class inheriting a ISampleProvider or a IWaveProvider.
Anyone ...
4
votes
1
answer
114
views
Convert more than 2 channels audio to mono
I am using the next code for converting stereo to mono:
using (var waveFileReader = new WaveFileReader(sourceStream))
{
var outFormat = new WaveFormat(waveFileReader.WaveFormat.SampleRate, 1);
...
0
votes
0
answers
82
views
Naudio and FfftSharp program not working as expected
I am trying to create a program in c# using NAudio and FftSharp that will get the frequency with the highest power and Write it to the console. I followed Plot Audio FFT,and the code runs, but the ...
0
votes
1
answer
41
views
WasapiLoopbackCapture DataAvailable event reads duplicate wrong data, even if the device is not playing any sound
When using WasapiLoopbackCapture, in the DataAvailable event, the buffer reads duplicate data.
WasapiCapture = wasapiCapture; // "WasapiCapture" is a local variable.
WasapiCapture.WaveFormat ...
0
votes
0
answers
20
views
NAudio - WaveInEvent DataAvailable not firing
My code is pretty simple - but the event never fires!
_msWaveInput = new()
{
DeviceNumber = validDeviceNumber,
WaveFormat = new NAudio.Wave.WaveFormat(rate: 48000, bits: 16, channels: 2),
...
0
votes
0
answers
31
views
Using NAudio, is there a way to access the different levels of a device?
Using NAudio, I have found my Speakers playback device with the following code:
MMDevice? Speakers = null;
var enumerator = new MMDeviceEnumerator();
foreach (var endpoint in enumerator....
5
votes
0
answers
62
views
WasapiLoopbackCapture is receiving silence on some devices when speakers are muted
I am using NAudio library and recording "what you hear" using its WasapiLoopbackCapture in a very simplistic way:
var outputFolder = Path.Combine(Environment.GetFolderPath(...
1
vote
0
answers
69
views
How to list audio devices with NAudio in a console app?
I want to list output audio devices in a .NET Core 7 Console app, that works on both Windows and Linux.
I've added NAudio via nuget, but it's missing the WaveOut class, which I would normally use for ...
0
votes
1
answer
125
views
BadDeviceId calling waveInOpen , I am using Naudio on .net core 6 and getting error after deploy web app for recording on azure
I created application which is recording audio calls using NAudio .net package c#. It is working fine and it is opening mic for recording on loclhost. But when i deployed my web app on azure server ...
0
votes
0
answers
48
views
NAudio / CSAudio BufferMilliseconds for WasapiCapture
I'm sending a WasapiCapture device to a class that visualises the waveform in realtime using device.DataAvailable.
I want to change the size of audio data that triggers DataAvailable such that it cuts ...
0
votes
0
answers
25
views
Is There A Way To Switch Between Multiple Audio Tracks Of MKV File In MediaFoundationReader?
I Am Searching For "Audio Track Switching" Between Multiple Audio Tracks In MediaFoundationReader But It Is Only Playing First Track Of MKV File.
I Searched In Browser Also, Searched In ...
0
votes
0
answers
47
views
SoundFont Player in Unity
I am currently trying to copy sample data in a soundfont to an AudioClip in unity. I am using the AudioClip.SetData().
public bool SetData(float[] data, int offsetSamples);
The problem is the NAudio....
0
votes
0
answers
63
views
wav file length is 0 seconds, but the file size is being increased anyway. NAudio,
string path = string.Empty;
ConcurrentQueue<string> recQue = new ConcurrentQueue<string>();
private async void SaveAudioRecording()
{
timer.Dispose();
...
0
votes
2
answers
109
views
NAudio, Mixing two raw audio streams into a .wav file
string path = string.Empty;
private void SaveAudioRecording()
{
timer.Dispose();
if (string.IsNullOrEmpty(path))
{
path = Directory....
0
votes
0
answers
67
views
saving mp3 using NAudio LameMP3FileWriter
I'm trying to write 10 sec silence pcm buffer into mp3 file using NAudio LameMP3FileWriter.
The problem is that, final mp3 file duration is not 10 sec. It's smaller.
This is when I open resulting mp3 ...
0
votes
1
answer
106
views
How to list all audio devices that are enabled and present for recording the output audio of the pc?
I want to record with ffmpeg later the entire desktop including audio.
I want to make that it will find for me automatic the recording audio device.
I'm using MMDeviceEnumerator.
all the other ways I ...
0
votes
1
answer
46
views
Two Audio Synchronous Playback And Change CurrentTime
I'm trying to make a simple C# WinForms app, based on NAudio, that allows me to play two perfectly synchronized audio files (two tracks with same duration played in unison: Basically, they should both ...
1
vote
0
answers
73
views
C# NAudio music is out of sync with the lyrics
I am making a karaoke-like app with C# and NAudio.
while(!_stopSync)
{
int currentMs = musicPlayer.GetCurrentTimeMS(); // Retrieve the current millisecond value from WaveOut
bool jumped = ...
0
votes
1
answer
53
views
How To Pause All The Sounds Of The System When The Call Is Connected
I want to create an UWP app which should pause the all the sound of my Windows system when there is call is connected in the Google meet, Zoom etc.
How to do this by using C#.
0
votes
1
answer
166
views
ASP.NET Core Web API Docker missing msacm32.dll NAudio
I wrote a service that uses NAudio(installed through NuGet) and I put it in a docker container.
However, when I send the request to the API I get the following error:
System.DllNotFoundException: '...
0
votes
1
answer
34
views
Change Foreign AudioSessions AudioEndpoints in Windows
So I've been researching for quite a while now, how to specifically change the AudioEndpoint of an AudioSession, or implement routing for AudioStreams not native to my App and all the answers I got ...
0
votes
0
answers
24
views
What are some solutions for repetitive sound playback in C# using System.Media library?
I'm using the C# System.Media library to create a keyboard piano, but I'm encountering a problem.
When I play the sound, it keeps repeating itself.
Here's a snippet of my code:
System.Media....
0
votes
0
answers
51
views
How Do I Use NAudio In A Visual Basic Application
I'm trying to play audio from a Microsoft Visual Basic application I'm creaeting using Visual Studio Pro 2022.
I'm currently using WMPLib to playback audio. Although it works, I'm looking for a more ...
0
votes
0
answers
129
views
Convert oga to wav using NAudio VorbisWaveReader exception: could not initialize container
I'm trying to convert a oga audio file downloded from whatsapp into a wav file.
I'm using Naudio to perform the conversion.
This is my code:
public void TestConvert()
{
string ...
0
votes
1
answer
186
views
set default microphone from c#
I am trying to set the default microphone device on windows 10 and 11. I can list all the devices okay, including getting the current default device. But I cannot find a way to set the default device.
...
0
votes
0
answers
18
views
Is There A Way To Stop Occurence Of The Exception "WaveStillPlaying calling waveOutWrite"?
I am trying to create Music Player with visualizations such as wave view, spectrum view etc. When I debug the program, I get an Exception "WaveStillPlaying Calling waveOutWrite".
I checked ...
-1
votes
2
answers
417
views
Windows Input Device Signal Enhancements
We write software (C#) for Speech Recognition, up until a particular W10 update we had no problems with speech recognition (via usb Microphone/headset). We are now facing issues with recognition and ...
0
votes
1
answer
60
views
Concentus: Distorted audio after decoding and mixed
I have made a simple VOIP group chat that works perfectly when there is no encoder/decoder however as soon as I implement a codec and have it mixing multiple decoded audio streams then there is a ton ...
0
votes
1
answer
126
views
AudioRecord: Record in float[] then convert to byte[] Xamarin
Currently I have made my own NAudio audio record driver for android which works fine for PCM 16 bit audio at any BufferMilliseconds however as soon as I record in PCM Float which requires me to record ...
3
votes
1
answer
252
views
Timer tick event//NAudio lags and not consistent
I'm developing a sort of music production app, which includes audio playback. I'm currently running into a problem where the playback is not consistent. The timer I use to progress through beats seems ...
0
votes
1
answer
41
views
NAudio MMDevice.Properties.SetValue E_ACCESSDENIED
Using MMDevice.Properties.SetValue to update a property and getting E_ACCESSDENIED.
Analogous code in C++ succeeds.
I notice that some of the VT_TYPEs of PROPVARIANT are not implemented in NAudio (e.g....
0
votes
1
answer
83
views
Please tell me how to change the microphone device of "Speech Recognition Engine"
I'm currently using the "Speech Recognition Engine" to check if there is a human voice.
The accuracy of recognition is not good enough, but for the time being, it works well in that it picks ...
1
vote
1
answer
119
views
Problem with controlling playback speed in C# using the NAudio library
I am trying to use the following code to control the playback speed of an audio object with NAudio library but am running into some problem.
How can I alter the play back speed of the media playing ...
0
votes
0
answers
26
views
Why is my audio file out of order when I try to record audio from the Kinect using NAudio?
I am trying to record audio while collecting data from the Kinect. I call StartAudioRecording() and StopAudioRecording() before and I after I run the Kinect data collection. An audio file is made, but ...
0
votes
0
answers
75
views
MP3-Stereo-File - Check differences within the channels
I have to distinguish between two types of MP3 files. Both are 'Joint-Stereo' and have two channels, but they were recorded differently. The recordings are from calls, one is filled with both sides ...