2015-11-04 147 views
0

我在我的原始文件夾中有一些音頻文件,我想改變他們的音調,例如,使用seekbar。 我可以用soundpool做到這一點,但我只能播放短暫的聲音(長達5秒)。 如何改變長音的音調?Android - 改變音頻音調

+0

http://code.google.com/p/musicg/source/browse/src/com/musicg/main/test/resample.java?r=efc41eb4720952191ea18f8f520134d71cdf5e8f? – JimmyB

回答

0
SoundPool soundPool; 
int soundID; 
soundPool = new SoundPool(10, AudioManager.STREAM_MUSIC, 0); 
soundID = soundPool.load(context, R.raw.no, 1); 
//play(int soundID, float leftVolume, float rightVolume, int priority, int loop, float rate) 
float pitch=0.8f; 
//{0.5f,0.6f,0.7f,0.8f,0.9f,1.0f,1.1f,1.2f,1.3f,1.4f,1.5f,1.6f,1.7f,1.8f,1.9f,2.0f} 
soundPool.play(soundID, volume, volume, 1, 0, data.get(item));