37 return (micros * this->
SampleRate()) / 1000000;
44 return (samples * 1000000) / this->
SampleRate();
Declaration of the AudioSource class.
std::string path
The file-path of this AudioSource's audio file.
virtual const std::string & Path() const
Gets the file-path of this audio source's audio file.
virtual std::uint8_t ChannelCount() const =0
Returns the channel count.
virtual std::uint64_t SamplesFromMicros(std::uint64_t micros) const
Converts a position in microseconds to an elapsed sample count.
virtual SampleFormat OutputSampleFormat() const =0
Returns the output sample format.
std::uint64_t MicrosFromSamples(std::uint64_t samples) const
Converts an elapsed sample count to a position in microseconds.
AudioSource(const std::string &path)
Constructs an AudioSource.
virtual size_t BytesPerSample() const
Returns the number of bytes for each sample this decoder outputs.
virtual std::uint32_t SampleRate() const =0
Returns the sample rate.