StereoSample Class(QAudioBuffer::StereoSample)The StereoSample class provides a simple wrapper for a stereo audio sample. More... #include <QAudioBuffer>
Public Functions
Public Variables
Related Non-Members
Detailed DescriptionThe StereoSample class provides a simple wrapper for a stereo audio sample. This templatized structure lets you treat a block of individual samples as an interleaved stereo stream. This is most useful when used with the templatized data() functions of QAudioBuffer. Generally the data is accessed as a pointer, so no copying should occur. There are some predefined instantiations of this template for working with common stereo sample depths in a convenient way. This structure has left and right members for accessing individual channel data. For example: // Assuming 'buffer' is an unsigned 16 bit stereo buffer.. QAudioBuffer::S16U *sample = buffer->data<QAudioBuffer::S16U>(); for (int i=0; i < buffer->sampleCount() / 2; i++) { qSwap(sample[i].left, sample[i].right); } See also QAudioBuffer::S8U, QAudioBuffer::S8S, QAudioBuffer::S16S, QAudioBuffer::S16U, and QAudioBuffer::S32F. Member Function Documentation
|