I'm doing an alarm System. The alarms are working OK, but the sound doesn't work.. I'm doing a little test and I don't understand where is the problem.. In the Alarm activity, I've the following code:
setVolumeControlStream(AudioManager.STREAM_MUSIC);
soundPool = new SoundPool(20, AudioManager.STREAM_MUSIC, 0);
try {
AssetManager assetManager = getAssets();
AssetFileDescriptor descriptor = assetManager.openFd("sound.ogg");
mySoundId = soundPool.load(descriptor, 1);
} catch (IOException e) {
Log.d(TAG,"We've problem's!!, "
+ e.getMessage());
}
soundPool.play(mySoundId, 1, 1, 0, 0, 1);
There are not errors.. but music doesn't work.. Instead, if I program the PLAY in a bottom work's!! Can anyone help me please??