diff --git a/numberstation.go b/numberstation.go index 295f5f3..9a25fec 100644 --- a/numberstation.go +++ b/numberstation.go @@ -25,8 +25,9 @@ const ( ) 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") + altvoice := flag.Bool("a", false, "Use alternate (lower pitched) SAM sound bank") flag.Usage = func() { fmt.Fprintf(os.Stderr, "Usage: %s [options]\n", os.Args[0]) @@ -47,15 +48,23 @@ func main() { flag.Parse() + // Select the correct file prefix based on the altvoice flag + prefix := "sam" + if *altvoice { + prefix = "altsam" + } + // Create a map to store sound data for each character soundMap := make(map[rune][]byte) // Load all sound files into the map 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) if err == nil { soundMap[c] = data + } else { + fmt.Printf("Failed to load sound for '%c': %v\n", c, err) } } diff --git a/sound/altsam0.wav b/sound/altsam0.wav new file mode 100644 index 0000000..7658858 Binary files /dev/null and b/sound/altsam0.wav differ diff --git a/sound/altsam1.wav b/sound/altsam1.wav new file mode 100644 index 0000000..15786ad Binary files /dev/null and b/sound/altsam1.wav differ diff --git a/sound/altsam2.wav b/sound/altsam2.wav new file mode 100644 index 0000000..f360bb4 Binary files /dev/null and b/sound/altsam2.wav differ diff --git a/sound/altsam3.wav b/sound/altsam3.wav new file mode 100644 index 0000000..8b686ec Binary files /dev/null and b/sound/altsam3.wav differ diff --git a/sound/altsam4.wav b/sound/altsam4.wav new file mode 100644 index 0000000..ef536a2 Binary files /dev/null and b/sound/altsam4.wav differ diff --git a/sound/altsam5.wav b/sound/altsam5.wav new file mode 100644 index 0000000..cb64cbc Binary files /dev/null and b/sound/altsam5.wav differ diff --git a/sound/altsam6.wav b/sound/altsam6.wav new file mode 100644 index 0000000..459bfcb Binary files /dev/null and b/sound/altsam6.wav differ diff --git a/sound/altsam7.wav b/sound/altsam7.wav new file mode 100644 index 0000000..ea4a29d Binary files /dev/null and b/sound/altsam7.wav differ diff --git a/sound/altsam8.wav b/sound/altsam8.wav new file mode 100644 index 0000000..32e8c65 Binary files /dev/null and b/sound/altsam8.wav differ diff --git a/sound/altsam9.wav b/sound/altsam9.wav new file mode 100644 index 0000000..1528f96 Binary files /dev/null and b/sound/altsam9.wav differ diff --git a/sound/altsama.wav b/sound/altsama.wav new file mode 100644 index 0000000..73e5042 Binary files /dev/null and b/sound/altsama.wav differ diff --git a/sound/altsamb.wav b/sound/altsamb.wav new file mode 100644 index 0000000..2ac2307 Binary files /dev/null and b/sound/altsamb.wav differ diff --git a/sound/altsamc.wav b/sound/altsamc.wav new file mode 100644 index 0000000..fbd0158 Binary files /dev/null and b/sound/altsamc.wav differ diff --git a/sound/altsamd.wav b/sound/altsamd.wav new file mode 100644 index 0000000..7612991 Binary files /dev/null and b/sound/altsamd.wav differ diff --git a/sound/altsame.wav b/sound/altsame.wav new file mode 100644 index 0000000..75fa02e Binary files /dev/null and b/sound/altsame.wav differ diff --git a/sound/altsamf.wav b/sound/altsamf.wav new file mode 100644 index 0000000..b710021 Binary files /dev/null and b/sound/altsamf.wav differ diff --git a/sound/altsamg.wav b/sound/altsamg.wav new file mode 100644 index 0000000..d17e9b0 Binary files /dev/null and b/sound/altsamg.wav differ diff --git a/sound/altsamh.wav b/sound/altsamh.wav new file mode 100644 index 0000000..152e212 Binary files /dev/null and b/sound/altsamh.wav differ diff --git a/sound/altsami.wav b/sound/altsami.wav new file mode 100644 index 0000000..01fd5d4 Binary files /dev/null and b/sound/altsami.wav differ diff --git a/sound/altsamj.wav b/sound/altsamj.wav new file mode 100644 index 0000000..867f3c8 Binary files /dev/null and b/sound/altsamj.wav differ diff --git a/sound/altsamk.wav b/sound/altsamk.wav new file mode 100644 index 0000000..de38f11 Binary files /dev/null and b/sound/altsamk.wav differ diff --git a/sound/altsaml.wav b/sound/altsaml.wav new file mode 100644 index 0000000..27845c1 Binary files /dev/null and b/sound/altsaml.wav differ diff --git a/sound/altsamm.wav b/sound/altsamm.wav new file mode 100644 index 0000000..a16267c Binary files /dev/null and b/sound/altsamm.wav differ diff --git a/sound/altsamn.wav b/sound/altsamn.wav new file mode 100644 index 0000000..1eaff59 Binary files /dev/null and b/sound/altsamn.wav differ diff --git a/sound/altsamo.wav b/sound/altsamo.wav new file mode 100644 index 0000000..2a49d95 Binary files /dev/null and b/sound/altsamo.wav differ diff --git a/sound/altsamp.wav b/sound/altsamp.wav new file mode 100644 index 0000000..b440ae9 Binary files /dev/null and b/sound/altsamp.wav differ diff --git a/sound/altsamq.wav b/sound/altsamq.wav new file mode 100644 index 0000000..d33ca12 Binary files /dev/null and b/sound/altsamq.wav differ diff --git a/sound/altsamr.wav b/sound/altsamr.wav new file mode 100644 index 0000000..b49e8ed Binary files /dev/null and b/sound/altsamr.wav differ diff --git a/sound/altsams.wav b/sound/altsams.wav new file mode 100644 index 0000000..3e3ca3d Binary files /dev/null and b/sound/altsams.wav differ diff --git a/sound/altsamt.wav b/sound/altsamt.wav new file mode 100644 index 0000000..cf7824f Binary files /dev/null and b/sound/altsamt.wav differ diff --git a/sound/altsamu.wav b/sound/altsamu.wav new file mode 100644 index 0000000..5fdcfaf Binary files /dev/null and b/sound/altsamu.wav differ diff --git a/sound/altsamv.wav b/sound/altsamv.wav new file mode 100644 index 0000000..07ab88a Binary files /dev/null and b/sound/altsamv.wav differ diff --git a/sound/altsamw.wav b/sound/altsamw.wav new file mode 100644 index 0000000..ce2b0c1 Binary files /dev/null and b/sound/altsamw.wav differ diff --git a/sound/altsamx.wav b/sound/altsamx.wav new file mode 100644 index 0000000..ecf61aa Binary files /dev/null and b/sound/altsamx.wav differ diff --git a/sound/altsamy.wav b/sound/altsamy.wav new file mode 100644 index 0000000..aaac4cb Binary files /dev/null and b/sound/altsamy.wav differ diff --git a/sound/altsamz.wav b/sound/altsamz.wav new file mode 100644 index 0000000..86b51f3 Binary files /dev/null and b/sound/altsamz.wav differ diff --git a/winbatch/encode-and-play.bat b/winbatch/encode-and-play.bat index face116..af7469a 100755 --- a/winbatch/encode-and-play.bat +++ b/winbatch/encode-and-play.bat @@ -1,6 +1,9 @@ @echo off setlocal +:: Initialize flags +set flags= + :: Ask for the shift value set /p shift="Enter the shift value: " @@ -14,18 +17,34 @@ set /p gsize="Enter the number group size: " :: Ask whether to repeat number groups set /p repeat="Do you want to repeat number groups (y/N)? " +:: Ask whether to use the alt voice +set /p altvoice="Do you want to use the alternate voice (y/N)? " + :: Ask for the message input echo. echo Enter the message to encode and process: set /p input= -:: Pipe the input into nsencode.exe with the shift value, then pipe nsencode.exe's output into numberstation.exe -:: Check user input and apply the -r flag if necessary +:: Check if the user wants to repeat number groups if /i "%repeat%"=="y" ( echo Repeating number groups with the -r flag. - echo %input% | nsencode.exe -s %shift% -g %gsize% | numberstation.exe -r + set flags=%flags% -r ) else ( echo Not repeating number groups. +) + +:: Check if the user wants to use the alt voice +if /i "%altvoice%"=="y" ( + echo Using alternate voice with the -a flag. + set flags=%flags% -a +) else ( + echo Using default voice. +) + +:: Pipe the input into nsencode.exe with the shift value, then pipe nsencode.exe's output into numberstation.exe +if defined flags ( + echo %input% | nsencode.exe -s %shift% -g %gsize% | numberstation.exe %flags% +) else ( echo %input% | nsencode.exe -s %shift% -g %gsize% | numberstation.exe ) diff --git a/winbatch/run-numberstation.bat b/winbatch/run-numberstation.bat index 8ce7400..d6a0b0b 100755 --- a/winbatch/run-numberstation.bat +++ b/winbatch/run-numberstation.bat @@ -4,12 +4,32 @@ setlocal :: Ask whether to repeat number groups set /p repeat="Do you want to repeat number groups (y/N)? " -:: Check user input and apply the -r flag if necessary +:: Ask whether to use the alt voice +set /p altvoice="Do you want to use the alternate voice (y/N)? " + +:: Initialize flags +set flags= + +:: Check if the user wants to repeat number groups if /i "%repeat%"=="y" ( echo Repeating number groups with the -r flag. - numberstation.exe -r + set flags=%flags% -r ) else ( echo Not repeating number groups. +) + +:: Check if the user wants to use the alt voice +if /i "%altvoice%"=="y" ( + echo Using alternate voice with the -a flag. + set flags=%flags% -a +) else ( + echo Using default voice. +) + +:: Run the numberstation.exe with the appropriate flags +if defined flags ( + numberstation.exe %flags% +) else ( numberstation.exe )