I have a need to turn off other audio sources when I plan to use the Text to Speech API. The other audio may be in another process. I have looked at the mixer control, but I really only have control of the output there. Is there another place in XP that I can control the output so only my app is able to be heard?
See http://alvas.net/alvas.audio.aspx
Related
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.
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 am making a netradio app on windows phone, my problem is that netradio uses the RTSP audio format and native media player in Windows Phone does not support RTSP.
As a workaround, I have to navigate to a webpage that then handles the audio.
This works fine, and plays the radio, but the problem is that as soon as the app is put in the background the music stops.
Is there a way to keep the webbrowser audio playing?
You could use the BackgroundAudioPlayer within your solution as another project where you could go through a sample here.
And also the sample from Codeplex you can try the Windows Phone Streaming Media.
https://phonesm.codeplex.com/
Hope it helps!
There is no native RTSP support with BackgroundAudioPlayer. You would need to make your own MediaStreamSource implementation to be able to use the stream. At least I didn't find any public 3rd party solutions. Check this http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e052ea29-53cf-4ebb-8558-742b67fc72ad/rtsp-support-in-wp8.
If you are up for the task of writing your own MediaStreamSource implementation, you can use this as starting point and study the RTSP protocol here.
Up until now I thought that changing the system volume from your app is impossible, until recently a new app called Quite Hours (http://www.windowsphone.com/en-us/store/app/quiet-hours/f347a36b-80c0-430f-8631-e55046ee5a2a) actually did just that in a very neat way.
Does anyone please know how to do that programmatically? I tried using the MediaElement or the xna MediaPlayer and the backgroundAudioPlayer and nothing worked. Any help would be appreciated!
Thank you!
The developers of the apps mentioned in the OP were able to change system volume under WP8.0. Apparently whatever method they used has now been disabled under WP8.1. The following apps now display disclaimers that they no longer work on Windows Phone 8.1: Quiet Hours and Volume Manager
They direct to the following page to vote to allow this functionality: Windows Phone Dev User Voice
Additionally please read the following thread on the MSDN forum: MSDN change system volume Windows Phone 8. This functionality was likely achieved using WASAPI (which I have personally tried, and failed, it does not work, comment if you want my code to try it.), or the developers of the volume apps might have had access to AudioClientRestricted.h. If one had that h file, one would have access to system volume under WP8.1, so I somehow doubt the developers used the h file designated for OEMs because it would work un 8.1.
Talking with James Dailey (who works # MSFT) indicates it is technically possible using WASAPI ISimpleAudioVolume If you read # the bottom of that page there is a comment indicating you must use IAudioEndpointVolume
Added note from James Dailey # MSFT:
AFAIK there is no good way to manipulate the global audio level on
Windows Phone 8.1 (WP8.1). Theoretically you can change the audio
volume of any app that uses the default audio session “zero”. However,
if the app chooses to initialize it’s audio session with a custom
GUID you will not have access to the session volume for its custom
audio session. Again this is theoretical based on my knowledge of the
inner workings of WASAPI. I’ve never actually tried it on the phone.
To manipulate the audio volume of apps using audio session “zero” you
simply initialize your IAudioClient with an AudioSessionGuid parameter
of “{00000000-0000-0000-0000-000000000000}”. You can then use
ISimpleAudioVolume::SetMasterVolume to set the volume for this audio
session. You will need to use C++ / Cx since we do not support
calling WASAPI from managed code.
There currently is no API available for controlling the system volume. You can however control the volume in the elements of your application (via the classes MediaElement, BackgroundAudioAgent).
You can also control the volume on sound effects of your application using XNA API.
See http://msdn.microsoft.com/en-us/library/bb195052%28v=xnagamestudio.30%29.aspx
I am currently making a software that can be used to playback training packages. The features I want to add are:
Ability to read the time of videos
Ability to play and pause videos of various codecs (as bundled in Klite Codec Pack)
Ability to create a custom playlist file and continue from the last stop/pause of the playlist when opened
Generate a report of how the playlist was completed
I know very well how I am going to handle the last two parts but I need help on the first two. The current one simply has to launch the files using an external player on the system, and monitor the launched process for exit... but this is not quite what I want.
If WPF is an option you can use the <MediaElement/> for hosting the video in an application. Specifically you can use the Position property for getting and setting the current time.
As the <MediaElement/> is a wrapper for Windows Media Player, all videos playable in WMP should be playable in the <MediaElement/> (after you installed necessary codecs).
You can use VLC with the .Net Interface to VLC. It supports lots of codecs out of the box and seems to be really easy to use.