MPMA Framework 0.4
|
Represents a source of sound sample data. More...
#include <Source.h>
Public Member Functions | |
virtual nuint | FillData (void *data, nuint maxSamples)=0 |
Instructs the data source to write in the next maxSamples worth of data. It should return how many samples were actually written. If less samples than requested were returned and GetRemainingSamples still returns that there is data left, this may be called multiple times consecutively. All sound samples must be 16-bit signed values. Stereo samples must be interleaved, with the left channel first. | |
virtual nuint | GetRemainingSamples () const =0 |
This must return the number of samples left to be read, or 0 if all data has been read. For stereo sources, a single sample includes both left and right channel data. It may also return FINITE_DATA or INFINITE_DATA. | |
virtual bool | IsStereo () const =0 |
Returns whether the sound is stereo. Stereo sources will have their output collpased to mono if they are used with 3D positioning. The value returned from this must remain constant for any given instance. | |
virtual nuint | GetSampleRate () const =0 |
Returns the number of samples per second that should be played under normal conditions. The value returned from this must remain constant for any given instance. | |
virtual void | Seek (nuint sampleNumber=0) |
Tells the data source to start returning samples from a specific position (not applicable to all sources). | |
nuint | GetSampleSize () const |
Returns the size of a single sample. Currently this will always be either 2 for mono or 4 for stereo, since all samples must be 16-bit. |
Represents a source of sound sample data.