"Audio" (Net Encoder)

NetEncoder["Audio"]

represents an encoder that converts an audio file or object into a tensor of audio samples.

NetEncoder[{"Audio","param"->val,}]

represents an encoder with specific parameters for preprocessing.

Details

  • NetEncoder[][input] applies the encoder to an input to produce an output.
  • NetEncoder[][{input1,input2,}] applies the encoder to a list of inputs to produce a list of outputs.
  • The input to the encoder can be an Audio object or a File[] expression.
  • The output of the encoder is a matrix of size n×1, where n is the number of audio samples after the preprocessing is applied.
  • An encoder can be attached to an input port of a net by specifying "port"->NetEncoder[] when constructing the net.
  • Parameters
  • The following parameters are supported:
  • "Normalization"Nonewhether to apply normalization
    "SampleRate"16000target sample rate
    "TargetLength"Alltarget output length
  • With the parameter "Normalization"None, no normalization is applied.
  • With the parameter "Normalization"Automatic, the signal is normalized to the maximum absolute value.
  • With the parameter "TargetLength"->All, the output of the encoder includes all available audio samples from the input audio.
  • With the parameter "TargetLength"->n, the output of the encoder will be the first n audio samples from the input audio, with zero padding applied if n is larger than the number of audio samples.

Examples

open allclose all

Basic Examples  (1)

Create an audio NetEncoder:

In[1]:=
Click for copyable input
Out[1]=

Create an Audio object with three samples:

In[2]:=
Click for copyable input
Out[2]=

Apply the encoder to the Audio object:

In[3]:=
Click for copyable input
Out[3]=

Scope  (3)

Parameters  (3)

Possible Issues  (1)

See Also

NetEncoder  Audio  AudioData  AudioResample  ConformAudio  NetChain  NetGraph  NetTrain

Tutorials

Related NetEncoders