Problems with NAudio - naudio

I am currently using NAudio to do the audio output. Everything is fine except there is an annoying echo in the background. What can I eliminate such noise?
Thanks,
Adam

If you are not using a headset for a network chat program, then the received audio can get recorded by the microphone again, resulting in an annoying echo. There are some fairly complex echo suppression algorithms that programs like Skype use to detect and eliminate these echoes. Unfortunately NAudio does not include such an algorithm, so you'd need to find a third party one, or write your own.

Related

Voice Recording Has Lower Decibels Than "Silent" Recording

I have looked at a number of articles on detecting silence in a recording using NAudio. But, I ran into a snag. I am now looking into using the more complex silence detection methods such as Fourier Transform. In the meantime, perhaps someone can shed some light on the problem I have run into.
I wrote a program in C# using NAudio to detect silence in a WAV file. I have a sample dictation file that I used to test it and it works fine.
As a further test, I used Audacity to create a Wav file that has 1 minute of silence in it using the Noise Reduction feature. When I listen to it, I don't hear sound. When I run my program on it, the lowest decibel reading is higher than the lowest decibel reading in the dictation file. I'm wondering why because this concerns me that there might be dictation files that have silence in them that I cannot detect.

Reading speaker output and convert to data

I am going to read the PC's music output and getting basic information (beat/tone/..) of the song played (then flash the lights accordingly etc). Can NAudio be used for the purpose and any samples? Sorry for this too general question at the moment.
TIA
-d
You can access your PC's output using WasapiLoopbackCapture. However, NAudio does not include a beat detection algorithm, so you'd need to find one yourself. There is a FFT class though which could be used to determine frequencies present.

vb.net capture system audio to stream

Is it possible to capture all/any audio played by a PC into a system.io.stream, so that it can then be run through speech recognition (System.Speech.Recognition.SpeechRecognitionEngine)?
Essentially I'm looking to pefrom speech recognition on any audio on the client PC, google seems to suggest that capturing a stream like this can be done using Microsoft.DirectX.DirectSound, however I cannot honestly determine how. Any suggestions would be greatly appreciated.
Take a look at this question for a solution on Vista/Win7, and take a look at this one for WinXP.
Summary:
You can use Loopback recording with WASAPI in Vista/Win7, but there is no equivalent API in WinXP, however a partial solution can be achieved with a virtual soundcard driver.

Device Enable/Disable script

I have Windows 7 64 Bit Professional Edition on a computer I built myself so there is no manufacturer to ask. I am using an on-board sound card which has 7.1 and Optical outputs. The optical output is plugged into a Denon amp which controls the speakers.
I have got a speaker system plugged into my computer through the optical port on my sound card. When I use standard windows drivers I only get stereo output so I installed the Realtek HD audio driver. This gives me surround sound successfully however it does not tie this as a standard speaker so when I plug in headphones and define them as headphones nothing happens the audio still goes to the speaker system and nothing to the headphones.
I have discovered that if I disable the Digital output device in the playback devices list the audio is automatically rerouted through the headphones. Therefore I have been trying to find a way of disabling or enabling this device. I have a programmable keyboard so I can map a program or script to a spare key therefore I am trying to write a program to check if the device is enabled or disabled then change this to whatever it is not i.e. if on turn off and if off turn on.
I attempted to locate the hardware IDs which are1. "HDAUDIO\FUNC_01&VEN_10EC&DEV_0888&SUBSYS_105BA601"2. "HDAUDIO\FUNC_01&VEN_10EC&DEV_0888&SUBSYS_105BA601&REV_1000"
I had planned to create a batch script using devcon (the command line alternative to device manager.) using the below code to disable or enable the device
devcon disable "HDAUDIO\FUNC_01&VEN_10EC&DEV_0888&SUBSYS_105BA601*"devcon enable "HDAUDIO\FUNC_01&VEN_10EC&DEV_0888&SUBSYS_105BA601*"
However devcon fails to disable these devices as the optical connection is on the sound card and I can only disable the entire sound card which would also disable the headphones.
I am a little lost as to what to do now and I really don't want my brother to need to play with disabling devices.
I am open to any suggestions. I am happy to use any language to do this. Im sure there must be a way of doing this from c but I have been unable to locate any information on this. I would appreciate any suggestions. I am quite happy to write the program myself but if someone could at least point me in the right direction to an api or something like devcon or some way in some language to do this. I currently know VB6, VB.NET, VB Script, Java and Batch Scripting and Powershell quite well and have some knowledge of C, C++ and C#.NET.
any and all help would be appreciated
Kind RegardsDexter
You can try with this :
devcon /r disable #"HDAUDIO\FUNC_01&VEN_10EC&DEV_0888&SUBSYS_105BA601*"
devcon /r enable #"HDAUDIO\FUNC_01&VEN_10EC&DEV_0888&SUBSYS_105BA601*"
Regards,
Pal

Using Cocoa to detect when a running application plays audio

I'm looking into writing an app that runs as a background process and detects when an app (say, Safari) is playing audio. I can use NSWorkspace to get the process ID's of the currently running applications but I'm at a loss when it comes to detecting what those processes are doing. I assume that there is a way to listen in on a process and detect what public messages the objects are sending. I apologize for my ignorance on the subject.
Has anyone attempted anything like this or are aware of any resources that can help?
I don't think that your "answer" is an answer at all...
and there IS an answer (which is not "42")
your best bet for doing this would be to write a pass-through audio output device. Much like soundflower, actually. so your audio output device would then load the actual (physical) audio output device and pass the audio data along to it directly (after first having a look at the audio stream, of course!). then you only need to convince your users to configure your audio device as the default audio output device so that the majority of applications which play sound will use it automatically. and voila...
your audio processing function will probably just do a quick RMS on the buffer before passing it along to the actual output device. and when the audio power crosses a certain threshold (probably something like -54dB with apple audio hardware), then you know that some app is making sound.
|K<
SoundFlower is an open-source project that allows Mac OS X applications to pass audio to each other. It almost certainly does something similar to what you describe.
I've been informed on another thread that while this is possible, it is an extremely advanced technique and not recommended. It would involve using Application Enhancer (APE) and is considered a not 'nice' thing to do. Looks like that app idea is destined for the big recycling bin in the sky :)