public class SoundTouch
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SETTING_AA_FILTER_LENGTH
Constant for setSetting().
|
static int |
SETTING_OVERLAP_MS
Constant for setSetting().
|
static int |
SETTING_SEEKWINDOW_MS
Constant for setSetting().
|
static int |
SETTING_SEQUENCE_MS
Constant for setSetting().
|
static int |
SETTING_USE_AA_FILTER
Constant for setSetting().
|
static int |
SETTING_USE_QUICKSEEK
Constant for setSetting().
|
Constructor and Description |
---|
SoundTouch()
Creates a new SoundTouch instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all the samples in the object's output and internal processing
buffers.
|
void |
destroy()
Releases all resources.
|
void |
flush()
Flushs the last samples from the processing pipeline to the output.
|
int |
getSetting(int settingId)
Returns a setting controlling the processing system behaviour.
|
int |
getVersionId()
Gets SoundTouch library version Id.
|
java.lang.String |
getVersionString()
Gets SoundTouch library version string.
|
int |
isEmpty()
Returns nonzero if there aren't any samples available for outputting.
|
int |
numSamples()
Returns number of samples currently available.
|
int |
numUnprocessedSamples()
Returns number of samples currently unprocessed.
|
void |
putSamples(byte[] inBuffer,
int numBytes)
Adds given number of bytes from the given buffer into
the input of the converter.
|
int |
receiveSamples(byte[] outBuffer,
int maxBytes)
Outputs samples from beginning of the sample buffer.
|
int |
receiveSamples(int maxSamples)
Removes up to the given number of samples from the beginning of sample buffer.
|
void |
setChannels(int numChannels)
Sets the number of channels, 1 = mono, 2 = stereo.
|
void |
setPitch(float newPitch)
Sets new pitch control value.
|
void |
setPitchOctaves(float newPitch)
Sets pitch change in octaves compared to the original pitch
(-1.00 .. +1.00).
|
void |
setPitchSemiTones(float newPitch)
Sets pitch change in semi-tones compared to the original pitch
(-12 .. +12).
|
void |
setPitchSemiTones(int newPitch)
Sets pitch change in semi-tones compared to the original pitch
(-12 .. +12).
|
void |
setRate(float newRate)
Sets new rate control value.
|
void |
setRateChange(float newRate)
Sets new rate control value as a difference in percents compared
to the original rate (-50 .. +100 %).
|
void |
setSampleRate(int srate)
Sets sample rate in samples per seconds.
|
boolean |
setSetting(int settingId,
int value)
Changes a setting controlling the processing system behaviour.
|
void |
setTempo(float newTempo)
Sets new tempo control value.
|
void |
setTempoChange(float newTempo)
Sets new tempo control value as a difference in percents compared
to the original tempo (-50 .. +100 %).
|
public static final int SETTING_USE_AA_FILTER
public static final int SETTING_AA_FILTER_LENGTH
public static final int SETTING_USE_QUICKSEEK
public static final int SETTING_SEQUENCE_MS
public static final int SETTING_SEEKWINDOW_MS
public static final int SETTING_OVERLAP_MS
public SoundTouch()
destroy()
public void destroy()
public java.lang.String getVersionString()
public int getVersionId()
public void setRate(float newRate)
public void setTempo(float newTempo)
public void setRateChange(float newRate)
public void setTempoChange(float newTempo)
public void setPitch(float newPitch)
public void setPitchOctaves(float newPitch)
public void setPitchSemiTones(int newPitch)
public void setPitchSemiTones(float newPitch)
public void setChannels(int numChannels)
public void setSampleRate(int srate)
public void flush()
public void putSamples(byte[] inBuffer, int numBytes) throws java.lang.RuntimeException
java.lang.RuntimeException
- if native call fails
(e.g. if the sample rate has not been set before calling this method)public void clear()
public boolean setSetting(int settingId, int value)
public int getSetting(int settingId)
setSetting(int, int)
public int numUnprocessedSamples()
public int receiveSamples(byte[] outBuffer, int maxBytes)
public int receiveSamples(int maxSamples)
public int numSamples()
public int isEmpty()