Example #1
0
// SetVolume sets the speech channel volume.
//
// Speech volumes are expressed in values ranging from 0.0 through 1.0. A value of 0.0 corresponds to silence, and a value of 1.0
// corresponds to the maximum possible volume. Volume units lie on a scale that is linear with amplitude or voltage. A doubling
// of perceived loudness corresponds to a doubling of the volume.
func (c *Channel) SetVolume(volume float64) error {
	return osError(C.mactts_set_property_float64(c.csc, C.kSpeechVolumeProperty, C.double(volume)))
}
Example #2
0
// SetPitchMod sets the pitch modulation of the speech with frequency mapped as a MIDI note number.
//
// Pitch modulation is valid within the range of 0.000 to 127.000, corresponding to MIDI note values, where 60.000 is equal
// to middle C on a piano scale. The most useful speech pitches fall in the range of 40.000 to 55.000. A pitch modulation value
// of 0.000 corresponds to a monotone in which all speech is generated at the frequency corresponding to the speech pitch. Given
// a speech pitch value of 46.000, a pitch modulation of 2.000 would mean that the widest possible range of pitches corresponding
// to the actual frequency of generated text would be 44.000 to 48.000.
func (c *Channel) SetPitchMod(mod float64) error {
	return osError(C.mactts_set_property_float64(c.csc, C.kSpeechPitchModProperty, C.double(mod)))
}