feat: reimplement WAV extraction in Go (replaces extract_wavs.sh)

extract.go replaces the bash script with idiomatic Go:
- akaiutil process communication via stdin/stdout pipes
- partition enumeration (df output parsing)
- volume enumeration (dir output parsing per partition)
- sample2wavall per volume with WAV count aggregation

runAkaiutil is a package-level var — tests stub it with canned
output to verify parsing without a real akaiutil binary or ISO.

Removed: findScript(), -tool flag on extract, os/exec from main.go
Kept: extract_wavs.sh as a standalone utility (no longer called)
This commit is contained in:
2026-06-21 22:17:24 -07:00
parent bc12130dd6
commit ea2bcde74b
4 changed files with 323 additions and 75 deletions
+1 -3
View File
@@ -289,8 +289,6 @@ func handleAPIExtract(w http.ResponseWriter, r *http.Request) {
os.MkdirAll(outDir, 0755)
toolPath := findScript("extract_wavs.sh")
entries, err := os.ReadDir(isoDir)
if err != nil {
writeJSON(w, map[string]any{"error": err.Error()})
@@ -311,7 +309,7 @@ func handleAPIExtract(w http.ResponseWriter, r *http.Request) {
var messages []string
for _, isoPath := range isos {
result, err := extractISO(toolPath, isoPath, outDir)
result, err := extractISO(isoPath, outDir)
if err != nil {
messages = append(messages, fmt.Sprintf("FAIL %s: %v", filepath.Base(isoPath), err))
} else {