Discussion:
Media Player sound state problems in G1
Sudha
2009-05-07 08:36:13 UTC
Permalink
Hi I am using MediaPlayer to play my sounds below is my another post

http://groups.google.com/group/android-developers/browse_thread/thread/8d1c01b055873f39#

I tried all the possible ways stated in the above post but could not
play sounds accordingly so changed the sound code as below,

Now the sounds are working fine and no sound is getting skipped but am
getting some errors which i cannot figure why they are coming...?

Below are some errors:

1- E/MediaPlayer( 2173): stop called in state 1

2- E/MediaPlayer( 2173): stop called in state 2

the above errors i get frequently and i get the below one's randomly,
the game freezes and requires a force close when i encounter the below
errors

3- E/MediaPlayer( 2173): setDataSource called in state 2
W/System.err( 2173): java.lang.IllegalStateException
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(Native Method)

4- E/MediaPlayer( 2173): setDataSource called in state 128
W/System.err( 2173): java.lang.IllegalStateException
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(Native Method)
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(MediaPlayer.java:247)

5- E/MediaPlayer( 2173): prepareAsync called in state 128
E/MediaPlayer( 2173): setDataSource called in state 128
W/System.err( 2173): java.lang.IllegalStateException
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(Native Method)

6- E/MediaPlayerService( 31): offset error
E/MediaPlayer( 2173): Unable to to create media player

I have observed that all the sounds played atleast once in the game
without any error.

I want to know what are the states 1,2 & 128 and why are the errors
raised.

As per the http://developer.android.com/reference/android/media/MediaPlayer.html#Valid_and_Invalid_States
I suppose there is no problem in my code but y is that error shown...?

Plz check the below code:

public void stop() throws MediaException {
try
{
mp.stop();
mp.reset();
FileInputStream fIn = Utils.getContext().openFileInput(fileName);
if (fIn != null)
{
mp.setDataSource(fIn.getFD());
fIn.close();
}
}
catch(Exception e){e.printStackTrace();}
isPlayingSound = false;
}

public boolean isPlayingSound; //class member
MediaPlayer mp = null;
String last_req = "";
public void playSound(final String res) {
if (isPlayingSound){
return;
}
try {
if (!last_req.equals(res))
{
last_req = res;
mp = new MediaPlayer();

FileInputStream fIn = Utils.getContext().openFileInput(res);
if (fIn != null)
{
mp.setDataSource(fIn.getFD());
fIn.close();
}

mp.setOnCompletionListener(new
MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp)
{
try
{
mp.stop();
mp.reset();
FileInputStream fIn = Utils.getContext().openFileInput(res);
if (fIn != null)
{
mp.setDataSource(fIn.getFD());
fIn.close();
}
isPlayingSound = false;
}
catch(Exception e){e.printStackTrace();}

}
});

mp.setOnErrorListener(new
MediaPlayer.OnErrorListener() {
public boolean onError(MediaPlayer mp, int what, int extra)
{
mp.release();
mp = null;
deleteSoundFile(res);
isPlayingSound = false;
last_req="";
System.gc();
new PlayerImpl(fileName,fileInputStream);
return false;
}
});
}

