|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SoundConverter
Interface for easy integration of a sound converter to SoundPlayer and SoundPlayerExt classes. Typically a converter may apply some sort of 'filtering', e.g. change the pitch with same tempo or change the tempo with same pitch. The sound is converted by data junks. putSamples() feeds the converter with a new data junk. receiveSamples() returns the converted samples. Because there may be same convertion delay, receiveSamples() may return none, a part or all converted samples of data previously sent to the converter. If the number of available bytes exceeds 'maxBytes', receiveSamples() is called several times until all data is retrieved. The input and output format to the converter must have PCM_SIGNED mono or stereo format (16 bit little endian).
Method Summary | |
---|---|
void |
cleanup()
Callback method called when no more data is available before closing SoundPlayer's output to the sound device. |
void |
putSamples(byte[] inBuffer,
int nbBytes)
Notification from the SoundPlayer that the given number of samples is available in inBuffer to be converted by the SoundConverter. |
int |
receiveSamples(byte[] outBuffer,
int nbBytes)
Notification from the SoundPlayer to get back the converted data in outBuffer. |
void |
update()
Callback method called each time before the new samples from the inBuffer are fed into the converter. |
Method Detail |
---|
void putSamples(byte[] inBuffer, int nbBytes)
int receiveSamples(byte[] outBuffer, int nbBytes)
void update()
void cleanup()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |