onCreate()
メソッドでこのコードを書きましたが、何も再生されませんでした。Android soundPoolサポート拡張機能?
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
でサポートされていますか?サポートされているタイプは何ですか?
あなたは完全に正しいです。私はそれを理解し、質問を更新するのを忘れてしまった。ありがとう。 – iTurki