Documentation
¶
Index ¶
- Constants
- func AddWavHeader(pcm []byte, sampleRate int, channels int, bitsPerSample int) (wav []byte, err error)
- func Cancel() int
- func GetDefaultParameter(parameter EspeakParameter) int
- func GetParameter(parameter EspeakParameter) int
- func Initialize(ngDataPath string) int
- func IsPlaying() int
- func Save(textInput, wavOutput string) int
- func SetParameter(parameter EspeakParameter, value int, relative int) int
- func SetVoiceByName(voice string) int
- func Sync() int
- func Synth(text string, position uint, positionType EspeakPositionType, endPosition uint) int
- func SynthFlags(text string, position uint, positionType EspeakPositionType, endPosition uint, ...) int
- func Terminate() int
- type EspeakAudioOutput
- type EspeakParameter
- type EspeakPositionType
- type EspeakSynthFlag
- type Resampler
Constants ¶
View Source
const ( // Quality settings Quick = 0 // Quick cubic interpolation LowQ = 1 // LowQ 16-bit with larger rolloff MediumQ = 2 // MediumQ 16-bit with medium rolloff HighQ = 4 // High quality VeryHighQ = 6 // Very high quality // Input formats F32 = 0 // 32-bit floating point PCM F64 = 1 // 64-bit floating point PCM I32 = 2 // 32-bit signed linear PCM I16 = 3 // 16-bit signed linear PCM )
Variables ¶
This section is empty.
Functions ¶
func AddWavHeader ¶
func GetDefaultParameter ¶
func GetDefaultParameter(parameter EspeakParameter) int
func GetParameter ¶
func GetParameter(parameter EspeakParameter) int
func Initialize ¶
func SetParameter ¶
func SetParameter(parameter EspeakParameter, value int, relative int) int
func SetVoiceByName ¶
func Synth ¶
func Synth(text string, position uint, positionType EspeakPositionType, endPosition uint) int
func SynthFlags ¶
func SynthFlags(text string, position uint, positionType EspeakPositionType, endPosition uint, flags EspeakSynthFlag) int
Types ¶
type EspeakAudioOutput ¶
type EspeakAudioOutput int
const ( AUDIO_OUTPUT_PLAYBACK EspeakAudioOutput = 0 AUDIO_OUTPUT_RETRIEVAL EspeakAudioOutput = 1 AUDIO_OUTPUT_SYNCHRONOUS EspeakAudioOutput = 2 AUDIO_OUTPUT_SYNCH_PLAYBACK EspeakAudioOutput = 3 )
type EspeakParameter ¶
type EspeakParameter int
const ( SILENCE EspeakParameter = 0 RATE EspeakParameter = 1 VOLUME EspeakParameter = 2 PITCH EspeakParameter = 3 RANGE EspeakParameter = 4 PUNCTUATION EspeakParameter = 5 CAPITALS EspeakParameter = 6 WORDGAP EspeakParameter = 7 OPTIONS EspeakParameter = 8 INTONATION EspeakParameter = 9 RESERVED1 EspeakParameter = 10 RESERVED2 EspeakParameter = 11 EMPHASIS EspeakParameter = 12 LINELENGTH EspeakParameter = 13 VOICETYPE EspeakParameter = 14 N_SPEECH_PARAM EspeakParameter = 15 )
type EspeakPositionType ¶
type EspeakPositionType int
const ( POS_CHARACTER EspeakPositionType = 1 POS_WORD EspeakPositionType = 2 POS_SENTENCE EspeakPositionType = 3 )
type EspeakSynthFlag ¶
type EspeakSynthFlag int
const ( FLAG_SSML EspeakSynthFlag = 0x10 FLAG_PHONEMES EspeakSynthFlag = 0x100 FLAG_ENDPAUSE EspeakSynthFlag = 0x1000 FLAG_KEEP_NAMEDATA EspeakSynthFlag = 0x2000 )
type Resampler ¶
type Resampler struct {
// contains filtered or unexported fields
}
Resampler resamples PCM sound data.
func NewResampler ¶
func NewResampler(writer io.Writer, inputRate, outputRate float64, channels, format, quality int) (*Resampler, error)
NewResampler returns a pointer to a Resampler that implements an io.WriteCloser. It takes as parameters the destination data Writer, the input and output sampling rates, the number of channels of the input data, the input format and the quality setting.
func (*Resampler) Close ¶
Close clean-ups and frees memory. Should always be called when finished using the resampler.
Click to show internal directories.
Click to hide internal directories.