View Source NxAudio.IO.BackendSaveConfig (nx_audio v0.2.0)
Defines how the backend should save the audio tensor.
Summary
Types
:sample_rate
(non_neg_integer/0
) - Required. Which sampling rate to use when writing the file
Functions
Parses and validate a keyword list into a valid audio backend config
Types
@type t() :: [ sample_rate: non_neg_integer(), channels_first: boolean(), format: term(), encoding: term(), buffer_size: integer(), backend: term() ]
:sample_rate
(non_neg_integer/0
) - Required. Which sampling rate to use when writing the file:channels_first
(boolean/0
) - If true, the given tensor is interpreted as [channel, time], otherwise [time, channel] The default value istrue
.:format
- Override the audio format. When uri argument is path-like object, audio format is inferred from file extension. If the file extension is missing or different, you can specify the correct format with this argument. When uri argument is file-like object, this argument is required.:encoding
- Changes the encoding for supported formats. This argument is effective only for supported formats, i.e. "wav" and "flac":buffer_size
(integer/0
) - Size of buffer to use when processing file-like objects, in bytes. The default value is4096
.:backend
- Backend to use for reading audio files The default value is:ffmpeg
.
Functions
@spec validate(backend_options :: Keyword.t()) :: {:ok, t()} | {:error, NxAudio.IO.Errors.InvalidBackendConfigurations.t()}
Parses and validate a keyword list into a valid audio backend config