Divooka Reference

Speech

6 nodes

On this page 6

Align Speech

Function

Finds when each word of a known text was said in a clip of it being read, and each of the word's sounds - for subtitles, karaoke and lip sync.

Signature
AlignSpeech -> (Words: Aligned Word Array, phones: Aligned Phone Array)
    audio: AudioBuffer
    text: Text
AlignedWord[] AlignSpeech(
    AudioBuffer audio,
    string text,
    out AlignedPhone[] phones)

Parameters

nametypedefaultdescription
audioAudioBuffer—The speech to align.
textText—What the speech says, word for word.

Returns

WordsAligned Word Array
phonesAligned Phone Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Speech
Package
Audio Processing

Find Speech

Function

Finds the stretches of a clip in which somebody is talking, leaving out the pauses, silence and noise between them.

Signature
FindSpeech -> Speech Interval Array
    audio: AudioBuffer
    strictness: Speech Strictness
SpeechInterval[] FindSpeech(
    AudioBuffer audio,
    SpeechStrictness strictness = SpeechStrictness.Loose)

Parameters

nametypedefaultdescription
audioAudioBuffer—The clip to search.
strictnessSpeech StrictnessLooseHow readily a stretch of sound is called speech: Loose keeps quiet words and a little noise, Strict only clear talking.

Returns

IntervalsSpeech Interval Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Speech
Package
Audio Processing

Recognize Speech

Function

Hears which of a list of phrases is said in a clip - or what a grammar allows - and when each word was said.

Signature
RecognizeSpeech -> (Text: Text, words: Spoken Word Array)
    audio: AudioBuffer
    phrases: Text
string RecognizeSpeech(
    AudioBuffer audio,
    string phrases,
    out SpokenWord[] words)

Parameters

nametypedefaultdescription
audioAudioBuffer—The speech to hear.
phrasesText—What may be said: phrases separated by | or on lines of their own, or a whole JSGF grammar.

Returns

TextText
wordsSpoken Word Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Speech
Package
Audio Processing

Speak

Function

Speaks a phrase written in ARPABET phonemes - HH AH0 L OW1 is "hello" - with a recorded human voice.

Signature
Speak(phonemes: Text, pitch: Number) -> AudioBuffer
AudioBuffer Speak(
    string phonemes = "HH AH0 L OW1",
    double pitch = 120)

Parameters

nametypedefaultdescription
phonemesTextHH AH0 L OW1The phrase, in ARPABET.
pitchNumber120The voice's pitch, in hertz; 95 is this voice's own, around 120 a little higher, 220 a high voice.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Speech
Package
Audio Processing

Speak Text

Function

Reads English text aloud with a recorded human voice.

Signature
SpeakText -> AudioBuffer
    text: Text
    pitch: Number
    speed: Number
AudioBuffer SpeakText(
    string text = "Hello, world.",
    double pitch = 95,
    double speed = 1)

Parameters

nametypedefaultdescription
textTextHello, world.What to say.
pitchNumber95The voice's pitch, in hertz; 95 is this voice's own.
speedNumber1How fast to speak: 1 is the voice's own pace, 2 twice as fast, 0.5 half.

Returns

AudioAudioBuffer
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Speech
Package
Audio Processing

Spot Keywords

Function

Finds where key phrases are said in a stretch of speech - "hey computer" in a conversation - and when.

Signature
SpotKeywords -> Key Phrase Detection Array
    audio: AudioBuffer
    keyPhrases: Text
    threshold: Number
KeyPhraseDetection[] SpotKeywords(
    AudioBuffer audio,
    string keyPhrases = "hello",
    double threshold = 0)

Parameters

nametypedefaultdescription
audioAudioBuffer—The speech to search.
keyPhrasesTexthelloThe phrases to find, separated by | or on lines of their own.
thresholdNumber0How sure a detection must be, as a power of ten: -20 is 1e-20; lower finds more. 0 uses PocketSphinx's own, 1e-30.

Returns

DetectionsKey Phrase Detection Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Speech
Package
Audio Processing