// mp.prepareAsync();
if (isLooping())
{
mp.setLooping(true);
}
mp.prepare();
mp.start();
isPlayingSound = true;

}
catch (Exception e) {
mp.release();
deleteSoundFile(res);
isPlayingSound = false;
mp = null;
System.gc();
new PlayerImpl(fileName,fileInputStream);
last_req="";
playSound(fileName);
}
}
Marco Nelissen
2009-05-07 14:59:38 UTC
Permalink
Based on the code you posted, the "stop called in state 2" is because you
call stop() in your OnCompletionListener, which isn't necessary (it's
already stopped at that point).
I don't see how the other problems could happen with the code you posted,
unless you have multiple threads accidentally using the same MediaPlayer, or
there is some other code involved that you didn't post.
Post by Sudha
Hi I am using MediaPlayer to play my sounds below is my another post
http://groups.google.com/group/android-developers/browse_thread/thread/8d1c01b055873f39#
I tried all the possible ways stated in the above post but could not
play sounds accordingly so changed the sound code as below,
Now the sounds are working fine and no sound is getting skipped but am
getting some errors which i cannot figure why they are coming...?
1- E/MediaPlayer( 2173): stop called in state 1
2- E/MediaPlayer( 2173): stop called in state 2
the above errors i get frequently and i get the below one's randomly,
the game freezes and requires a force close when i encounter the below
errors
3- E/MediaPlayer( 2173): setDataSource called in state 2
W/System.err( 2173): java.lang.IllegalStateException
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(Native Method)
4- E/MediaPlayer( 2173): setDataSource called in state 128
W/System.err( 2173): java.lang.IllegalStateException
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(Native Method)
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(MediaPlayer.java:247)
5- E/MediaPlayer( 2173): prepareAsync called in state 128
E/MediaPlayer( 2173): setDataSource called in state 128
W/System.err( 2173): java.lang.IllegalStateException
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(Native Method)
6- E/MediaPlayerService( 31): offset error
E/MediaPlayer( 2173): Unable to to create media player
I have observed that all the sounds played atleast once in the game
without any error.
I want to know what are the states 1,2 & 128 and why are the errors
raised.
As per the
http://developer.android.com/reference/android/media/MediaPlayer.html#Valid_and_Invalid_States
I suppose there is no problem in my code but y is that error shown...?
public void stop() throws MediaException {
try
{
mp.stop();
mp.reset();
FileInputStream fIn =
Utils.getContext().openFileInput(fileName);
if (fIn != null)
{
mp.setDataSource(fIn.getFD());
fIn.close();
}
}
catch(Exception e){e.printStackTrace();}
isPlayingSound = false;
}
public boolean isPlayingSound; //class member
MediaPlayer mp = null;
String last_req = "";
public void playSound(final String res) {
if (isPlayingSound){
return;
}
try {
if (!last_req.equals(res))
{
last_req = res;
mp = new MediaPlayer();
FileInputStream fIn =
Utils.getContext().openFileInput(res);
if (fIn != null)
{
mp.setDataSource(fIn.getFD());
fIn.close();
}
mp.setOnCompletionListener(new
MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp)
{
try
{
mp.stop();
mp.reset();
FileInputStream fIn =
Utils.getContext().openFileInput(res);
if (fIn != null)
{
mp.setDataSource(fIn.getFD());
fIn.close();
}
isPlayingSound = false;
}
catch(Exception
e){e.printStackTrace();}
}
});
mp.setOnErrorListener(new
MediaPlayer.OnErrorListener() {
public boolean onError(MediaPlayer mp, int what, int extra)
{
mp.release();
mp = null;
deleteSoundFile(res);
isPlayingSound = false;
last_req="";
System.gc();
new
PlayerImpl(fileName,fileInputStream);
return false;
}
});
}
// mp.prepareAsync();
if (isLooping())
{
mp.setLooping(true);
}
mp.prepare();
mp.start();
isPlayingSound = true;
}
catch (Exception e) {
mp.release();
deleteSoundFile(res);
isPlayingSound = false;
mp = null;
System.gc();
new PlayerImpl(fileName,fileInputStream);
last_req="";
playSound(fileName);
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers-***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---
Sudha
2009-05-08 05:33:30 UTC
Permalink
I have nearly 28 sound files in which most of them have the duration
less than a second (i.e in milliseconds), to reduce the delay in
creating the player everytime, i created a player for each sound file
i.e 28 MediaPlayers and each sound file plays on its own player and
all the sounds are managed by a separate single thread (FYI only that
sound thread can call these methods no other thread can start the
sounds explicitly), so I can confirm that all the methos calling is
done by a single thread.

and regarding the other code, i have posted all what am using and the
only other thing which is not here is the constructor which converts
the given input stream to a file as the MediaPlayer cannot play sounds
directly with a stream.

(I am packing all the sounds in a single pack and open it at runtime
and give the input stream to Player as it is done in J2ME, so again am
converting the given input stream to a file.)
Here is the below code of Constructor.

protected PlayerImpl(String fileName1, InputStream inputstream)
{
fileName = fileName1;
fileInputStream = inputstream;

//Creates a FileOutput pointer to dump the InputStream., with
permissions: 662 (rw- rw- -w-)
FileOutputStream fOut = null;
try{
fOut = Utils.getContext().openFileOutput
(fileName,Context.MODE_WORLD_WRITEABLE);
}
catch(Exception filenotfound){
if (Utils.debugEnabled)
android.util.Log.d("Player ERROR","FileOutputStream FAILED!");
}
//we dump the 'stream here...
int n;
try {
while ((n=inputstream.read(FOS_BUFFER))>=0)
{
fOut.write(FOS_BUFFER, 0, n);
}
//we close fOut but DO NOT CLOSE fIn !!
fOut.close();
} catch (IOException e1) {
if (Utils.debugEnabled)
android.util.Log.d("Player ERROR","temp file creation FAILED");
}

}

I dont think this Constructor has anything to do with the errors I
get, to point-out mostly i found these errors are raised when the
device is kept idle for sometime while sounds are playing, the device
backlight goes off and device enters the idle state....
at this point all these exceptions are raised and with less
reproducibility my game crashes.

does the phone stop the sounds while it goes to standby mode?
I have my own code to stop the sounds when an interrupt occurs, so
does this conflict with the device method calls?
Post by Marco Nelissen
Based on the code you posted, the "stop called in state 2" is because you
call stop() in your OnCompletionListener, which isn't necessary (it's
already stopped at that point).
I don't see how the other problems could happen with the code you posted,
unless you have multiple threads accidentally using the same MediaPlayer, or
there is some other code involved that you didn't post.
Post by Sudha
Hi I am using MediaPlayer to play my sounds below is my another post
http://groups.google.com/group/android-developers/browse_thread/threa...
I tried all the possible ways stated in the above post but could not
play sounds accordingly so changed the sound code as below,
Now the sounds are working fine and no sound is getting skipped but am
getting some errors which i cannot figure why they are coming...?
1-      E/MediaPlayer( 2173): stop called in state 1
2-      E/MediaPlayer( 2173): stop called in state 2
the above errors i get frequently and i get the below one's randomly,
the game freezes and requires a force close when i encounter the below
errors
3-      E/MediaPlayer( 2173): setDataSource called in state 2
        W/System.err( 2173): java.lang.IllegalStateException
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(Native Method)
4-      E/MediaPlayer( 2173): setDataSource called in state 128
        W/System.err( 2173): java.lang.IllegalStateException
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(Native Method)
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(MediaPlayer.java:247)
5-      E/MediaPlayer( 2173): prepareAsync called in state 128
        E/MediaPlayer( 2173): setDataSource called in state 128
        W/System.err( 2173): java.lang.IllegalStateException
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(Native Method)
6-      E/MediaPlayerService(   31): offset error
        E/MediaPlayer( 2173): Unable to to create media player
