All notable changes to fon
will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Support for no-std!
chan::Ch24
, a 24-bit integer channelchan::Channel::to_f32()
pos
module containing types for type-safe channel indexing onFrame
Audio::as_u8_slice()
Audio::silence()
to silence the entire audio bufferAudioSink
public type returned fromAudio::sink()
Audio::with_u8_buffer()
Audio::with_audio()
From<Audio>
for both boxed primitive samples andVec<Frame>
Frame::new()
Frame::pan()
Frame::gain()
SinkTo
struct for converting audio while streamingSink::len()
Sink::sink_with()
Sink::is_empty()
- Renamed
Audio::as_slice()
toAudio::as_mut_slice()
, andAudio::as_slice()
now returns an immutable slice Frame
is now a struct (rather than a trait), and makes use of const generics- Rename
Frame::convert()
toFrame::to()
- Merged
Stream
trait andResampler
struct into a newStream
struct - Changed
Audio
back to being backed by aBox<[Frame]>
Sink
is now object-safe- Sample rates are now represented as
NonZeroU32
chan::Ch8
because 8-bit audio is uncommon today and you can useCh16
for 8-bit audio as well as 12-bit audio.Audio::with_i8_buffer()
chan::Channel::to_f64()
andchan::Channel::from_f64()
Audio::with_frame()
; UseAudio::with_frames(hz, vec![_; len])
insteadAudio::with_stream()
; UseAudio::with_audio()
orAudio::sink()
insteadAudio as IntoIterator
; UseAudio::iter()
instead.Frame::from_f64()
Frame::from_channel()
Frame::from_channels()
Frame::from_mono()
Sink::buffer()
Sink::resampler()
Sink::flush()
Sink::stream()
- Resampler now does proper resampling
Audio
is now stored as aVecDeque<F>
instead of aBox<[F]>
- There are now less cases where a panic will happen.
as_*_slice_mut()
andas_mut_slice()
methods. Allas_slice()
methods now require a mutable reference due to the change toVecDeque<F>
fromBox<[F]>
.
ops::Pan
for panning audio left and right.ops::Blend::mix_frames()
provided method on trait.Audio
now implementsStream
.Audio::as_i8_slice()
Audio::as_i8_slice_mut()
Audio::as_i16_slice()
Audio::as_i16_slice_mut()
Audio::as_f32_slice()
Audio::as_f32_slice_mut()
Audio::as_f64_slice()
Audio::as_f64_slice_mut()
Resampler::frame()
Resampler::index()
Frame::from_f64()
Frame::from_channel()
Frame::from_mono()
Sink::flush()
Stream::blend()
Stream::take()
Stream::set_sample_rate()
Stream::is_empty()
- Rename
Sample
toFrame
to be more consistent with the audio community. - Sample rate on
Audio
is no longer required to be an integer. - Rename
ops::Mix
toops::Plus
- Rename
Audio::sample()
toAudio::get()
- Rename
Audio::sample_mut()
toAudio::get_mut()
- Rename
Audio::samples()
toAudio::as_slice()
- Rename
Audio::samples_mut()
toAudio::as_mut_slice()
- Rename
Audio::with_sample()
toAudio::with_frame()
- Replaced
Audio::with_audio()
withAudio::with_stream()
- Replaced
Audio::with_samples()
withAudio::with_frames()
Audio::drain()
no longer takes any arguments.Audio::extend()
now takes a stream instead of a mutable reference to a stream.Resampler
is now attached to theSink
rather than theStream
.- Rename
Sink::sink()
toSink::stream()
- Required methods on
Sink
andStream
Audio::blend_sample()
Audio::blend_audio()
Audio::copy_silence()
Audio::copy_sample()
Audio::stream()
Sample::blend_sample()
Sample::blend_slice()
Sample::blend_blend()
Stream::stream()
- Almost none of the channel arithmetic working (it all works now and there's unit tests!).
- Buggy resampler
- A lot of other bugs
CONFIG
constant toSample
to define speaker configurations.- Extra generics on
Stream
andSink
allowing them to be used as conversion functions (to convert between different sample formats and speaker configurations).
- No longer does
Sample
requireSealed
meaning you can define custom speaker configurations as needed. - Renamed
surround::Surround5x8
toSurround8
- Renamed
surround::Surround5x16
toSurround16
- Renamed
surround::Surround5x32
toSurround32
- Renamed
surround::Surround5x64
toSurround64
- Renamed
sample::Sample1
tomono::Mono
- Renamed
sample::Sample2
tostereo::Stereo
- Renamed
sample::Sample6
tosurround::Surround
- Moved
Sample
to the crate root (removingsample
module)
sample::Sample4
sample::Sample8
surround::Surround4x8
surround::Surround4x16
surround::Surround4x32
surround::Surround4x64
surround::Surround7x8
surround::Surround7x16
surround::Surround7x32
surround::Surround7x64
- Reimplemented
Sample::convert
to be more accurate.
From<Audio> for Box<[f64]>
implFrom<Audio> for Box<[f32]>
implFrom<Audio> for Box<[i8]>
implFrom<Audio> for Box<[i16]>
implAudio::samples
methodAudio::samples_mut
methodAudio::with_i8_buffer
functionAudio::with_i16_buffer
functionAudio::with_f32_buffer
functionAudio::with_f64_buffer
functionAudio::copy_silence
methodAudio::copy_sample
methodSurround4
andSurround4x{}
aliasesAudio::sample
methodAudio::sample_mut
methodResampler
structStream
traitSink
traitAudio::stream
methodAudio::drain
methodAudio::sink
methodAudio::extend
method
Audio::blend_sample
andAudio::blend_audio
now take an additionalreg
argument to enable blending on part of theAudio
buffer.- Rename
Surround
toSurround5
- Rename
SurroundHD
toSurround7
- Rename
Surround{}
toSurround5x{}
- Rename
SurroundHD{}
toSurround7x{}
- Speaker (channel) configuration order now matches the default on Linux ALSA
From<Audio> for Box<[u8]>
implFrom<Audio> for Box<[u16]>
implAudio::as_u8_slice
methodAudio::as_u8_slice_mut
methodAudio::with_u8_buffer
functionAudio::with_u16_buffer
functionHz
typeConfig
type
- Channel and Sample types not being marked
#[repr(transparent)]
Audio
bufferHz
newtypeConfig
traitmono
,stereo
andsurround
modulesSample1
,Sample2
,Sample6
, andSample8
implementingSample
ops
module withAmplify
,Clear
,Compress
,Dest
,Mix
andSrc
Ch8
,Ch16
,Ch32
andCh64
implementingChannel