detecting audio

All your problems with Audio, Video and Images.

detecting audio

Postby carolus » Mon Mar 28, 2011 4:53 am

Is there a way to detect the user starts playing music on the phone?
carolus
Freshman
Freshman
 
Posts: 3
Joined: Mon Mar 28, 2011 4:50 am

Top

Re: detecting audio

Postby raj_J2ME » Tue Mar 29, 2011 6:26 am

Hi,
I would like to recommend you to explain a little more about the requirement. What is your need, please explain in details... :)
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: detecting audio

Postby carolus » Tue Mar 29, 2011 6:44 pm

I mean being able to detect when the user starts playing an audio file on the phone, for instance in the media player. I was hoping that the MediaPlayer would send out a broadcast when this happens but couldn't find it in the source code. If you know of any way to do this please let me know. Thanks!
carolus
Freshman
Freshman
 
Posts: 3
Joined: Mon Mar 28, 2011 4:50 am

Re: detecting audio

Postby raj_J2ME » Tue Mar 29, 2011 7:47 pm

carolus wrote:I mean being able to detect when the user starts playing an audio file on the phone, for instance in the media player. I was hoping that the MediaPlayer would send out a broadcast when this happens but couldn't find it in the source code. If you know of any way to do this please let me know. Thanks!

I think that we can broadcast the intent as soon as the player gets started in the code.
I mean to say is that,
Code: Select all
   MediaPlayer mp = MediaPlayer.create(context, R.raw.sound_file_1);
    mp.start();


So as soon as the player started, we can do some broadcasting that the media player has been started, however this has to checked whether this can be done.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Re: detecting audio

Postby carolus » Tue Mar 29, 2011 8:34 pm

Thanks Raj, do you mean the current media player already sends a broadcasts when it starts? If so how can I listen to it?
carolus
Freshman
Freshman
 
Posts: 3
Joined: Mon Mar 28, 2011 4:50 am

Re: detecting audio

Postby raj_J2ME » Wed Mar 30, 2011 12:23 pm

Well that was my idea for your need and I had not done it so far, that need to be checked. I am referring you to some URL's so you can try to understand the story and test if that can be done. Here it is :
http://developer.android.com/reference/android/app/IntentService.html

In the mean time I will check if I can get this done.
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 3 guests