-2
如何使用java更改音頻聲音片段的頻率。我可以使用什麼樣的api?如何使用java更改音頻的頻率
如何使用java更改音頻聲音片段的頻率。我可以使用什麼樣的api?如何使用java更改音頻的頻率
在這裏Changing Pitch and Frequency of Recorded Audio
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
mSoundPool = new SoundPool(size, AudioManager.STREAM_MUSIC, 0);
mSoundPoolMap = new HashMap<Integer, Integer>();
mSoundPoolMap.put(index, mSoundPool.load(context, R.raw.sound, 1));
mSoundPool.play(id, streamVolume, streamVolume, 1, loop, 1f);
答案頻率爲1F的一部分。如果您將其更改爲介於.5f和2.0f之間的值,這會減慢或加快樣本的速度,從而改變音高。