I have observed that all the sounds played atleast once in the game
without any error.
I want to know what are the states 1,2 & 128 and why are the errors
raised.
As per the
http://developer.android.com/reference/android/media/MediaPlayer.html...
I suppose there is no problem in my code but y is that error shown...?
public void stop() throws MediaException {
       try
       {
               mp.stop();
               mp.reset();
               FileInputStream fIn =
Utils.getContext().openFileInput(fileName);
               if (fIn != null)
               {
                       mp.setDataSource(fIn.getFD());
                       fIn.close();
               }
       }
       catch(Exception e){e.printStackTrace();}
       isPlayingSound = false;
}
public boolean isPlayingSound; //class member
MediaPlayer mp = null;
String last_req = "";
public void playSound(final String res) {
       if (isPlayingSound){
               return;
       }
       try {
               if (!last_req.equals(res))
               {
                       last_req = res;
                       mp = new MediaPlayer();
                       FileInputStream fIn =
Utils.getContext().openFileInput(res);
                       if (fIn != null)
                       {
                               mp.setDataSource(fIn.getFD());
                               fIn.close();
                       }
                       mp.setOnCompletionListener(new
                       MediaPlayer.OnCompletionListener() {
                               public void onCompletion(MediaPlayer mp)
                               {
                                       try
                                       {
                                               mp.stop();
                                               mp.reset();
                                               FileInputStream fIn =
Utils.getContext().openFileInput(res);
                                               if (fIn != null)
                                               {
 mp.setDataSource(fIn.getFD());
                                                       fIn.close();
                                               }
                                               isPlayingSound = false;
                                       }
                                       catch(Exception
e){e.printStackTrace();}
                               }
                       });
                       mp.setOnErrorListener(new
                       MediaPlayer.OnErrorListener() {
                               public boolean onError(MediaPlayer mp, int
what, int extra)
                               {
                                       mp.release();
                                       mp = null;
                                       deleteSoundFile(res);
                                       isPlayingSound = false;
                                       last_req="";
                                       System.gc();
                                       new
PlayerImpl(fileName,fileInputStream);
                                       return false;
                               }
                       });
               }
               // mp.prepareAsync();
               if (isLooping())
               {
                       mp.setLooping(true);
               }
               mp.prepare();
               mp.start();
               isPlayingSound = true;
       }
       catch (Exception e) {
               mp.release();
               deleteSoundFile(res);
               isPlayingSound = false;
               mp = null;
               System.gc();
               new PlayerImpl(fileName,fileInputStream);
               last_req="";
               playSound(fileName);
       }
}
Sudha
2009-05-08 09:31:51 UTC
Permalink
By the way what are these states 1, 2, 128 etc.

