When/how is an application added to the Windows 7 Volume Mixer window? - windows-7

I'm trying to get an application which ran okay on XP to run properly on Windows 7 (this is not something I wrote - I'm helping a friend.)
It was able to play audio on XP but cannot on Windows 7 - nothing is heard. Have exhausted a search and check of all settings in Windows 7 as regards audio (have spent many hours searching and reading.)
There is no entry in the Windows 7 Volume Mixer for the application at any time while it is running.
By playing with some other applications I've found that it seems that an application is not added to the Mixer until it actually creates a sound but I've found at least one program which is added to the Mixer right when the program starts and before it has played any sounds.
Is there an API which allows an application to "register" itself with the Windows 7 Volume Mixer so that an entry for it appears in the Mixer even though it has not yet produced any sounds?

According to this blog post, the audio subsystem keeps track of PIDs that play audio and the volume mixer is able to access this list. It is possible to change the name displayed in SndVol with IAudioSessionControl, so maybe that alone is enough for it to be "registered"

An app slider is added to the mixer when an audio session is created. There are two things that can cause an audio session to be created: First off, when an audio stream created by the app transitions to the "start" state. The other case is when an application manipulates the audio volume using the IAudioSessionControl interface.

Related

How to keep audio playing when switching users in Windows?

It seems that Windows automatically stops my audio play when switching to another user. Is there any way where I can keep audio playing when windows switch to another user?

windows 10 microphone monitoring

I am trying to build an application for windows 10 to inform me when a process starts using my microfone. I tried to inspect opened files (handlers) with ProcessExplorer but it doesn't give me any specific information about which handler corresponds to my default sound input. What I am trying to do is almost what windows 10 already does when it puts a mic icon on system tray whenever a process open my microfone. I am hoping someone who have some knowledge on how windows sub systems works could shed some light into this. Thanks.

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

WP7 background audio resources are no longer available

I'm using BackgroundAudioPlayer for my Windows Phone 7 music & video application. After I play some music, I play video using MediaPlayerLauncher, then press Back to return to my app. There whenever I use BackgroundAudioPlayer.Instance. I receive error "The background audio resources are no longer available".
Someone on MSDN suggests using try/catch, but this is not a good idea, and can slow down the app.
Other suggests call BackgroundAudioPlayer.Instance.Close() before launch MediaPlayer. However, when I play music, the agent load .dll again, which takes very much time.
How to fix this ?
If you play a video after your audio the OS will definitely "terminate" your Background Audio Player. From your question it seems this is reproducible 100% of the time which would confirm this. Your only option is to restart the background audio player again after you have called BackgroundAudioPlayer.Instance.Close(), and then played your video. Which as you said will require reloading your player DLL when you start the BAP.
Update following up from comments
If you aren't implementing a streaming audio agent but only an AudioPlayer agent there isn't a process for you to kill anyway. The OS spins up a process as and when it needs to get you to process an action (e.g.: user action, track ended, shutdown).
BackgroundAudioPlayer.Instance.Close() just makes sure that the OS releases those resources cleanly in a scenario such as the OP has.
To restart background audio, just call BackgroundAudioPlayer.Instance.Play() again.

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.

Resources