|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rococoa.cocoa.foundation.NSObject
org.rococoa.contrib.appkit.NSSpeechSynthesizer
public abstract class NSSpeechSynthesizer
Provides access to Cocoa NSSpeechSynthesizer. Methods have been wrapped to take and return natural Java types. Convenience methods and wrapper classes have been implemented for property and NSDictionary based datastructures.
Nested Class Summary | |
---|---|
static class |
NSSpeechSynthesizer._Class
Represents the Objective C class of the speech synthesizer |
static class |
NSSpeechSynthesizer.NSSpeechBoundary
Describes boundaries between speech units |
static class |
NSSpeechSynthesizer.NSSpeechCommand
Desribes how to set the delimiters used to embed commands in text to be spoken |
static class |
NSSpeechSynthesizer.NSSpeechError
Describes an error that occurred |
static class |
NSSpeechSynthesizer.NSSpeechMode
Describes the modes a synthesizer can operate in. |
static class |
NSSpeechSynthesizer.NSSpeechPhonemeInfo
Describes information about phonemes the synthesizer uses |
static class |
NSSpeechSynthesizer.NSSpeechStatus
Describes the current status of the synthesizer |
static interface |
NSSpeechSynthesizer.NSSpeechSynthesizerDelegate
Interface to be implemented by Java objects that want to be informed about events reported to the speech syntheszier's delegate |
static class |
NSSpeechSynthesizer.NSSpeechSynthesizerInfo
Describes identifying information about the synthesizer |
static class |
NSSpeechSynthesizer.SpeechProperty
Defines the properties associated with a speech synthesizer. |
Nested classes/interfaces inherited from class org.rococoa.cocoa.foundation.NSObject |
---|
NSObject._class_ |
Field Summary | |
---|---|
static NSSpeechSynthesizer._Class |
CLASS
Represents the Objective C class for NSSpeechSynthesizer |
Constructor Summary | |
---|---|
NSSpeechSynthesizer()
|
Method Summary | |
---|---|
void |
addSpeechDictionary(NSSpeechDictionary dictionary)
Add a speech dictionary to those in use with this synthesizer |
static List<NSVoice> |
availableVoices()
Get a list of all available voices |
abstract void |
continueSpeaking()
Resume speaking if output was paused |
static String |
createSyncPoint(int marker)
Create a sync point that can be embeded in speech, to trigger a synchronization callback. |
static NSVoice |
defaultVoice()
Determine the default voice for this computer, set in system preferences |
NSSpeechSynthesizer.NSSpeechMode |
getCharacterMode()
Get the current character mode, whether the synthesizer is currently speaking strings normally or speaking each character literally. |
NSSpeechSynthesizer.NSSpeechSynthesizerDelegate |
getDelegate()
Get the current delegate |
NSSpeechSynthesizer.NSSpeechError |
getError()
Get the latest error that occurred in the synthesizer |
NSSpeechSynthesizer.NSSpeechMode |
getInputMode()
Get the current input mode, whether the synthesizer is currently expecting regular text input or raw phonemes. |
NSSpeechSynthesizer.NSSpeechMode |
getNumberMode()
Get the current number mode, whether the synthesizer is currently speaking numbers normally or speaking each digit literally. |
List<NSSpeechSynthesizer.NSSpeechPhonemeInfo> |
getPhonemeInfo()
Get a list of phonemes the synthesizer uses |
float |
getPitchBase()
Get the baseline pitch for the synthesizer |
float |
getPitchMod()
Get the pitch modulation for the synthesizer |
NSObject |
getProperty(NSSpeechSynthesizer.SpeechProperty property)
Get the value of a synthesizer property. |
int |
getRecentSync()
Get the most recent sync point encountered when speaking |
NSSpeechSynthesizer.NSSpeechStatus |
getStatus()
Get the status of the synthesizer |
NSSpeechSynthesizer.NSSpeechSynthesizerInfo |
getSynthesizerInfo()
Get identifying information about this synthesizer |
NSVoice |
getVoice()
Get the current voice in use |
String |
getVoiceIdentifier()
Get the identifier of the current voice |
float |
getVolume()
Get the current volume |
static boolean |
isAnyApplicationSpeaking()
Determine whether any application is currently generating speech through the default output channel at present. |
abstract boolean |
isSpeaking()
Determine whether the current application is speaking using the default output channel |
String |
opcodeToPhoneme(short opcode)
Convert a phoneme opcode to human readable form |
abstract void |
pauseSpeakingAtBoundary(NSSpeechSynthesizer.NSSpeechBoundary boundary)
Pause speech at the indicated boundary |
abstract String |
phonemesFromText(String text)
Convert text to phonemes. |
abstract float |
rate()
Get the current rate of speech |
void |
reset()
Reset the synthesizer to the default settings |
void |
setCharacterMode(NSSpeechSynthesizer.NSSpeechMode mode)
Set the current character mode, whether the synthesizer is currently speaking strings normally or speaking each character literally. |
void |
setCommandDelimiter(NSSpeechSynthesizer.NSSpeechCommand delimiters)
Set the command delimiter to use |
void |
setDelegate(NSSpeechSynthesizer.NSSpeechSynthesizerDelegate delegate)
Set the delegate that will receive events when speech is generated. |
void |
setInputMode(NSSpeechSynthesizer.NSSpeechMode mode)
Set the current input mode, whether the synthesizer is currently expecting regular text input or raw phonemes. |
void |
setNumberMode(NSSpeechSynthesizer.NSSpeechMode mode)
Set the current number mode, whether the synthesizer is currently speaking numbers normally or speaking each digit literally. |
void |
setOutputToFileURL(URI uri)
Set the synthesizer to send output to a file instead of the default output channel |
void |
setPitchBase(float baselinePitch)
Set the baseline pitch for the synthesizer |
void |
setPitchMod(float modulation)
Set the pitch modulation for the synthesizer |
void |
setProperty(NSSpeechSynthesizer.SpeechProperty property,
NSObject value)
Set the value of a synthesizer property. |
abstract void |
setRate(float rate)
Set the current rate of speech |
abstract void |
setUsesFeedbackWindow(boolean useFeedbackWindow)
Set whether the feedback window should be used |
boolean |
setVoice(NSVoice voice)
Set the voice to use |
abstract boolean |
setVoice(String voiceIdentifier)
Set the voice to use, should be called when the synthesizer is not currently speaking |
abstract void |
setVolume(float volume)
Set the volume |
abstract boolean |
startSpeakingString(String text)
Start speaking the given string through the default system speech channel |
boolean |
startSpeakingStringToURL(String text,
URI uri)
Speak the given string to a file |
abstract void |
stopSpeaking()
Stop this synthesizer from speaking |
abstract void |
stopSpeakingAtBoundary(NSSpeechSynthesizer.NSSpeechBoundary boundary)
Stop this synthesizer from speaking when it reaches the indicated place. |
static NSSpeechSynthesizer |
synthesizerWithVoice(NSVoice voice)
Construct a new synthesizer that speaks with a specified voice. |
static NSSpeechSynthesizer |
synthesizerWithVoiceIdentifier(String voiceIdentifer)
Construct a new synthesizer that speaks with a specified voice. |
abstract boolean |
usesFeedbackWindow()
Get whether the feedback window is enabled |
Methods inherited from class org.rococoa.cocoa.foundation.NSObject |
---|
description, isKindOfClass, isKindOfClass, release, retain, retainCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.rococoa.ObjCObject |
---|
id |
Field Detail |
---|
public static final NSSpeechSynthesizer._Class CLASS
Constructor Detail |
---|
public NSSpeechSynthesizer()
Method Detail |
---|
public static NSSpeechSynthesizer synthesizerWithVoiceIdentifier(String voiceIdentifer) throws IllegalArgumentException
voiceIdentifer
- the identifier of the voice to use
IllegalArgumentException
- if the identifier is invalid or the voice indicated is not installedpublic static NSSpeechSynthesizer synthesizerWithVoice(NSVoice voice)
voice
- the voice to use, or null to use the defalt voice
IllegalArgumentException
- if the voice is invalid or not installedpublic static NSVoice defaultVoice()
public static List<NSVoice> availableVoices()
public static boolean isAnyApplicationSpeaking()
public void setDelegate(NSSpeechSynthesizer.NSSpeechSynthesizerDelegate delegate)
delegate
- the delegate to set, replacing any existing onepublic NSSpeechSynthesizer.NSSpeechSynthesizerDelegate getDelegate()
public String opcodeToPhoneme(short opcode)
opcode
- the phoneme code to convert
public static String createSyncPoint(int marker)
marker
- the marker number for the sync point
public NSObject getProperty(NSSpeechSynthesizer.SpeechProperty property) throws IllegalArgumentException
property
- the property whose value should be retrieved
IllegalArgumentException
- if an error occurs while reading the propertypublic void setProperty(NSSpeechSynthesizer.SpeechProperty property, NSObject value) throws IllegalArgumentException
property
- the property whose value will be setvalue
- the value to set
IllegalArgumentException
- if an error occurs while setting the propertypublic void addSpeechDictionary(NSSpeechDictionary dictionary)
dictionary
- the dictionary to addpublic NSSpeechSynthesizer.NSSpeechStatus getStatus()
public NSSpeechSynthesizer.NSSpeechError getError()
public NSSpeechSynthesizer.NSSpeechMode getInputMode()
NSSpeechMode.Text
or NSSpeechMode.Phoneme
depending on the current modepublic void setInputMode(NSSpeechSynthesizer.NSSpeechMode mode)
mode
- either NSSpeechMode.Text
or NSSpeechMode.Phoneme
depending on the desired modepublic NSSpeechSynthesizer.NSSpeechMode getCharacterMode()
NSSpeechMode.Normal
or NSSpeechMode.Literal
depending on the current modepublic void setCharacterMode(NSSpeechSynthesizer.NSSpeechMode mode)
mode
- either NSSpeechMode.Normal
or NSSpeechMode.Literal
depending on the desired modepublic NSSpeechSynthesizer.NSSpeechMode getNumberMode()
NSSpeechMode.Normal
or NSSpeechMode.Literal
depending on the current modepublic void setNumberMode(NSSpeechSynthesizer.NSSpeechMode mode)
mode
- either NSSpeechMode.Normal
or NSSpeechMode.Literal
depending on the desired modepublic NSSpeechSynthesizer.NSSpeechSynthesizerInfo getSynthesizerInfo()
public float getPitchBase()
public void setPitchBase(float baselinePitch)
baselinePitch
- the baseline pitch to usepublic float getPitchMod()
public void setPitchMod(float modulation)
modulation
- the pitch modulation to usepublic List<NSSpeechSynthesizer.NSSpeechPhonemeInfo> getPhonemeInfo()
public int getRecentSync()
public boolean setVoice(NSVoice voice)
voice
- the new voice to use
public NSVoice getVoice()
public void setCommandDelimiter(NSSpeechSynthesizer.NSSpeechCommand delimiters)
delimiters
- the delimiters to use when embedding commands in speechpublic void reset()
public void setOutputToFileURL(URI uri)
uri
- a file URI to send output to, pass null to switch back to the computer speakerspublic boolean startSpeakingStringToURL(String text, URI uri)
text
- the text to speakuri
- a file URI indicating where to send output to
public abstract void continueSpeaking()
public abstract boolean isSpeaking()
public abstract void pauseSpeakingAtBoundary(NSSpeechSynthesizer.NSSpeechBoundary boundary)
boundary
- the place to stop speechpublic abstract String phonemesFromText(String text)
text
- the text to convert
public abstract float rate()
public abstract void setRate(float rate)
rate
- the rate to usepublic abstract void setUsesFeedbackWindow(boolean useFeedbackWindow)
useFeedbackWindow
- pass true to enable the feedback windowpublic abstract boolean setVoice(String voiceIdentifier)
voiceIdentifier
- the identifier of the voice to use
public abstract void setVolume(float volume)
volume
- the volume to usepublic abstract boolean startSpeakingString(String text)
text
- the text to speak
public abstract void stopSpeaking()
public abstract void stopSpeakingAtBoundary(NSSpeechSynthesizer.NSSpeechBoundary boundary)
boundary
- the place to stop speakingpublic abstract boolean usesFeedbackWindow()
public String getVoiceIdentifier()
public float getVolume()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |