MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DecodeWav

Function DecodeWav

tensorflow/go/op/wrappers.go:10736–10753  ·  view source on GitHub ↗

Decode a 16-bit PCM WAV file to a float tensor. The -32768 to 32767 signed 16-bit values will be scaled to -1.0 to 1.0 in float. When desired_channels is set, if the input contains fewer channels than this then the last channel will be duplicated to give the requested number, else if the input has

(scope *Scope, contents tf.Output, optional ...DecodeWavAttr)

Source from the content-addressed store, hash-verified

10734//
10735// Returns 2-D with shape `[length, channels]`.Scalar holding the sample rate found in the WAV header.
10736func DecodeWav(scope *Scope, contents tf.Output, optional ...DecodeWavAttr) (audio tf.Output, sample_rate tf.Output) {
10737 if scope.Err() != nil {
10738 return
10739 }
10740 attrs := map[string]interface{}{}
10741 for _, a := range optional {
10742 a(attrs)
10743 }
10744 opspec := tf.OpSpec{
10745 Type: "DecodeWav",
10746 Input: []tf.Input{
10747 contents,
10748 },
10749 Attrs: attrs,
10750 }
10751 op := scope.AddOperation(opspec)
10752 return op.Output(0), op.Output(1)
10753}
10754
10755// LeakyReluGradAttr is an optional argument to LeakyReluGrad.
10756type LeakyReluGradAttr func(optionalAttr)

Callers 3

TESTFunction · 0.85
TESTFunction · 0.85
WavToSpectrogramFunction · 0.85

Calls 4

aClass · 0.85
ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 3

TESTFunction · 0.68
TESTFunction · 0.68
WavToSpectrogramFunction · 0.68