如何使用java改变音频的频率

时间:2014-08-28 05:00:03

标签: java android audio core-audio audio-streaming

如何使用java更改音频声音片段的频率。我可以用什么样的api?

1 个答案:

答案 0 :(得分:1)

在这里有答案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之间的值,则应减慢或加快样本速度,从而改变音高。

取自: Changing Pitch and Frequency of Recorded Audio