eDSP
0.0.1
A cross-platform DSP library written in C++.
|
This class implements a decoder object to read data from supported audio files. More...
#include <decoder.hpp>
Public Types | |
using | index_type = std::ptrdiff_t |
using | value_type = T |
Public Member Functions | |
decoder ()=default | |
~decoder ()=default | |
bool | open (const edsp::string_view &file_path) |
Opens an audio file. More... | |
void | close () |
Closes the audio file. More... | |
bool | is_open () const noexcept |
Checks if the there is an audio file opened. More... | |
index_type | samples () const noexcept |
Returns the number of samples in the audio file. More... | |
index_type | frames () const noexcept |
index_type | channels () const noexcept |
Returns the number of channels in the audio file. More... | |
double | duration () const noexcept |
Returns the duration of the audio file in seconds. More... | |
double | samplerate () const noexcept |
Returns the sampling rate of the audio file in Hz. More... | |
bool | seekable () const noexcept |
Checks if the audio file is seekable. More... | |
index_type | seek (index_type position) noexcept |
Updates the current frame position for a track in an audio file. More... | |
index_type | current () const noexcept |
Returns the current frame position of the track in an audio file. More... | |
template<typename OutputIt > | |
index_type | read (OutputIt d_first, OutputIt d_last) |
Attempts to read data from the audio file and stores the results in the range [first, last) More... | |
This class implements a decoder object to read data from supported audio files.
T | Value Type |
N | Size of the internal buffer. |
using edsp::io::decoder< T, N >::index_type = std::ptrdiff_t |
using edsp::io::decoder< T, N >::value_type = T |
|
explicitdefault |
|
default |
|
inlinenoexcept |
Returns the number of channels in the audio file.
The number of channels is a positive integer which specifies the number of interleaved audio channels in the given audio track.
|
inline |
Closes the audio file.
|
inlinenoexcept |
Returns the current frame position of the track in an audio file.
|
inlinenoexcept |
Returns the duration of the audio file in seconds.
|
inlinenoexcept |
|
inlinenoexcept |
Checks if the there is an audio file opened.
|
inline |
Opens an audio file.
file_path | Path to the file to be opened. |
|
inline |
Attempts to read data from the audio file and stores the results in the range [first, last)
The function will try to read up to N samples, where N is the size of the range [first, last).
d_first | Output iterator defining the beginning of the output range. |
d_last | Output iterator defining the ending of the output range. |
|
inlinenoexcept |
Returns the sampling rate of the audio file in Hz.
|
inlinenoexcept |
Returns the number of samples in the audio file.
|
inlinenoexcept |
Updates the current frame position for a track in an audio file.
position | Frame position in the audio track. |
|
inlinenoexcept |
Checks if the audio file is seekable.