Open ghost opened 5 years ago
audio_buffer
Why? People would want proper audio containers where they can properly resize them. At least consider renaming it to audio_buffer_view.
audio_buffer_view
Why? What's so extremely hard with 'view of views' approach? I've done it for my audio library and haven't had any issues.
bool set_sample_rate(sample_rate_t);
They should throw on failure. If you want a no-throw version, provide an error_code& overload.
error_code&
span<sample_rate_t> audio_device::get_supported_sample_rates() const noexcept;
Why span and not vector? This function will need to do dynamic allocation most likely anyway. vector version can take an allocator.
span
vector
bool audio_device::start();
It should return a RAII handle such as std::running_audio_device.
std::running_audio_device
string_view audio_device::name();
Consider removing this for now in favor returning proper Unicode supporting type later.
convert_audio_buffer
It says expects same amount of frames but not same amount of channels.
Update for R2:
get_supported_sample_rates
Was removed so no longer applicable.
The rest stands.
audio_buffer
is just a viewWhy? People would want proper audio containers where they can properly resize them. At least consider renaming it to
audio_buffer_view
.audio_buffer
doesn't work with rangesWhy? What's so extremely hard with 'view of views' approach? I've done it for my audio library and haven't had any issues.
bool set_sample_rate(sample_rate_t);
and others.They should throw on failure. If you want a no-throw version, provide an
error_code&
overload.span<sample_rate_t> audio_device::get_supported_sample_rates() const noexcept;
and othersWhy
span
and notvector
? This function will need to do dynamic allocation most likely anyway.vector
version can take an allocator.bool audio_device::start();
It should return a RAII handle such as
std::running_audio_device
.string_view audio_device::name();
Consider removing this for now in favor returning proper Unicode supporting type later.
convert_audio_buffer
It says expects same amount of frames but not same amount of channels.