I'm not familiar with the earlier versions of Android that use
OpenCore, so I can't address your specific question re: OpenCore.
However, I'll answer a related question of "how many audio players can
I use" for more recent versions of Android ...
For android.media.AudioTrack API, there's a theoretical limit of 32
tracks due to a hard-coded limit within the AudioFlinger mixer.
However, the practical limit is likely to be somewhat smaller
depending on CPU model, CPU speed, number of CPU cores, CPU load from
other apps, where there is sample rate conversion, available memory,
etc.
For Android native media based on OpenSL ES, the theoretical limit is
30 (not 32) AudioPlayers in PCM buffer queue mode. But again, the
practical limit is likely to be somewhat less.
For android.media.MediaPlayer API on recent Android that use
Stagefright media framework instead of OpenCore, I'm not aware of any
theoretical limit imposed by MediaPlayer per se when playing audio.
But since it uses an AudioTrack internally, it is subject to the 32
track limit.
If you need a very large number of audio tracks, and find that your
device doesn't have the CPU/memory capacity to handle this, you should
consider writing a custom app-level mixer. A well-written app-level
mixer that is optimized _exactly_ for your needs might fit within your
device's limits.
Summary:
- use AudioTrack directly not MediaPlayer to bypass any OpenCore
limit
(not necessary when using recent Android based on Stagefright)
- measure CPU/memory load
- consider custom app-level mixer
On Feb 16, 1:28 am, Baptiste Gaillard <
baptiste.gaill...@gomoob.com>
wrote:
> Hi,
>
> On an application we need to play multiple sounds at a time using
> PhoneGap.
>
> I've created a simple test and it appears that my Phone only allow to
> play 8 sounds time simultaneously.
>
> If I open a 9th sound I encounter the problem "Exceeds maximum number
> of OpenCore instances" problem. This problem is described hear :
http://stackoverflow.com/questions/2432191/exceeds-maximum-number-of-....