cpal/CHANGELOG.md

111 lines
5.2 KiB
Markdown
Raw Normal View History

2020-07-09 04:40:17 +00:00
# Version 0.12.0 (2020-07-09)
2017-10-21 07:25:24 +00:00
- Large refactor removing the blocking EventLoop API.
- Rename many `Format` types to `StreamConfig`:
- `Format` type's `data_type` field renamed to `sample_format`.
- `Shape` -> `StreamConfig` - The configuration input required to build a stream.
- `Format` -> `SupportedStreamConfig` - Describes a single supported stream configuration.
- `SupportedFormat` -> `SupportedStreamConfigRange` - Describes a range of supported configurations.
- `Device::default_input/output_format` -> `Device::default_input/output_config`.
- `Device::supported_input/output_formats` -> `Device::supported_input/output_configs`.
- `Device::SupportedInput/OutputFormats` -> `Device::SupportedInput/OutputConfigs`.
- `SupportedFormatsError` -> `SupportedStreamConfigsError`
- `DefaultFormatError` -> `DefaultStreamConfigError`
- `BuildStreamError::FormatNotSupported` -> `BuildStreamError::StreamConfigNotSupported`
- Address deprecated use of `mem::uninitialized` in WASAPI.
- Removed `UnknownTypeBuffer` in favour of specifying sample type.
- Added `build_input/output_stream_raw` methods allowing for dynamically
handling sample format type.
- Added support for DragonFly platform.
- Add `InputCallbackInfo` and `OutputCallbackInfo` types and update expected
user data callback function signature to provide these.
# Version 0.11.0 (2019-12-11)
- Fix some underruns that could occur in ALSA.
- Add name to `HostId`.
- Use `snd_pcm_hw_params_set_buffer_time_near` rather than `set_buffer_time_max`
in ALSA backend.
- Remove many uses of `std::mem::uninitialized`.
- Fix WASAPI capture logic.
- Panic on stream ID overflow rather than returning an error.
- Use `ringbuffer` crate in feedback example.
- Move errors into a separate module.
- Switch from `failure` to `thiserror` for error handling.
- Add `winbase` winapi feature to solve windows compile error issues.
- Lots of CI improvements.
# Version 0.10.0 (2019-07-05)
- core-foundation-sys and coreaudio-rs version bumps.
- Add an ASIO host, available under Windows.
- Introduce a new Host API, adding support for alternative audio APIs.
- Remove sleep loop on macOS in favour of using a `Condvar`.
- Allow users to handle stream callback errors with a new `StreamEvent` type.
- Overhaul error handling throughout the crate.
- Remove unnecessary Mutex from ALSA and WASAPI backends in favour of channels.
- Remove `panic!` from OutputBuffer Deref impl as it is no longer necessary.
# Version 0.9.0 (2019-06-06)
- Better buffer handling
- Fix logic error in frame/sample size
- Added error handling for unknown ALSA device errors
- Fix resuming a paused stream on Windows (wasapi).
- Implement `default_output_format` for emscripten backend.
# Version 0.8.1 (2018-03-18)
- Fix the handling of non-default sample rates for coreaudio input streams.
# Version 0.8.0 (2018-02-15)
Update to a more general Device and Stream API. Add support for input streams (E.g. microphone). Add default format methods. (#201) * Update to a more general Device and Stream API This update prepares for adding input stream support by removing the `Endpoint` type (which only supports output streams) in favour of a more general `Device` type which may support any number of input or output streams. Previously discussed at #117. The name `Voice` has been replaced with the more ubiquitous name `Stream`. See #118 for justification. Also introduces a new `StreamData` which is now passed to the `EventLoop::run` callback rather than the `UnknownTypeBuffer`. `StreamData` allows for passing either `Input` data to be read, or `Output` data to be written. The `beep.rs` example has been updated for the API changes. None of the backends have been updated for this API change yet. Backends will be updated in the following commits. Closes #117. Closes #118. * Update ALSA backend for new `Device` and `Stream` API. * Update wasapi backend for new `Device` and `Stream` API. * Update enumerate.rs example for new `Device` and `Stream` API. * Update coreaudio backend for new `Device` and `Stream` API. * Fix lib doc tests for Device and Stream API update * Update emscripten backend for new `Device` and `Stream` API. * Update null backend for new `Device` and `Stream` API. * Merge match exprs in beep.rs example * Add Input variant along with UnknownTypeInputBuffer and InputBuffer UnknownTypeBuffer and Buffer have been renamed to UnknownTypeOutputBuffer and OutputBuffer respectively. No backends have yet been updated for this name change or the addition of the InputBuffer. * Update null backend for introduction of InputBuffer * Update emscripten backend for introduction of InputBuffer * Make InputBuffer inner field an option to call finish in drop * Update alsa backend for introduction of InputBuffer * Update wasapi backend for introduction of InputBuffer * Update coreaudio backend for introduction of InputBuffer * Update enumerate.rs example to provide more detail about devices The enumerate.rs example now also displays: - Supported input stream formats. - Default input stream format. - Default output stream format. This should also be useful for testing the progress of #201. * Add `record_wav.rs` example for demonstrating input streams Records a ~3 second WAV file to `$CARGO_MANIFEST_DIR/recorded.wav` using the default input device and default input format. Uses hound 3.0 to create and write to the WAV file. This should also be useful for testing the input stream implementations for each different cpal backend. * Implement input stream support for coreaudio backend This implements the following for the coreaudio backend: - Device::supported_input_formats - Device::default_input_format - Device::default_output_format - EventLoop::build_input_stream The `enumerate.rs` and `record_wav.rs` examples now work successfully on macos. * Add `SupportedFormat::cmp_default_heuristics` method This adds a comparison function which compares two `SupportedFormat`s in terms of their priority of use as a default stream format. Some backends (such as ALSA) do not provide a default stream format for their audio devices. In these cases, CPAL attempts to decide on a reasonable default format for the user. To do this we use the "greatest" of all supported stream formats when compared with this method. * Implement input stream support for ALSA backend This implements the following for the ALSA backend: - Device::supported_input_formats - Device::default_input_format - Device::default_output_format - EventLoop::build_input_stream Note that ALSA itself does not give default stream formats for its devices. Thus the newly added `SupportedFormat::cmp_default_heuristics` method is used to determine the most suitable, supported stream format to use as the default. The `enumerate.rs` and `record_wav.rs` examples now work successfully on my linux machine. * Implement input stream support for wasapi backend This implements the following for the wasapi backend: - Device::supported_input_formats - Device::default_input_format - Device::default_output_format - EventLoop::build_input_stream Note that wasapi does not enumerate supported input/output stream formats for its devices. Instead, we query the `IsFormatSupported` method for supported formats ourselves. * Fix some warnings in the alsa backend * Update CHANGELOG for introduction of input streams and related items * Update README to show latest features supported by CPAL * Simplify beep example using Device::default_output_format * Remove old commented code from wasapi/stream.rs
2018-02-12 13:10:24 +00:00
- Add `record_wav.rs` example. Records 3 seconds to
`$CARGO_MANIFEST_DIR/recorded.wav` using default input device.
- Update `enumerate.rs` example to display default input/output devices and
formats.
- Add input stream support to coreaudio, alsa and windows backends.
- Introduce `StreamData` type for handling either input or output streams in
`EventLoop::run` callback.
- Add `Device::supported_{input/output}_formats` methods.
- Add `Device::default_{input/output}_format` methods.
- Add `default_{input/output}_device` functions.
- Replace usage of `Voice` with `Stream` throughout the crate.
- Remove `Endpoint` in favour of `Device` for supporting both input and output
streams.
2018-02-04 12:03:03 +00:00
# Version 0.7.0 (2018-02-04)
- Rename `ChannelsCount` to `ChannelCount`.
- Rename `SamplesRate` to `SampleRate`.
- Rename the `min_samples_rate` field of `SupportedFormat` to `min_sample_rate`
- Rename the `with_max_samples_rate()` method of`SupportedFormat` to `with_max_sample_rate()`
- Rename the `samples_rate` field of `Format` to `sample_rate`
- Changed the type of the `channels` field of the `SupportedFormat` struct from `Vec<ChannelPosition>` to `ChannelCount` (an alias to `u16`)
- Remove unused ChannelPosition API.
- Implement `Endpoint` and `Format` Enumeration for macos.
2018-01-24 10:34:18 +00:00
- Implement format handling for macos `build_voice` method.
# Version 0.6.0 (2017-12-11)
- Changed the emscripten backend to consume less CPU.
- Added improvements to the crate documentation.
- Implement `pause` and `play` for ALSA backend.
- Reduced the number of allocations in the CoreAudio backend.
- Fixes for macos build (#186, #189).
# Version 0.5.1 (2017-10-21)
- Added `Sample::to_i16()`, `Sample::to_u16()` and `Sample::from`.
2017-10-21 07:25:24 +00:00
# Version 0.5.0 (2017-10-21)
- Removed the dependency on the `futures` library.
- Removed the `Voice` and `SamplesStream` types.
- Added `EventLoop::build_voice`, `EventLoop::destroy_voice`, `EventLoop::play`,
and `EventLoop::pause` that can be used to create, destroy, play and pause voices.
- Added a `VoiceId` struct that is now used to identify a voice owned by an `EventLoop`.
- Changed `EventLoop::run()` to take a callback that is called whenever a voice requires sound data.
2017-10-20 19:18:40 +00:00
- Changed `supported_formats()` to produce a list of `SupportedFormat` instead of `Format`. A
`SupportedFormat` must then be turned into a `Format` in order to build a voice.