Can't android people name it when raising exceptions so that
developers could know better what is the cause of exception....?

I am getting full irritated because of these sound issues particularly
with the MediaPlayer and its states in android....
Post by Sudha
I have nearly 28 sound files in which most of them have the duration
less than a second (i.e in milliseconds), to reduce the delay in
creating the player everytime, i created a player for each sound file
i.e 28 MediaPlayers and each sound file plays on its own player and
all the sounds are managed by a separate single thread (FYI only that
sound thread can call these methods no other thread can start the
sounds explicitly), so I can confirm that all the methos calling is
done by a single thread.
and regarding the other code, i have posted all what am using and the
only other thing which is not here is the constructor which converts
the given input stream to a file as the MediaPlayer cannot play sounds
directly with a stream.
(I am packing all the sounds in a single pack and open it at runtime
and give the input stream to Player as it is done in J2ME, so again am
converting the given input stream to a file.)
Here is the below code of Constructor.
protected PlayerImpl(String fileName1, InputStream inputstream)
{
        fileName = fileName1;
        fileInputStream = inputstream;
        //Creates a FileOutput pointer to dump the InputStream., with
permissions: 662 (rw- rw- -w-)
        FileOutputStream fOut = null;
        try{
                fOut = Utils.getContext().openFileOutput
(fileName,Context.MODE_WORLD_WRITEABLE);
        }
        catch(Exception filenotfound){
                if (Utils.debugEnabled)
                        android.util.Log.d("Player ERROR","FileOutputStream FAILED!");
        }
        //we dump the 'stream here...
        int n;
        try {
                while ((n=inputstream.read(FOS_BUFFER))>=0)
                {
                        fOut.write(FOS_BUFFER, 0, n);
                }
                //we close fOut but DO NOT CLOSE fIn !!
                fOut.close();
        } catch (IOException e1) {
                if (Utils.debugEnabled)
                        android.util.Log.d("Player ERROR","temp file creation FAILED");
        }
}
I dont think this Constructor has anything to do with the errors I
get, to point-out mostly i found these errors are raised when the
device is kept idle for sometime while sounds are playing, the device
backlight goes off and device enters the idle state....
at this point all these exceptions are raised and with less
reproducibility my game crashes.
does the phone stop the sounds while it goes to standby mode?
I have my own code to stop the sounds when an interrupt occurs, so
does this conflict with the device method calls?
Post by Marco Nelissen
Based on the code you posted, the "stop called in state 2" is because you
call stop() in your OnCompletionListener, which isn't necessary (it's
already stopped at that point).
I don't see how the other problems could happen with the code you posted,
unless you have multiple threads accidentally using the same MediaPlayer, or
there is some other code involved that you didn't post.
Post by Sudha
Hi I am using MediaPlayer to play my sounds below is my another post
http://groups.google.com/group/android-developers/browse_thread/threa...
I tried all the possible ways stated in the above post but could not
play sounds accordingly so changed the sound code as below,
Now the sounds are working fine and no sound is getting skipped but am
getting some errors which i cannot figure why they are coming...?
1-      E/MediaPlayer( 2173): stop called in state 1
2-      E/MediaPlayer( 2173): stop called in state 2
the above errors i get frequently and i get the below one's randomly,
the game freezes and requires a force close when i encounter the below
errors
3-      E/MediaPlayer( 2173): setDataSource called in state 2
        W/System.err( 2173): java.lang.IllegalStateException
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(Native Method)
4-      E/MediaPlayer( 2173): setDataSource called in state 128
        W/System.err( 2173): java.lang.IllegalStateException
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(Native Method)
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(MediaPlayer.java:247)
5-      E/MediaPlayer( 2173): prepareAsync called in state 128
        E/MediaPlayer( 2173): setDataSource called in state 128
        W/System.err( 2173): java.lang.IllegalStateException
        W/System.err( 2173):    at
