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)
| 10734 | // |
| 10735 | // Returns 2-D with shape `[length, channels]`.Scalar holding the sample rate found in the WAV header. |
| 10736 | func 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. |
| 10756 | type LeakyReluGradAttr func(optionalAttr) |