Opus codec module test pass

This commit is contained in:
dijunkun
2023-11-29 19:16:12 -08:00
parent d79720532d
commit 3a1be00ca5
41 changed files with 1243 additions and 177 deletions

View File

@@ -1,6 +1,6 @@
#include "OpusDecoderImpl.h"
#define MAX_FRAME_SIZE 6 * 960
#define CHANNELS 2
#define MAX_FRAME_SIZE 960
#define CHANNELS 1
OpusDecoderImpl::OpusDecoderImpl(int sampleRate, int channel) {
int err;
@@ -9,7 +9,7 @@ OpusDecoderImpl::OpusDecoderImpl(int sampleRate, int channel) {
sample_rate = sample_rate;
channel_num = channel;
if (err < 0 || decoder == NULL) {
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>\n");
printf("Create opus decoder failed\n");
return;
}
@@ -22,7 +22,7 @@ bool OpusDecoderImpl::Decode(unsigned char* in_data, int len) {
auto frame_size = opus_decode(decoder, in_data, len, out, MAX_FRAME_SIZE, 0);
if (frame_size < 0) {
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>\n");
printf("Invalid frame size\n");
return false;
}