im working on a windows app that needs to "hear" the desktop's audio, so the user runs it in the background and plays a game for example, the application would receive the sounds of that game, kind of like a screen recorder, but for audio only
Related
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?
How do you programmatically change the output device of another application running under windows 7 or 10 64bit?
I know it is possible to some extend because of software such as http://www.chevolume.com/
My goal is to set video games to my headphones and netflix to the tv control and music to the sound system, etc.
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.
how to play video in the background? I have a hdmi to hdmi cable connected from the pc to tv. I would like to play. All is working and that I can play video from my pc to tv but the problem is I need to use my computer while the video is still playing from my pc to tv in order to do other work on my computer. Is there a way to play the video in the background using my browser to play the video?
I don't know which operating system you're using but you should be able to enable a multi-monitor display. It's under display and appearance in windows. This will allow you to use the two screens for independent reasons.
Does anyone knows, how to code in c# to stop/pause the zune music in windowsphone7. I used background music in my application, if i launch my application, zune music stops. how to handle this? i use windowsphone7 version, so cant able to use BackgroundAudioPlayer instance.
You shouldn't stop the users background music if it's already playing and you're not going to play music yourself.
If you wish to play music in your app then (after confirming with the user that it's ok to stop the currently plaing music) just start playing your music and this will then cause the music that was playing to be stopped.
There is no way to automatically resume the musc that was playing prevviously when you stop playing your music.