このコードをonCreate()
メソッドで記述しましたが、何も再生されませんでした。
SoundPool mSound = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
AudioManager mAudioManager = (AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
int soundID = mSound.load(this, R.raw.sound1, 1);
int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
mSound.play(soundID, streamVolume, streamVolume, 1, 0, 1f);
質問1:私のコードに問題はありますか?私はそれを間違ってしましたか?
いいえの場合、
質問2:私の音は.amr
ファイルです。それはによってサポートされていSoundPool
ますか?サポートされているタイプは何ですか?