I have a Bluetooth Low Energy (BLE) device that streams audio through a custom service, and need to be able to use it in any Windows application (e.g. stream the audio to Skype or Google Chrome for example). I believe the only way is to make this audio source appear as a standard Windows audio input, but how to do this ?
I think the most reliable way to interract with a BLE device is through UWP (using Windows.Devices.Bluetooth.BluetoothLEDevice), so I used it to get the audio data. Then, I used the Windows.Media.Audio.AudioGraph to interract with the audio system. I'm able to generate the Windows audio stream from the BLE audio data with the AudioFrameInputNode and output it to my application default output with AudioDeviceOutputNode.
I can't override the default system audio input and audio output (e.g the laptop microphone and speakers) so in order to be able to use the output from my application as an input in other application, I used VB-Audio (https://www.vb-audio.com/) combined with the "App volume and device preferences" Windows feature. This way, I can use the VB-Audio Cable to connect the output of my application to the input of another, without having to set them as default system devices.
In theory, this should do what I need to do, but in fact, this setup isn't reliable.
I don't understand why, but the behavior isn't consistent at all. Most of the time, changing the audio settings (from "App volume and device preferences" and the "Audio devices panel") have no effect. With the same settings, sometimes it works but sometimes it doesn't (audio from my application is played on speaker instead of VB-Cable input, etc.)...
I don't know where the problem comes from, VB-Audio or Windows itself ? Is there a more reliable alternative to this setup ?
Otherwise, is there another way to use a custom audio source from an application like a standard Windows audio input ?
Please let me know if anything is unclear or you need any more information.
EDIT:
I think this post is actually about the same issue that I'm facing.
Related
I would like to write a C# winforms app to control the EQ of my system sound output. I have found ways to manipulate specific sources of audio, such as the microphone or playing a specific mp3 file, but would like the equalizer to be able to modify the system output generally.
How do you access the system audio output and manipulate it before it hits the speakers?
That is dependent on your audio drivers. Only some drivers integrate EQ control into Windows audio settings. Others use a custom control panel (like DTS Sound Control). I don't think there is a reliable solution to directly access the EQ settings.
I'm trying to get the actual input volume of a microphone while not recording.
My point is to start recording when sound go up some limit for a while.
I've found the NAudio nuget but it seems that's the wavein class dont exist in UWP.
How can i get the actual input volume of a microphone in c# whitout recording ?
I was looking for the same thing. Did you find anything?
If not, you can check this link
Windows IoT Core : Sensing Sound Levels
https://blog.falafel.com/windows-iot-core-sensing-sound/
It uses following components
1) Electret Microphone Amplifier – MAX9814 with Auto Gain Control
2) MCP3008 – 8 Channel 10-Bit ADC with SPI Interface
3) Pi Cobbler Plus
4) Your existing Raspberry Pi – Windows IoT Core Setup
In case if the above doesn't work try this Youtube URL and it might give you some hint to find the actual code: https://www.youtube.com/watch?v=f3Wt4xpkBYk
I have tried and tested the code as is in my project and it worked. Although there is hardware dependency such as you may need amplifiers to make it accurate otherwise small sounds doesn't work But then amplifiers need to be handled well otherwise smallest sounds make huge difference on the bar. I am trying to modify this to work with any USB microphone or computer so that I don't have to rely on mentioned hardware.
I am currently debugging some code in C# which plays a noise (in this case a beep) under certain conditions.
The computer I am using has no speakers or working headphone jack, is there any way in which I can detect sound being played without actually being able to hear it?
The code that plays the sound is:
else System.Media.SystemSounds.Exclamation.Play();
If you don't have any device in the device manager, you can install a Realtek Driver. It creates a virtual playback device.
After that, go to sound-playing devices, choose the virtual device and set it as default playback device. Open your app and check whether a sound is played by looking at the volume visualisation next to the device in the device manager.
(source: eightforums.com)
In Windows, I believe (provided the audio drivers are loaded, and Windows thinks there's at least some form of audio output device) - you can open the volume setting (from the system tray) and see the bar bounce up and down when sound is being generated.
Alternatively, if the box is running Windows Professional, RDP to it from a remote device? The audio will be passed over the RDP session and played on the client.
Search "Sound" in Windows (Control Panel), it shows you all your devices with the volume it outputs to that device.
You can see if your sound works by looking the current volume (the bar on the right of each device).
If your PC has no audio out device (I don'think it's the case), maybe you can add "virtual" output devices.
I suffer from tinnitus, and there are a number of sound-based therapies that I can use to mitigate the phantom sounds.
I would like to explore the possibility of processing the sound going to my headphones, or even my speakers, from my PC with a software-based filter.
Is there a way using C# to intercept the audio stream, process it (applying a band-pass filter for example), allowing it to continue to external devices?
I would suggest to use virtual audio device to capture the sound and transmit it to the real speakers after processing. I'm not sure if it is possible to create this using c#. But you can use existing drivers like vac. So you set vac as default device. You create a c# program which records from vac, does the processing, and sends it to the speakers.
I have a very specific requirement where I need to mute the "Auxiliary" input. I am already using the Windows Core Audio APIs like EndpointVolume & MMDevice.
Scenario
I need to mute the auxiliary output volume here in order to achieve the desired effect.
Pictured below is the audio device and it's properties.
Issues
Using MMDeviceEnumerator it doesn't appear that the endpoint depicted above includes any of the "output volume levels" displayed in the second half of that screenshot.
Muting the actual recording device (Auxiliary) does not actually mute what is heard.
This must be as simple as possible with as little human interaction as possible. The environment will be controlled entirely via the application as it is a kiosk. The screenshots below indicates what I am referring to when I say "auxiliary recording device which when muted, does nothing":
Is there a hidden place that the Levels tab's individual "input output levels" exist? I cannot find it anywhere within MMDevice which means I am currently unable to mute this device through code. Thanks for reading.
If you have installed (most likely) the windows SDK. You can have a look at this example:
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\audio\EndpointVolume
Does that enumerate your device that plays the auxiliary input?