• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stop audio record when another recording app opens

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

It is a blackberry application.

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ME Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please help friends, any suggestions???
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PatienceIsAVirtue <- link

Also, please UseRealWords <- link : problem, not pblm.
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic