Java Code Examples for android.media.PlaybackParams#setPitch()

The following examples show how to use android.media.PlaybackParams#setPitch() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleExoPlayer.java    From K-Sonic with MIT License 5 votes vote down vote up
public void setPlaybackPitch(float pitch) {
  this.pitch = pitch;
  if (Build.VERSION.SDK_INT >= 23) {
    PlaybackParams params = new PlaybackParams();
    params.setPitch(pitch);
    setPlaybackParams(params);
  } else if (sonicMediaCodecAudioRenderer != null) {
    sonicMediaCodecAudioRenderer.setSonicPitch(pitch);
  }
}
 
Example 2
Source File: AndroidAudioPlayer.java    From AntennaPod-AudioPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void setPitchStepsAdjustment(float pitchSteps) {
    if (Build.VERSION.SDK_INT < 23) {
        return;
    }
    PlaybackParams params = mp.getPlaybackParams();
    params.setPitch(params.getPitch() + pitchSteps);
    mp.setPlaybackParams(params);
}
 
Example 3
Source File: AndroidAudioPlayer.java    From AntennaPod-AudioPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void setPlaybackPitch(float f) {
    Log.d(AMP_TAG, "setPlaybackPitch(" + f + ")");
    if (Build.VERSION.SDK_INT < 23) {
        return;
    }
    PlaybackParams params = mp.getPlaybackParams();
    params.setPitch(f);
    mp.setPlaybackParams(params);
}