Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用java更改音频频率_Java_Android_Audio_Core Audio_Audio Streaming - Fatal编程技术网

如何使用java更改音频频率

如何使用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

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

这里有一个答案

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);