如何使用Java更改音频声音片段的频率。我可以使用哪种api?
最佳答案
在这里有一个答案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
关于java - 如何使用Java更改音频频率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25541023/