MOS
Public Member Functions | Static Public Attributes | List of all members
mos::aud::Stream Class Referencefinal

Audio streaming from *.ogg file. More...

#include <stream.hpp>

Public Member Functions

 Stream (const std::string &path)
 
 Stream (const Stream &stream)=default
 
 Stream (Stream &&stream)=default
 
Streamoperator= (const Stream &stream)=default
 
Streamoperator= (Stream &&stream)=default
 
auto read () -> std::array< short, buffer_size >
 Read a chunk of data from the stream. More...
 
auto done () const -> bool
 Check if stream reached the end. More...
 
auto sample_rate () const -> unsigned int
 Sample rate, eg 44100.
 
auto channels () const -> unsigned int
 Get number of channels. More...
 
auto duration () const -> float
 Duration in seconds. More...
 
auto size () const -> size_t
 Size of stream in samples. More...
 
auto seek_start () -> void
 Restart streaming. More...
 
auto id () const -> unsigned int
 Unique id. More...
 

Static Public Attributes

static const int buffer_size = 4096 * 8
 

Detailed Description

Audio streaming from *.ogg file.

Member Function Documentation

◆ channels()

auto mos::aud::Stream::channels ( ) const -> unsigned int

Get number of channels.

◆ done()

auto mos::aud::Stream::done ( ) const -> bool

Check if stream reached the end.

◆ duration()

auto mos::aud::Stream::duration ( ) const -> float

Duration in seconds.

◆ id()

auto mos::aud::Stream::id ( ) const -> unsigned int

Unique id.

◆ read()

auto mos::aud::Stream::read ( ) -> std::array< short, buffer_size >

Read a chunk of data from the stream.

◆ seek_start()

auto mos::aud::Stream::seek_start ( ) -> void

Restart streaming.

◆ size()

auto mos::aud::Stream::size ( ) const -> size_t

Size of stream in samples.


The documentation for this class was generated from the following file: