Interface for custom audio stream (data source). Supports streaming data of indefinite length. The API is in terms of samples, they are converted to frames by the library.
More...
#include <capo/stream.hpp>
Interface for custom audio stream (data source). Supports streaming data of indefinite length. The API is in terms of samples, they are converted to frames by the library.
◆ get_channels()
virtual auto capo::IStream::get_channels |
( |
| ) |
const -> std::uint8_t |
|
pure virtual |
Must return positive value.
◆ get_cursor()
virtual auto capo::IStream::get_cursor |
( |
| ) |
const -> std::optional<std::size_t> |
|
inlinevirtual |
- Returns
- nullopt if not supported.
◆ get_sample_count()
virtual auto capo::IStream::get_sample_count |
( |
| ) |
const -> std::size_t |
|
inlinevirtual |
- Returns
- 0 if not supported.
◆ get_sample_rate()
virtual auto capo::IStream::get_sample_rate |
( |
| ) |
const -> std::uint32_t |
|
pure virtual |
Must return positive value.
◆ read_samples()
virtual auto capo::IStream::read_samples |
( |
std::span< float > |
out | ) |
-> std::size_t |
|
pure virtual |
- Returns
- Count of samples read, 0 if at end.
◆ seek_to_sample()
virtual auto capo::IStream::seek_to_sample |
( |
std::size_t |
index | ) |
-> bool |
|
inlinevirtual |
- Parameters
-
index | Sample index to seek to. |
- Returns
- false if seeking is not supported.
◆ set_looping()
virtual auto capo::IStream::set_looping |
( |
bool |
looping | ) |
-> bool |
|
inlinevirtual |
Handle custom looping behavior, if applicable. Just return true / don't override for the bound Audio Source to use its own looping mechanism.
- Returns
- false if looping is not possible.
The documentation for this class was generated from the following file: