aspose file tools*
The moose likes Java Micro Edition and the fly likes Stop audio record when another recording app opens Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Stop audio record when another recording app opens" Watch "Stop audio record when another recording app opens" New topic
Author

Stop audio record when another recording app opens

Vijesh Vijayanath
Greenhorn

Joined: May 13, 2006
Posts: 26

Hi Ranchers,
Need help!

I am having a J2ME application for recording the audio using the 'RecordControl'.
How can I stop audio recording in my application when another audio recording app opens in the smart phone?

How can I handle these kind of interruptions?

Kindly help me with the solution.

Thanks,
Vijesh V Nath


Thanks,
Vijesh Vijayanath,
Solution Architect - Mobile applications
lanre durojaiye
Greenhorn

Joined: Feb 25, 2012
Posts: 4
Do you mind uploading the source code. Is it a midlet?
Vijesh Vijayanath
Greenhorn

Joined: May 13, 2006
Posts: 26

Sorry...Company policy not allowing me to upload or share the code.

It is a blackberry application.

Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
Why don't you use the pauseApp() and/or notifyPaused() MIDlet methods from the javax.microedition.midlet.MIDlet class that you can override when you create your MIDlet program?

I assume that your program will be sent to the background, so paused, when another application starts.
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
I also assume you're using the Mobile Media API, yes? Then you might also find the javax.microedition.media.PlayerListener event listener interface useful.

It can deliver DEVICE_AVAILABLE and DEVICE_UNAVAILABLE events to your program -- Specifically after you implement the PlayerListener interface in a class and then pass an object of that class into the addPlayerListener() method of the Player object that you also used to get the RecordControl.
Vijesh Vijayanath
Greenhorn

Joined: May 13, 2006
Posts: 26

Thanks for the suggestions.
It is correct that I can use the methods for pausing the audio recording when the app goes background.

But in my case the app should continue record audio even if it is minimized or running back ground. Then the recording has to stop when we take another audio recording app (for eg. default voice recorder app).

How can I achieve this?

Kindly suggest.
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
Yes, just ignore the call to pauseApp(), but you should still look at PlayerListener to receive event messages. It might be what you need.

DEVICE_UNAVAILABLE
Posted when the system or another higher priority application has temporarily taken control of an exclusive device which was previously available to the Player.
sanjith p nair
Greenhorn

Joined: May 09, 2012
Posts: 8
Iam also facing similiar pblm.
Using playerlisteners its not workin? is there any other way to encounter this problem??
sanjith p nair
Greenhorn

Joined: May 09, 2012
Posts: 8
please help friends, any suggestions???
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

PatienceIsAVirtue <- link

Also, please UseRealWords <- link : problem, not pblm.


luck, db
There are no new questions, but there may be new answers.
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
I don't know information beyond the Java ME API. If you can't use the PlayerListener or something else in the javax.microedition.media.* package, either the scaled down one in MIDP 2.0 or the full version in Mobile Media API (JSR 135), then you'll just have to look at the major phone brands' Developer's websites and use their custom API calls. And then rewrite your application for every brand of phone, and some phones won't have custom APIs for Audio control so it won't work for all phones.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stop audio record when another recording app opens