Documentation
¶
Overview ¶
Package sim is talkie's test bench: real speech clips, the real Silero VAD, a scripted wake word and a simulated room whose speaker echoes into the microphone. Tests drive an engine with it in lock-step, like an audio device but faster than real time. Ported from wonky-talkie's tests/harness.py and EchoRoom.
Index ¶
- Constants
- Variables
- func AgentVoice(tb testing.TB, seconds float64) []float32
- func Clip(tb testing.TB, name string, from, to float64) []float32
- func Command(tb testing.TB) []float32
- func DecodeWAV(data []byte) ([]float32, error)
- func SaysConfusable(tb testing.TB, voice string) []float32
- func SaysWakeWord(tb testing.TB, voice string) []float32
- func ShortReply(tb testing.TB) []float32
- func VAD(tb testing.TB) func([]float32) (float32, error)
- func WakePhrase(tb testing.TB) []float32
- type Noise
- type Room
- type Wake
Constants ¶
const Rate = 16000
Rate is the microphone and simulated speaker rate.
Variables ¶
var Voices = []string{"af_heart", "am_michael", "bf_emma"}
Voices are the Kokoro voices with wake word clips.
Functions ¶
func AgentVoice ¶
AgentVoice is continuous speech used as the agent's synthesized voice.
func Command ¶
Command is about 2.7 s of speech, isolated by silence in the source clip: "So if we turn that off, does it work with".
func SaysConfusable ¶
SaysConfusable is voice saying "hey commuter", which PhonMatchNet can score as high as "hey computer".
func SaysWakeWord ¶
SaysWakeWord is voice saying "hey computer", synthesized by Kokoro.
func ShortReply ¶
ShortReply is about 1.6 s of speech: "Turn on the office lights."
Types ¶
type Noise ¶
type Noise struct {
// contains filtered or unexported fields
}
Noise makes room noise at about -65 dBFS, reproducibly.
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room is a simulated speaker -> room -> mic path: the agent's audio comes back delayed (80 ms), reverberant (300 ms RT60), slightly distorted and 6 dB down, plus room noise. Without echo it is a headset: the mic hears only the user.
func NewRoomDelay ¶
NewRoomDelay is NewRoom with a speaker-to-mic delay of delayMS and an echo gainDB relative to what the speaker played. NewRoom is 80 ms and -6 dB; a loud speaker near a sensitive microphone can be +8 dB and slower.