Reset master to testing content
This commit is contained in:
1 parent
0f2587b719
commit
42afa2a56c
1483 files changed
+145308
-938069
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2026 Storm Dragon
|
||||
// Authors: Storm Dragon, Angus Kola
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package speech
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHardwareProtocolsMatchPython(t *testing.T) {
|
||||
rate, pitch, volume := 99.0, 9.0, 9.0
|
||||
voice := HardwareVoice{Rate: &rate, Pitch: &pitch, Volume: &volume}
|
||||
for _, synth := range []string{"litetalk", "doubletalk", "tripletalk", "dectalk"} {
|
||||
want := "\x019S\x0199P\x019VHello !\r"
|
||||
if synth == "dectalk" {
|
||||
want = "[:ra 650][:dv ap 180][:vo 100]Hello !\x01"
|
||||
}
|
||||
if got := string(hardware_bytes(synth, "Hello\n\x01é猫!", voice)); got != want {
|
||||
t.Fatalf("%s: got %q, want %q", synth, got, want)
|
||||
}
|
||||
}
|
||||
rate, pitch, volume = 0, 0, 0
|
||||
if got := string(hardware_bytes("dectalk", "Low", voice)); got != "[:ra 75][:dv ap 50][:vo 0]Low\x01" {
|
||||
t.Fatal(got)
|
||||
}
|
||||
rate, pitch, volume = 49.5, 4.5, 4.5
|
||||
if got := string(hardware_bytes("litetalk", "Middle", voice)); got != "\x014S\x0150P\x014VMiddle\r" {
|
||||
t.Fatal(got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user