setPitch

fun setPitch(semitones: Double)

Moves the pitch by semitones, up or down to an octave, without changing how fast the media plays (#465), for a singer practising in another key or a learner following a voice that is hard to hear, as VLC's pitch control does. It works with any setSpeed, and with setPreservePitch false the speed's own pitch change adds to it. The position, the clock and the picture's sync are untouched, because a pitch changes no timing. Zero, the default, costs nothing and leaves every sample as it was. A change has no seam and no gap, and is heard once the audio already buffered has played, as a speed change is. Published as PlayerSnapshot.pitchSemitones.

Throws

when semitones is not finite or is more than PITCH_MAX_SEMITONES either way.