Crate rustwav

Source

Modules§

audioutils
chunks
WAV chunks
decoders
The decoders for the WaveReader, each of these provides the same API for it to use. You can use it too.
downmixer
encoders
The encoders for the WaveWriter, each of these provides the same API for it to use. You can use it too.
errors
Errors returned from most of the function in this library.
format_specs
WAV file format specs
io_utils
iterators
Iterators for WaveReader to decode audio samples.
options
Encoder creation options
resampler
utils
Misc utilities

Structs§

WaveReader
The WaveReader is dedicated to reading a WAV file and provides you with samples as you want. Usage:Open a WAV fileGet the iteratorThe iterator excretes the PCM samples with the format you specified.
WaveWriter
The WaveWriter is dedicated to creating a WAV file. Usage:Choose one of the internal formats by specifying DataFormat and use the WaveWriter to create the WAV file.Use the methods, like write_samples(), write_mono_channel(), write_monos(), write_stereos(), etc, to write your PCM samples to the WaveWriter, it will encode.Call finalize() or just let the WaveWriter get out of the scope.
i24
The tuple struct is little-endian
u24
The tuple struct is little-endian

Enums§

WaveDataSource
The data source for the WaveReader, currently we have a file reader or a file path.

Constants§

FORMATS
The list for the command line program to parse the argument and we have the pre-filled encoder initializer parameter structs for each format.

Traits§

SampleFrom
The SampleFrom as a utility for SampleType to handle function overloading
SampleType
The SampleType for audio processing.The to_*() methods are for scaling the sample to the another format.The as_*() methods are for casting the sample to the another format.

Functions§

test
The test() functionarg1: the format, e.g. “pcm”arg2: the input file to parse and decode, tests the decoder for the input file.arg3: the output file to encode, test the encoder.arg4: re-decode arg3 and encode to pcm to test the decoder.
test_wav
A function dedicated to testing WAV encoding and decoding. This function is actually a main() function for a command-line program that parses args and returns an ExitCode.The usage is arg0 [format] [test.wav] [output.wav]It decodes the test.wav and encodes it to output.wav by formatThen it re-decode output.wav to output2.wavThis can test both encoders and decoders with the specified format to see if they behave as they should.
transfer_audio_from_decoder_to_encoder
Transfer audio from the decoder to the encoder with resampling.This allows to transfer of audio from the decoder to a different sample rate encoder.