Description
This method creates an AudioBuffer object which is compatible with playback on this AudioStream object. The created AudioBuffer object can be then filled with sample data by the caller, and sent for playback by calling the PlayBuffer method, or deleted without being sent for playback by calling the DeleteAudioBuffer method.
Usage
AudioBuffer* CreateAudioBuffer(unsigned int sampleCount, unsigned int achannelCount);
Argument list
- sampleCount [unsigned int]
- The number of samples to allocate in the AudioBuffer per channel
- achannelCount [unsigned int]
- The number of channels to allocate the specified number of samples for in the buffer
Return value
- [AudioBuffer*]
- A pointer to the allocated AudioBuffer object if the creation is successful, nullptr otherwise. Creation of the buffer will fail if the AudioStream has not been successfully opened through a call to the Open method, or if the supplied channel or sample count arguments are set to 0.