本文整理汇总了C++中QAudioFormat::framesForBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ QAudioFormat::framesForBytes方法的具体用法?C++ QAudioFormat::framesForBytes怎么用?C++ QAudioFormat::framesForBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAudioFormat
的用法示例。
在下文中一共展示了QAudioFormat::framesForBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startTime
/*!
Creates a new audio buffer from the supplied \a data, in the
given \a format. The format will determine how the number
and sizes of the samples are interpreted from the \a data.
If the supplied \a data is not an integer multiple of the
calculated frame size, the excess data will not be used.
This audio buffer will copy the contents of \a data.
\a startTime (in microseconds) indicates when this buffer
starts in the stream.
If this buffer is not part of a stream, set it to -1.
*/
QAudioBuffer::QAudioBuffer(const QByteArray &data, const QAudioFormat &format, qint64 startTime)
{
if (format.isValid()) {
int frameCount = format.framesForBytes(data.size());
d = new QAudioBufferPrivate(new QMemoryAudioBufferProvider(data.constData(), frameCount, format, startTime));
} else
d = 0;
}