|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.speech.freetts.audio.MultiFile8BitAudioPlayer
Streams audio to multiple files as 8-bit samples, one per utterance. Currently, FreeTTS always outputs 16-bit samples, and this MultiFile8BitAudioPlayer will convert them to 8-bit before outputting them.
| Constructor Summary | |
MultiFile8BitAudioPlayer()
Creates a default audio player for an AudioFileFormat of type WAVE. |
|
MultiFile8BitAudioPlayer(java.lang.String baseName,
javax.sound.sampled.AudioFileFormat.Type type)
Constructs a MultiFile8BitAudioPlayer |
|
| Method Summary | |
void |
begin(int size)
Starts the output of a set of data. |
void |
cancel()
Cancels currently playing audio |
void |
close()
Closes this audio player |
boolean |
drain()
Waits for all queued audio to be played |
boolean |
end()
Marks the end of a set of data. |
javax.sound.sampled.AudioFormat |
getAudioFormat()
Gets the audio format for this player |
long |
getTime()
Gets the amount of played since the last mark |
float |
getVolume()
Returns the current volume. |
void |
pause()
Pauses audio output |
void |
reset()
Prepares for another batch of output. |
void |
resetTime()
Resets the audio clock |
void |
resume()
Resumes audio output |
void |
setAudioFormat(javax.sound.sampled.AudioFormat format)
Sets the audio format for this player |
void |
setVolume(float volume)
Sets the current volume. |
void |
showMetrics()
Shows metrics for this audio player |
void |
startFirstSampleTimer()
Starts the first sample timer |
java.lang.String |
toString()
Returns the name of this audioplayer |
boolean |
write(byte[] audioData)
Writes the given bytes to the audio stream |
boolean |
write(byte[] bytes,
int offset,
int size)
Writes the given bytes to the audio stream |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MultiFile8BitAudioPlayer()
public MultiFile8BitAudioPlayer(java.lang.String baseName,
javax.sound.sampled.AudioFileFormat.Type type)
baseName - the base name of the audio filetype - the type of audio output| Method Detail |
public void setAudioFormat(javax.sound.sampled.AudioFormat format)
setAudioFormat in interface AudioPlayerformat - the audio format
java.lang.UnsupportedOperationException - if the line cannot be opened with
the given formatpublic javax.sound.sampled.AudioFormat getAudioFormat()
getAudioFormat in interface AudioPlayerpublic void pause()
pause in interface AudioPlayerpublic void resume()
resume in interface AudioPlayerpublic void startFirstSampleTimer()
startFirstSampleTimer in interface AudioPlayerpublic void cancel()
cancel in interface AudioPlayerpublic void reset()
reset in interface AudioPlayerpublic void close()
close in interface AudioPlayerpublic float getVolume()
getVolume in interface AudioPlayerpublic void setVolume(float volume)
setVolume in interface AudioPlayervolume - the current volume (between 0 and 1)public void begin(int size)
begin in interface AudioPlayersize - the size of data between now and the endpublic boolean end()
end in interface AudioPlayerpublic boolean drain()
drain in interface AudioPlayerpublic long getTime()
getTime in interface AudioPlayerpublic void resetTime()
resetTime in interface AudioPlayerpublic boolean write(byte[] audioData)
write in interface AudioPlayeraudioData - audio data to write to the device
true of the write completed successfully,
false if the write was cancelled.
public boolean write(byte[] bytes,
int offset,
int size)
write in interface AudioPlayerbytes - audio data to write to the deviceoffset - the offset into the buffersize - the size into the buffer
true of the write completed successfully,
false if the write was cancelled.public java.lang.String toString()
public void showMetrics()
showMetrics in interface AudioPlayer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||