Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
StreamBuffer Class Reference

This sound creates a buffer out of a reader. More...

#include <StreamBuffer.h>

Inheritance diagram for StreamBuffer:
Inheritance graph
[legend]

Public Member Functions

 StreamBuffer (std::shared_ptr< ISound > sound)
 Creates the sound and reads the reader created by the sound supplied to the buffer.
 
 StreamBuffer (std::shared_ptr< Buffer > buffer, Specs specs)
 Creates the sound from an preexisting buffer.
 
std::shared_ptr< BuffergetBuffer ()
 Returns the buffer to be streamed.
 
Specs getSpecs ()
 Returns the specification of the buffer.
 
virtual std::shared_ptr< IReadercreateReader ()
 Creates a reader for playback of the sound source.
 
- Public Member Functions inherited from ISound
virtual ~ISound ()
 Destroys the sound.
 

Detailed Description

This sound creates a buffer out of a reader.

This way normally streamed sound sources can be loaded into memory for buffered playback.

Constructor & Destructor Documentation

◆ StreamBuffer() [1/2]

StreamBuffer::StreamBuffer ( std::shared_ptr< ISound > sound)

Creates the sound and reads the reader created by the sound supplied to the buffer.

Parameters
soundThe sound that creates the reader for buffering.
Exceptions
ExceptionThrown if the reader cannot be created.

◆ StreamBuffer() [2/2]

StreamBuffer::StreamBuffer ( std::shared_ptr< Buffer > buffer,
Specs specs )

Creates the sound from an preexisting buffer.

Parameters
bufferThe buffer to stream from.
specsThe specification of the data in the buffer.
Exceptions
ExceptionThrown if the reader cannot be created.

Member Function Documentation

◆ createReader()

virtual std::shared_ptr< IReader > StreamBuffer::createReader ( )
virtual

Creates a reader for playback of the sound source.

Returns
A pointer to an IReader object or nullptr if there has been an error.
Exceptions
ExceptionAn exception may be thrown if there has been a more unexpected error during reader creation.

Implements ISound.

◆ getBuffer()

std::shared_ptr< Buffer > StreamBuffer::getBuffer ( )

Returns the buffer to be streamed.

Returns
The buffer to stream.

◆ getSpecs()

Specs StreamBuffer::getSpecs ( )

Returns the specification of the buffer.

Returns
The specification of the buffer.

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