如何使用java更改音频频率
如何使用java更改音频片段的频率。我可以使用什么样的api 这里有一个答案如何使用java更改音频频率,java,android,audio,core-audio,audio-streaming,Java,Android,Audio,Core Audio,Audio Streaming,如何使用java更改音频片段的频率。我可以使用什么样的api 这里有一个答案 mAudioManager=(AudioManager)context.getSystemService(context.AUDIO\u SERVICE); mSoundPool=新的声音池(大小,AudioManager.STREAM_MUSIC,0); mSoundPoolMap=newhashmap(); mSoundPoolMap.put(索引,mSoundPool.load(context,R.raw.sou
mAudioManager=(AudioManager)context.getSystemService(context.AUDIO\u SERVICE);
mSoundPool=新的声音池(大小,AudioManager.STREAM_MUSIC,0);
mSoundPoolMap=newhashmap();
mSoundPoolMap.put(索引,mSoundPool.load(context,R.raw.sound,1));
mSoundPool.play(id,streamVolume,streamVolume,1,loop,1f);
频率为1f部分。如果将其更改为介于.5f和2.0f之间的值,则会减慢或加快采样,从而改变音高
摘自:
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);