android.media.MediaPlayer.setDataSource(Native Method)
6-      E/MediaPlayerService(   31): offset error
        E/MediaPlayer( 2173): Unable to to create media player
I have observed that all the sounds played atleast once in the game
without any error.
I want to know what are the states 1,2 & 128 and why are the errors
raised.
As per the
http://developer.android.com/reference/android/media/MediaPlayer.html...
I suppose there is no problem in my code but y is that error shown...?
public void stop() throws MediaException {
       try
       {
               mp.stop();
               mp.reset();
               FileInputStream fIn =
Utils.getContext().openFileInput(fileName);
               if (fIn != null)
               {
                       mp.setDataSource(fIn.getFD());
                       fIn.close();
               }
       }
       catch(Exception e){e.printStackTrace();}
       isPlayingSound = false;
}
public boolean isPlayingSound; //class member
MediaPlayer mp = null;
String last_req = "";
public void playSound(final String res) {
       if (isPlayingSound){
               return;
       }
       try {
               if (!last_req.equals(res))
               {
                       last_req = res;
                       mp = new MediaPlayer();
                       FileInputStream fIn =
Utils.getContext().openFileInput(res);
                       if (fIn != null)
                       {
                               mp.setDataSource(fIn.getFD());
                               fIn.close();
                       }
                       mp.setOnCompletionListener(new
                       MediaPlayer.OnCompletionListener() {
                               public void onCompletion(MediaPlayer mp)
                               {
                                       try
                                       {
                                               mp.stop();
                                               mp.reset();
                                               FileInputStream fIn =
Utils.getContext().openFileInput(res);
                                               if (fIn != null)
                                               {
 mp.setDataSource(fIn.getFD());
                                                       fIn.close();
                                               }
                                               isPlayingSound = false;
                                       }
                                       catch(Exception
e){e.printStackTrace();}
                               }
                       });
                       mp.setOnErrorListener(new
                       MediaPlayer.OnErrorListener() {
                               public boolean onError(MediaPlayer mp, int
what, int extra)
                               {
                                       mp.release();
                                       mp = null;
                                       deleteSoundFile(res);
                                       isPlayingSound = false;
                                       last_req="";
                                       System.gc();
                                       new
PlayerImpl(fileName,fileInputStream);
                                       return false;
                               }
                       });
               }
               // mp.prepareAsync();
               if (isLooping())
               {
                       mp.setLooping(true);
               }
               mp.prepare();
               mp.start();
               isPlayingSound = true;
       }
       catch (Exception e) {
               mp.release();
               deleteSoundFile(res);
               isPlayingSound = false;
               mp = null;
               System.gc();
               new PlayerImpl(fileName,fileInputStream);
               last_req="";
     
...
read more »
Marco Nelissen
2009-05-08 16:32:31 UTC
Permalink
Post by Sudha
By the way what are these states 1, 2, 128 etc.
1 is 'idle'
2 is 'initialized'
128 is 'playback complete'
(see mediaplayer.h)

So let's take another look at the error messages you were seeing:

1- E/MediaPlayer( 2173): stop called in state 1


This means you called MediaPlayer.stop() while the MediaPlayer was 'idle',
i.e. never initialized. This should be harmless, but I don't see how it
could happen with the code you posted, since you only seem to be calling
stop() from your OnCompletionListener, and in order for your
OnCompletionListener to be called, the MediaPlayer would have to be
initialized, and in any case would be in the 'playback complete' state.

2- E/MediaPlayer( 2173): stop called in state 2


I made a comment about this one in my earlier reply, but that comment was
wrong. This one means you called stop() in the 'initialized' state, which is
the state MediaPlayer is in once you call setDataSource(). Not sure how this
would happen with the code you posted, since you appear to always be
following a call to setDataSource() with a call to start().

3- E/MediaPlayer( 2173): setDataSource called in state 2


This means you're calling setDataSource() twice in a row. Again, not sure
how this could happen with the code you posted, and given that you said you
only have one thread.

4- E/MediaPlayer( 2173): setDataSource called in state 128
This means you're calling setDataSource() after playback has completed,
without first resetting the MediaPlayer to its uninitialized state by
calling reset(). Not sure how this could happen with the code you posted,
since you call stop() and reset() in your OnCompletionListener.

5- E/MediaPlayer( 2173): prepareAsync called in state 128
Post by Sudha
E/MediaPlayer( 2173): setDataSource called in state 128
W/System.err( 2173): java.lang.IllegalStateException
W/System.err( 2173): at
android.media.MediaPlayer.setDataSource(Native Method)
This one looks a bit suspicious, since it complains about both prepareAsync
and setDataSource at the same time, and you're not even calling
prepareAsync() in the code you posted.

6- E/MediaPlayerService( 31): offset error
Post by Sudha
E/MediaPlayer( 2173): Unable to to create media player
You would get this when using the (filedescriptor+offset+length) parameters
for playback, and the offset is past the end of the file. Since you're only
specifying a filedescriptor, and aren't using the offset/length parameters,
it can only mean that the file you tried to play had a size of zero.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers-***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---
Marco Nelissen
2009-05-08 16:32:36 UTC
Permalink
Post by Sudha
I have nearly 28 sound files in which most of them have the duration
less than a second (i.e in milliseconds), to reduce the delay in
creating the player everytime, i created a player for each sound file
i.e 28 MediaPlayers and each sound file plays on its own player and
all the sounds are managed by a separate single thread (FYI only that
sound thread can call these methods no other thread can start the
sounds explicitly), so I can confirm that all the methos calling is
done by a single thread.
I would suggest using SoundPool instead. 28 MediaPlayers is a bit much.

and regarding the other code, i have posted all what am using and the
Post by Sudha
only other thing which is not here is the constructor which converts
the given input stream to a file as the MediaPlayer cannot play sounds
directly with a stream.
(I am packing all the sounds in a single pack and open it at runtime
and give the input stream to Player as it is done in J2ME, so again am
converting the given input stream to a file.)
You should pack these sounds as resources in your apk, and then play
them by resource id or using an AssetFileDescriptor. (you can do this
with both MediaPlayer or SoundPool)

(...)
Post by Sudha
does the phone stop the sounds while it goes to standby mode?
I have my own code to stop the sounds when an interrupt occurs, so
does this conflict with the device method calls?
Unless you specifically tell the phone to stay awake (by using a partial
wakelock, for example), it may go to sleep, and will stop audio playback
while it sleeps.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers-***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Continue reading on narkive:
Loading...