Mute other applications' sound when my application is playing a sound - windows

I would like to mute other applications sounds when my application is playing a sound. I know that this is possible in Windows 7 because it allows sound control on a per-application basis.
The specific scenario is my app needs to have its sound play exclusively; if other applications (eg Winamp, Media Player Classic etc) are playing a sound, they should be muted for the duration of the sound played by my application.
I would like to know how it can be done using Delphi? Which library/system call?

I doubt this is easily achieved.
What if the other apps took the same view? Suppose another app decided that it wanted its sound to play and mute all other apps. Which app would win?

On Vista & above you can do this by using CoreAudio/WASAPI & an exclusive mode stream.

Mumble is doing this, you can look at source code.

Related

Recording Audio Stream in Background in Windows phone 7/8

I m developing an app which can record audio stream.
I want to know that is it possible to record that audio in background, i,e when the application is in deactivated mode?
I have already tried to do that in many different ways,but its not helping out.
Please suggest me some way to do such...
Thank you.
As mentioned in the comments, it's not possible to record in the background.
Your app must be running in the foreground for it to be able to record audio using the microphone. For an overview of all the audio recording options, please refer to this tutorial on the Nokia Developer Wiki.
Also, an app will not run when the phone is locked - it is suspended. So if your app was recording, it would stop when the phone is locked. You can change this behaviour with IdleDetectionMode.Disabled which means your app keeps running even though the phone is locked.
Haven't implemented it before, but classifying it as a VOIP app could be the way to go:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207046(v=vs.105).aspx

Record audio in background

I'm wondering if anyone has any idea that capture audio from the device's microphone on the new Windows Phone 7 in background (Silverlight, not XNA)
or any code to do it?
Even in a Silverlight application, the Microphone is accessed via libraries in the Microsoft.Xna.* namespaces.
The use of such namespaces is not supported in a Background Task. See http://msdn.microsoft.com/en-us/library/hh202962(v=vs.92)
This is not possible and would break the security principle of not allowing apps to do something that the user isn't aware of.

Expensify WP7 test framework

Can we use the Expensify Frame work to test Voice Commands on Emulator/Device..
The feels like this should be possible, but isn't something that I've already coded.
To achieve it, you'd have to setup some sort of playback system to create the audio voice commands. This could be done, for example, by using audio playback triggered from C# SpecFlow steps on the PC - e.g. using something like DirectShow/quartz - http://csharp-slackers.blogspot.co.uk/2008/10/playing-wav-or-mp3.html
This audio would then be played out and captured back into the emulator through the speakers and microphone on the host PC - just make sure they are positioned appropriately.

Accessing MediaPlayer in Background Agent in Windows Phone 7

I am trying to capture the current playing track in the Zune music player, in my Background Agent app. Looking at the Unsupported APIs for Background Agents page on MSDN, all of XNA is not supported - which means I can't use XNA's Media.MediaPlayer. Is there any workaround or solution for this?
Nope.
There is currently no way to access anything other than the tracks which you are playing in a BackgroundAudioPlayer agent.
Actually, there is no way to access anything other than THE track (not tracks) that the background audio player is playing. There is no concept of a playlist exposed by the BAP singleton, which apparently is the source for much frustration with this component. You have to resort to IsolatedStorage or some other hack to feed the BAP a playlist.

How to select or play a system sound in windows phone 7(.1)?

I want the user of my app to be able to select a sound from the windows phone 7 system sounds, or play a specific one (like playing the "new email"-sound).
How can I enumerate the installed sounds? Or is there a builtin sound-selector? Can I ask the system which sounds are played for what events?
Access to system sounds is not available. This include playing the sounds or seeing what files/sounds are associated with what events.
The exception is saving new files to use as ringtones which can now (as of 7.1) be done with the SaveRingtoneTask.

Resources