Documentation
¶
Overview ¶
Package libaural2 provides libs share betwene edge, server and browser.
Index ¶
Constants ¶
const AudioClipLen int = SamplePerClip * 2
AudioClipLen is the number of bytes in one audio clip
const BatchSize int = 7
BatchSize is the size of the one batch
const Duration int = 10
Duration of audio clip in seconds
const InputSize int = 13
InputSize is the length of the input vector, currently one MFCC
const SamplePerClip int = SampleRate * Duration
SamplePerClip is the number of samples in each clip
const SampleRate int = 16000
SampleRate of audio
const SeqLen int = 100
SeqLen is the length of sequences to be feed to the LSTM for training.
const StrideWidth int = 512
StrideWidth is the number of samples in one stride
const StridesPerClip int = SamplePerClip / StrideWidth
StridesPerClip is the number of strides per clip
Variables ¶
This section is empty.
Functions ¶
func GenFakeInput ¶
func GenFakeInput(cmds [StridesPerClip]int32) (fakeMFCCs [][]float32)
GenFakeInput produces fake a mfcc list exactly matching the given cmdIdArray
Types ¶
type AudioClip ¶
type AudioClip [AudioClipLen]byte
AudioClip stores a `Duration` second clip of int16 raw audio
type ClipID ¶
type ClipID [32]byte
ClipID is the hash of a clip of raw audio
func (ClipID) FSsafeString ¶
FSsafeString returns an encoding of the ClipID safe for filesystems and URLs.
type Label ¶
type Label struct { State State Start float64 // the duration since the start of the clip. End float64 }
Label is one period of time.
type LabelSet ¶
LabelSet is the set of labels for one Clip
func DeserializeLabelSet ¶
DeserializeLabelSet converts a []byte back into a LabelSet.
func GenFakeLabelSet ¶
func GenFakeLabelSet() (output LabelSet)
GenFakeLabelSet creates a fake LabelSet for testing.
func (*LabelSet) IsGood ¶
IsGood returns true iff the labelsSet contains no overlaps or other bad things. Executes in O(n2) time.
func (*LabelSet) ToStateArray ¶
func (labels *LabelSet) ToStateArray() (stateArray [StridesPerClip]State)
ToStateArray converts the labelSet to a slice of States
func (*LabelSet) ToStateIDArray ¶
func (labels *LabelSet) ToStateIDArray() (stateArray [StridesPerClip]int32)
ToStateIDArray converts the labelSet to a slice of State IDs
type OutputSet ¶
type OutputSet [StridesPerClip]Output
OutputSet is the set of outputs for one clip.