Added a second, lower pitch SAM sound bank

secondvoice
Aaron Johnon 1 year ago
parent 4c9c9d8d69
commit e90404cf5c

@ -25,8 +25,9 @@ const (
) )
func main() { func main() {
// Define and parse the -r flag // Define and parse the flags
repeat := flag.Bool("r", false, "Repeat each section separated by space, '-', '_', or a new line") repeat := flag.Bool("r", false, "Repeat each section separated by space, '-', '_', or a new line")
low := flag.Bool("l", false, "Use lower pitched SAM sound bank")
flag.Usage = func() { flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: %s [options]\n", os.Args[0]) fmt.Fprintf(os.Stderr, "Usage: %s [options]\n", os.Args[0])
@ -47,15 +48,23 @@ func main() {
flag.Parse() flag.Parse()
// Select the correct file prefix based on the low flag
prefix := "sam"
if *low {
prefix = "losam"
}
// Create a map to store sound data for each character // Create a map to store sound data for each character
soundMap := make(map[rune][]byte) soundMap := make(map[rune][]byte)
// Load all sound files into the map // Load all sound files into the map
for _, c := range "abcdefghijklmnopqrstuvwxyz0123456789" { for _, c := range "abcdefghijklmnopqrstuvwxyz0123456789" {
filename := fmt.Sprintf("sound/sam%c.wav", c) filename := fmt.Sprintf("sound/%s%c.wav", prefix, c)
data, err := soundFS.ReadFile(filename) data, err := soundFS.ReadFile(filename)
if err == nil { if err == nil {
soundMap[c] = data soundMap[c] = data
} else {
fmt.Printf("Failed to load sound for '%c': %v\n", c, err)
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save