org.alchar.jdtk.jsapi
Class DTKSynthesizerProperties

java.lang.Object
  extended by org.alchar.jdtk.jsapi.DTKSynthesizerProperties
All Implemented Interfaces:
EngineProperties, SynthesizerProperties

public class DTKSynthesizerProperties
extends Object
implements SynthesizerProperties

This class provides an implementation of the JSAPI 1.0 SynthesizerProperties interface for the DECtalk software speech synthesizer.


Constructor Summary
DTKSynthesizerProperties()
          Create a new synthesizer properties object with default values.
DTKSynthesizerProperties(Voice voice, float averagePitch, float pitchRange, float rate, float volume)
          Create a new synthesizer properties object with the given values.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list of this object.
 Component getControlComponent()
          Return the component that provides the default user interface for setting the properties.
 float getPitch()
          Return the average pitch (in Hz).
 float getPitchRange()
          Return the pitch range (in Hz).
 float getSpeakingRate()
          Return the speaking rate (in words per minute).
 Voice getVoice()
          Return the voice.
 float getVolume()
          Return the volume as a value within the closed range [0.0, 1.0].
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list of this object.
 void reset()
          Reset the object state.
 void sendPropertyChangeEvent(PropertyChangeEvent ev)
          Send a property change event to all the listeners.
 void sendPropertyChangeEvent(String name, float oldValue, float newValue)
          Send a property change event for a float property value change.
 void sendPropertyChangeEvent(String name, Object oldValue, Object newValue)
          Send a property change event for an object property value change.
 void setPitch(float averagePitch)
          Set the average pitch (in Hz).
 void setPitchRange(float pitchRange)
          Set the pitch range (in Hz).
 void setSpeakingRate(float rate)
          Set the speaking rate (in words per minute).
 void setVoice(Voice voice)
          Set the voice.
 void setVolume(float volume)
          Set the volume as a value within the closed range [0.0, 1.0].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTKSynthesizerProperties

public DTKSynthesizerProperties()
Create a new synthesizer properties object with default values.


DTKSynthesizerProperties

public DTKSynthesizerProperties(Voice voice,
                                float averagePitch,
                                float pitchRange,
                                float rate,
                                float volume)
Create a new synthesizer properties object with the given values.

Parameters:
voice - Default voice
averagePitch - Average pitch
pitchRange - Pitch range
rate - Speaking rate
volume - Volume
Method Detail

getPitchRange

public float getPitchRange()
Return the pitch range (in Hz).

Specified by:
getPitchRange in interface SynthesizerProperties
Returns:
Pitch range (in Hz)

setPitchRange

public void setPitchRange(float pitchRange)
                   throws PropertyVetoException
Set the pitch range (in Hz).

Specified by:
setPitchRange in interface SynthesizerProperties
Parameters:
pitchRange - Pitch range (in Hz)
Throws:
PropertyVetoException - if the value cannot be set

getPitch

public float getPitch()
Return the average pitch (in Hz).

Specified by:
getPitch in interface SynthesizerProperties
Returns:
Average pitch (in Hz)

setPitch

public void setPitch(float averagePitch)
              throws PropertyVetoException
Set the average pitch (in Hz).

Specified by:
setPitch in interface SynthesizerProperties
Parameters:
averagePitch - Average pitch (in Hz)
Throws:
PropertyVetoException - if the value cannot be set

getSpeakingRate

public float getSpeakingRate()
Return the speaking rate (in words per minute).

Specified by:
getSpeakingRate in interface SynthesizerProperties
Returns:
Speaking rate (in words per minute)

setSpeakingRate

public void setSpeakingRate(float rate)
                     throws PropertyVetoException
Set the speaking rate (in words per minute).

Specified by:
setSpeakingRate in interface SynthesizerProperties
Parameters:
rate - Speaking rate (in words per minute)
Throws:
PropertyVetoException - if the value cannot be set

getVoice

public Voice getVoice()
Return the voice.

Specified by:
getVoice in interface SynthesizerProperties
Returns:
Voice

setVoice

public void setVoice(Voice voice)
              throws PropertyVetoException
Set the voice.

Specified by:
setVoice in interface SynthesizerProperties
Parameters:
voice - Voice
Throws:
PropertyVetoException - if the value cannot be set

getVolume

public float getVolume()
Return the volume as a value within the closed range [0.0, 1.0].

Specified by:
getVolume in interface SynthesizerProperties
Returns:
Volume

setVolume

public void setVolume(float volume)
               throws PropertyVetoException
Set the volume as a value within the closed range [0.0, 1.0].

Specified by:
setVolume in interface SynthesizerProperties
Parameters:
volume - Volume
Throws:
PropertyVetoException - if the value cannot be set

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list of this object.

Specified by:
addPropertyChangeListener in interface EngineProperties
Parameters:
listener - Property change listener

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list of this object.

Specified by:
removePropertyChangeListener in interface EngineProperties

reset

public void reset()
Reset the object state.

Specified by:
reset in interface EngineProperties

getControlComponent

public Component getControlComponent()
Return the component that provides the default user interface for setting the properties.

Specified by:
getControlComponent in interface EngineProperties
Returns:
AWT Component

sendPropertyChangeEvent

public void sendPropertyChangeEvent(PropertyChangeEvent ev)
Send a property change event to all the listeners.

Parameters:
ev - Property change event

sendPropertyChangeEvent

public void sendPropertyChangeEvent(String name,
                                    Object oldValue,
                                    Object newValue)
Send a property change event for an object property value change.

Parameters:
name - Property name
oldValue - Old value
newValue - New value

sendPropertyChangeEvent

public void sendPropertyChangeEvent(String name,
                                    float oldValue,
                                    float newValue)
Send a property change event for a float property value change.

Parameters:
name - Property name
oldValue - Old value
newValue - New value


Copyright © 2007-2009 Kris Van Hees. All Rights Reserved.