Hi Mark,
I've had a play with AudioPool and have a few problems:
I don't know the length of the audio file - I'm a toolkit and need to
support any files I am given.
I want to load the files as I go (I don't have a static list) and when
I try to play two files at once using the following (inefficient)
code, I get no sound at all.
if (soundPool == null)
soundPool = new SoundPool(3,
AudioManager.STREAM_SYSTEM, 0);
int id = soundPool.load(f.getAbsolutePath(), 0);
AudioManager audioManager =
(AudioManager)getSystemService(Context.AUDIO_SERVICE);
float volume =
(float)audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) /
audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
soundPool.play(id, volume, volume, 1, 0, 1);
What do I need to do to get multiple MediaPlayers work? Am I only
allowed to call prepare whilst nothing is playing?
Cheers,
Peter.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en