Recording Audio Stream in Background in Windows phone 7/8 - windows-phone-7

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

Related

Is there a way to detect video/audio playback on Windows and Mac?

Is there a Win32 API for Windows or a Cocoa API for Mac which detects video/audio playback?
I'm developing a desktop application that needs to be aware of the user's activity on the computer. When the app is running, if the user is actively using his computer, the app should stay dormant. If the user is away from the computer for a certain period of time, then the app should run some logic.
There is a way to detect user activity via keyboard/mouse interaction. However, if the user is passively engaged (e.g. watching a video or listening to music) without any keyboard/mouse action, then I have no way of knowing.
There is a similar question but no answer.
Video playback detection with Win32 API?
Any help would be much appreciated. Thank you!

Windows Phone XNA Games Hangs on Resume when Guide is Visible on WP7.x

My Windows Phone XNA game calls Guide.BeginShowKeyboardInput to get the user's name. While the Guide's input screen is shown, if the user presses the Home or Search (hardware) buttons, the game is deactivated as usual - but if the user then presses the Back (hardware) button, the game should resume but it doesn't. Instead it shows the "Resuming..." message until Windows Phone gives up trying to resume the game and kills the process.
Please note:
My app is failing Microsoft certification because of this problem - I really need to fix it!
This only happens in my game when the Guide input screen is shown - when it's not shown, the game
resumes properly after being deactivated.
This problem only occurs when the game is run on WP7.x (verified problem on WP7.5 and
WP7.8) - although the game seems to resume properly on WP8 devices.
I've created a blank XNA game project, called Guide.BeginShowKeyboardInput and tested it using WP7.x devices, and this problem-behavior doesn't occur.
I've tested the game without enabling Music & my Trial License manager (they use timers) and it still does this.
Exact same behavior occurs in the emulator (resume-failure on WP7.x emulators, works fine on WP8
emulator)
I used threads to asynchronously download content during the loading screen - but they already completed and exited.
I don't believe other threads are running, although this seems like
it could be a thread-blocking issue.
Any other ideas on what could be blocking the game from resuming when the Guide.IsVisible or how to debug/resolve this problem?
The solution to this issue was simply to NOT use SuppressDraw when dealing with any operation that passes control outside of the app, e.g. Launchers, Choosers and the Guide.
Have you tried calling "Guide.EndShowKeyboardInput" in either the Deactivating or closing events?
So that the guide is closed before the app suspends, you do get 10 seconds to suspend so this might be worth looking into.
If you want the guide to re-show on resume, then in your state saving code just have a flag and open the guide if it's set.

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.

Disable screen capture wp7

I am developing a security related windows phone application. I need to disable/block screen capture for my application.
In Android, we used to set a flag FLAG_SECURE to the window of which we want to block the screen capture. Is there anything similar in wp7 also??
Thanks
You can't do screen captures on Windows Phone unless you use homebrew apps, so I wouldn't worry too much about it.
And even if there were screen capture apps on the marketplace, you would have no way to be safe. Even if you found a way to prevent screen captures, how would you prevent users from taking a picture of the phone with a camera, or sideloading the app on the emulator then making screen captures of the emulator?
There's currently no API available to developers that allows you to perform screen captures with a locked device.
The alternatives are as follows:
Unlock your device and sideload one of the homebrew based screen
capture apps.
Take a picture of the screen itself (Crude but it
would do the job).
Microsoft have stated that they do not intend to change this in the near future (CNET Article)

Recording audio on Mac

I am developing an application which access my audio input device and record audio from my microphone.
Here when i am pressing START button it have to record audio from microphone and have to stop recording when pressing STOP button.
My device is Lynx-AES16 and i got driver from there site.
In windows i am accessing the machine(Lynx) by using direct-show SDK(Graph edit). 
Is there any similar tool  like direct-show is available. I checked with AUAudio and IOkit but didnt understood that much.
Can anyone provide some sample or some useful links. Apple link is not good for a starter 
Look at the CoreAudio sample code at developer.apple.com. There is plenty of useful code there.
In particular look at the RecordAudioToFile example.

Resources