1

Who do I create an app that plays music in background of a call, audible to only the caller and the listener? Can any body suggest a method for doing it? I had tried to create a music service which is used for creating background service for apps, but it is not fully satisfying my goals.

I created a background music service according to this link.

EDIT: IDEA---want to play a music in the background of a call which is audible to the caller and listener when the state is offhook

Geethu
  • 1,586
  • 6
  • 21
  • 34

1 Answers1

1

If you want to play background music for your app , then play it in a thread launched from your app/use AsyncTask class to do it for you.

 public class BackgroundSound extends AsyncTask<Void, Void, Void> {

@Override
protected Void doInBackground(Void... params) {
    MediaPlayer player = MediaPlayer.create(YourActivity.this, R.raw.test_cbr); 
    player.setLooping(true); // Set looping 
    player.setVolume(100,100); 
    player.start(); 

    return null;
}

}

Look https://stackoverflow.com/a/7928911/1697047 for more details

Community
  • 1
  • 1
Sree
  • 3,136
  • 2
  • 31
  • 39