Hiya,
Are there any well-known gotchas when it comes to sounds in midlets? I’ve added some simple, really short blips in and they play fine in the emulator, they’re not playing on my phone. I’ve a Sony Ericsson z310a. The same app runs with sound on a friend’s Nokia (not sure what model) but occasionally crashes. From what he describes, it’s at the point of sound playback. I’ve confirmed volume levels are at 100. So I’m wondering if it’s my audio sample rates that are to blame. I haven’t read anything saying “must be 16bit mono” or the like.
I’m not doing anything particularly fancy with setup:
try
{
paddleSound = Manager.createPlayer(getClass().getResourceAsStream("/paddle.wav"), "audio/wav");
}
catch (Exception e)
{
paddleSound = null;
}
And for playback:
if (paddleSound != null)
try
{
paddleSound.start();
}
catch (MediaException ex)
{
ex.printStackTrace();
}