【问题标题】:How to change frequency of audio using java如何使用java更改音频频率
【发布时间】:2014-10-21 20:33:45
【问题描述】:

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

【问题讨论】:

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


    【解决方案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部分。如果您将其更改为 0.5f 和 2.0f 之间的值,这应该会减慢或加快采样速度,从而改变音高。

    取自: Changing Pitch and Frequency of Recorded Audio

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-27
      • 1970-01-01
      • 2021-10-26
      • 1970-01-01
      • 1970-01-01
      • 2020-04-11
      • 2013-09-30
      相关资源
      最近更新 更多