testaudio

package
v0.11.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testaudio holds what the integration tests share to read audio and score a transcript: a WAVE reader, the word normalization and the word error rate. Only _test.go files import it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadWAV

func ReadWAV(t *testing.T, dir, name string) ([]float32, int)

ReadWAV reads the 16-bit PCM mono WAVE file dir/name as float samples and its rate.

func WordErrorRate

func WordErrorRate(ref, hyp string) float64

WordErrorRate is WordErrors of the words of ref and hyp over the number of words of ref.

func WordErrors

func WordErrors(ref, hyp []string) int

WordErrors is the word-level edit distance between ref and hyp.

func Words

func Words(text string) []string

Words normalizes text to lower-case words without punctuation.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL