6 namespace swift::sound::codecs
11 m_opusDecoder = opus_decoder_create(sampleRate, channels, &error);
20 int bytesPerSample = (bitrate / 8) * m_channels;
21 return bufferSize / bytesPerSample;
26 QVector<qint16> decoded(MaxDataBytes, 0);
29 if (!opusData.isEmpty())
31 *decodedLength = opus_decode(m_opusDecoder,
reinterpret_cast<const unsigned char *
>(opusData.data()),
32 dataLength, decoded.data(), count, 0);
34 decoded.resize(*decodedLength);
40 if (!m_opusDecoder) {
return; }
41 opus_decoder_ctl(m_opusDecoder, OPUS_RESET_STATE);
int frameCount(int bufferSize)
Frame count.
COpusDecoder(int sampleRate, int channels)
Ctor.
QVector< qint16 > decode(const QByteArray &opusData, int dataLength, int *decodedLength)
Decode.