-
-
Save bravecorvus/80dc43d97475024ac2c9c9bfa1f3a37e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mfcc := exec.Command("mfcc.sh", "/output/"+fileheader.Filename+".raw", strconv.Itoa(frameLength), strconv.Itoa(frameLengthOutput), strconv.Itoa(framePeriod), strconv.Itoa(mgcOrder)) | |
mfccout, mfccerr := mfcc.Output() | |
if mfccerr != nil { | |
log.Println("Error executing mfcc.sh") | |
log.Println("error:", mfccerr) | |
http.Error(w, http.StatusText(404)+": "+mfccerr.Error(), 404) | |
return | |
} | |
arr := make([]float64, 0) | |
buf := bytes.NewReader(mfccout) | |
readerr := binary.Read(buf, binary.LittleEndian, &arr) | |
if readerr != nil { | |
log.Println("binary.Read failed:", readerr) | |
http.Error(w, http.StatusText(404)+": "+readerr.Error(), 404) | |
} | |
log.Println("Print arr") | |
str := "[" | |
for index, elem := range arr { | |
if index == len(arr)-1 { | |
str = str + strconv.FormatFloat(elem, 'f', 6, 64) | |
} else { | |
str = str + strconv.FormatFloat(elem, 'f', 6, 64) | |
} | |
log.Println(elem) | |
} | |
str = str + "]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment