Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stop audio record when another recording app opens

 
Vijesh Vijayanath
Greenhorn
Posts: 26
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
lanre durojaiye
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mind uploading the source code. Is it a midlet?
 
Vijesh Vijayanath
Greenhorn
Posts: 26
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry...Company policy not allowing me to upload or share the code.

It is a blackberry application.

 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam also facing similiar pblm.
Using playerlisteners its not workin? is there any other way to encounter this problem??
 
sanjith p nair
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help friends, any suggestions???
 
Darryl Burke
Bartender
Posts: 5149
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PatienceIsAVirtue <- link

Also, please UseRealWords <- link : problem, not pblm.
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic