Clarify API/docs by introducing the audio "frame", and add helpers.
The frame is the interleaved set of one sample for each channel. Add some docs and some methods that make working with samples a bit more convenient. Adjusted QAudioBuffer to use these helper functions and terminology. Change-Id: I96db48e659561972d6de2aa19893d29f9a828cd3 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
68079a5e22
commit
4d13a15bae
@@ -91,6 +91,18 @@ public:
|
||||
void setSampleType(QAudioFormat::SampleType sampleType);
|
||||
QAudioFormat::SampleType sampleType() const;
|
||||
|
||||
// Helper functions
|
||||
qint32 bytesForDuration(qint64 duration) const;
|
||||
qint64 durationForBytes(qint32 byteCount) const;
|
||||
|
||||
qint32 bytesForFrames(qint32 frameCount) const;
|
||||
qint32 framesForBytes(qint32 byteCount) const;
|
||||
|
||||
qint32 framesForDuration(qint64 duration) const;
|
||||
qint64 durationForFrames(qint32 frameCount) const;
|
||||
|
||||
int bytesPerFrame() const;
|
||||
|
||||
private:
|
||||
QSharedDataPointer<QAudioFormatPrivate> d;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user