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

The File sound tries to read a sound file via all available file inputs that have been registered in the FileManager class. More...

#include <File.h>

Inheritance diagram for File:
Inheritance graph
[legend]

Public Member Functions

 File (std::string filename, int stream=0)
 Creates a new sound.
 
 File (const data_t *buffer, int size, int stream=0)
 Creates a new sound.
 
std::vector< StreamInfoqueryStreams ()
 Queries the streams of the file.
 
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.
 
virtual std::shared_ptr< IReadercreateReader ()=0
 Creates a reader for playback of the sound source.
 

Detailed Description

The File sound tries to read a sound file via all available file inputs that have been registered in the FileManager class.

Constructor & Destructor Documentation

◆ File() [1/2]

File::File ( std::string  filename,
int  stream = 0 
)

Creates a new sound.

The file is read from the file system using the given path.

Parameters
filenameThe sound file path.
streamThe index of the audio stream within the file if it contains multiple audio streams.

◆ File() [2/2]

File::File ( const data_t buffer,
int  size,
int  stream = 0 
)

Creates a new sound.

The file is read from memory using the supplied buffer.

Parameters
bufferThe buffer to read from.
sizeThe size of the buffer.
streamThe index of the audio stream within the file if it contains multiple audio streams.

Member Function Documentation

◆ createReader()

virtual std::shared_ptr< IReader > File::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.

◆ queryStreams()

std::vector< StreamInfo > File::queryStreams ( )

Queries the streams of the file.

Returns
A vector with as many streams as there are in the file.
Exceptions
ExceptionThrown if the file specified cannot be read.

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