Std.Audio
24 public declarations
- append
&Std.Audio.Pcm -> &Std.Audio.Pcm -> Result[Std.Audio.Pcm, Std.Audio.AudioError]One stream followed by another of the same format.
- AudioError
Why audio could not be built, transformed, encoded, or decoded.
- decodeWav
&Bytes -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Audio from a 16-bit PCM WAV document, within the default sample budget.
- decodeWavWithin
&Bytes -> Int -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Audio from a 16-bit PCM WAV document holding at most `maxSamples` samples.
- downmix
&Std.Audio.Pcm -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Mono audio averaging every channel of each frame, rounded half away from zero.
- encodeWav
&Std.Audio.Pcm -> Result[Bytes, Std.Audio.AudioError]A canonical 16-bit PCM WAV document.
- format
Int -> Int -> Result[Std.Audio.Format, Std.Audio.AudioError]A format with a sample rate from 8,000 to 384,000 and one to eight channels.
- Format
The shape of a PCM stream: frames per second and samples per frame.
- frameCount
&Std.Audio.Pcm -> IntHow many frames audio holds.
- framesAt
&Std.Audio.Format -> Int -> Int -> Result[Int, Std.Audio.AudioError]The frame at a time given in seconds as a fraction, rounded down.
- fromSamples
&Std.Audio.Format -> Array[Int] -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Audio from interleaved samples, refusing a partial frame or a sample that
- gain
&Std.Audio.Pcm -> Int -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Audio scaled by a Q15 gain, where 32,768 is unity.
- mix
&Std.Audio.Pcm -> &Std.Audio.Pcm -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Two streams summed sample by sample, saturating to 16 bits.
- Pcm
Interleaved signed 16-bit PCM held as its little-endian bytes.
- remap
&Std.Audio.Pcm -> &Array[Int] -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Audio whose channel `k` is the source's channel `order[k]`, so channels are
- resample
&Std.Audio.Pcm -> Int -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Audio at another sample rate by linear interpolation in exact arithmetic.
- sampleAt
&Std.Audio.Pcm -> Int -> Int -> Option[Int]One sample, or nothing outside the audio.
- samples
&Std.Audio.Pcm -> Array[Int]The interleaved samples of audio, one integer per sample.
- seconds
&Std.Audio.Format -> Int -> Result[Std.Audio.Seconds, Std.Audio.AudioError]The exact duration of a number of frames, as a reduced fraction of a second.
- Seconds
A duration in seconds as a reduced fraction.
- silence
&Std.Audio.Format -> Int -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Silent audio of a whole number of frames.
- slice
&Std.Audio.Pcm -> Int -> Int -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Exactly `frames` frames starting at `start`, silent past the end.
- upmix
&Std.Audio.Pcm -> Int -> Result[Std.Audio.Pcm, Std.Audio.AudioError]Mono audio copied into every channel of a wider format.
- WavProblem
What was wrong with a WAV document's structure.
