|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PitchControl
PitchControl raises or lowers the playback pitch of audio without changing the playback speed.
PitchControl can be implemented in Players for MIDI media or sampled audio. It is not possible to set audible output to an absolute pitch value. This control raises or lowers pitch relative to the original.
The pitch change is specified in number of "milli-semitones" to raise the pitch. As an example, specifying a pitch of 12'000 results in playback one octave higher. For MIDI that means that all MIDI notes are raised by 12 (semitones). For sampled audio playback, it means doubling the frequency of perceived sounds (i.e. a 440Hz sound will become a 880Hz sound.). Negative values are used to lower the pitch.
All Players
by default support 0, or no pitch change. A
Player
which supports only 0 pitch change must not implement
PitchControl
.
PitchControl does not influence playback volume in any way.
Method Summary | ||
---|---|---|
int |
getMaxPitch()
Gets the maximum playback pitch raise supported by the Player |
|
int |
getMinPitch()
Gets the minimum playback pitch raise supported by the Player |
|
int |
getPitch()
Gets the current playback pitch raise. |
|
int |
setPitch(int millisemitones)
Sets the relative pitch raise. |
Method Detail |
---|
int setPitch(int millisemitones)
The setPitch
method returns the actual pitch change set
by the Player
. Players
should set their pitch raise
as close to the requested value as possible, but are not required to set
it to the exact value of any argument other than 0. A
Player
is only guaranteed to set its pitch change exactly
to 0. If the given pitch raise is less than the value returned by
getMinPitch
or greater than the value returned by
getMaxPitch
, it will be adjusted to the minimum or maximum
supported pitch raise respectively.
millisemitones
- The number of semi tones to raise the playback
pitch. It is specified in "millisemitones".
PitchControl.getPitch()
int getPitch()
int getMaxPitch()
Player
int getMinPitch()
Player
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal