Skip to content

Commit bc470fd

Browse files
author
Martin Bruse
committed
...
1 parent 2af24ce commit bc470fd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

go/aio/aio.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func Recode(path string, dir string) (string, error) {
8282
return filepath.Rel(dir, flacFile.Name())
8383
}
8484

85-
// Dump stores the audio as a WAV in a temporary directory and returns the path.
85+
// DumpWAV stores the audio as a WAV in a temporary directory and returns the path.
8686
func DumpWAV(audio *audio.Audio) (string, error) {
8787
wavFile, err := os.CreateTemp(os.TempDir(), "zimtohrli.go.aio.DumpWAV.*.wav")
8888
if err != nil {

go/goohrli/goohrli.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,10 @@ func NewViSQOL() *ViSQOL {
202202
// MOS returns the ViSQOL mean opinion score of the degraded samples comapred to the reference samples.
203203
func (v *ViSQOL) MOS(sampleRate float64, reference []float32, degraded []float32) (float64, error) {
204204
result := C.MOS(v.visqol, C.float(sampleRate), (*C.float)(&reference[0]), C.int(len(reference)), (*C.float)(&degraded[0]), C.int(len(degraded)))
205-
if result.Status == 0 {
206-
return float64(result.MOS), nil
207-
} else {
205+
if result.Status != 0 {
208206
return 0, fmt.Errorf("calling ViSQOL returned status %v", result.Status)
209207
}
208+
return float64(result.MOS), nil
210209
}
211210

212211
// AudioMOS returns the ViSQOL mean opinion score of the degraded audio compared to the reference audio.

0 commit comments

Comments
 (0)