class StreamConverter

Defined at line 13 of file ../../src/media/audio/lib/format2/stream_converter.h

Converts a stream of audio samples from a source sample format to a destination sample format.

Public Methods

const Format & source_format ()

Defined at line 34 of file ../../src/media/audio/lib/format2/stream_converter.h

const Format & dest_format ()

Defined at line 35 of file ../../src/media/audio/lib/format2/stream_converter.h

void StreamConverter (const Format & source_format, const Format & dest_format)

Creates a new `StreamConverter` for the given `source_format` and `dest_format`.

Required: `source_format` and `dest_format` must have matching frame rates and channel counts.

Defined at line 147 of file ../../src/media/audio/lib/format2/stream_converter.cc

StreamConverter CreateFromFloatSource (const Format & dest_format)

Creates a new `StreamConverter` with the assumption that the source sample type is `float`.

TODO(https://fxbug.dev/42066206): remove when old audio_core code is gone

Defined at line 155 of file ../../src/media/audio/lib/format2/stream_converter.cc

void Copy (const void * source_samples, void * dest_samples, int64_t frame_count)

Converts `frame_count` frames in `source_samples` from the source format into the destination

format, then writes the converted samples into `dest_samples`.

Defined at line 164 of file ../../src/media/audio/lib/format2/stream_converter.cc

void CopyAndClip (const void * source_samples, void * dest_samples, int64_t frame_count)

Like `Copy`, but also clips the output when the destination format uses floating point samples.

Defined at line 174 of file ../../src/media/audio/lib/format2/stream_converter.cc

void WriteSilence (void * dest_samples, int64_t frame_count)

Writes `frame_count` silent frames to `dest_samples`.

Defined at line 184 of file ../../src/media/audio/lib/format2/stream_converter.cc