Some initial work on stereo support (not complete)
This commit is contained in:
parent
eb1476c791
commit
3ce277ca1f
4 changed files with 8 additions and 8 deletions
|
@ -77,7 +77,7 @@ extern "C" {
|
|||
typedef struct OpusEncoder OpusEncoder;
|
||||
typedef struct OpusDecoder OpusDecoder;
|
||||
|
||||
OpusEncoder *opus_encoder_create(int Fs);
|
||||
OpusEncoder *opus_encoder_create(int Fs, int channels);
|
||||
|
||||
int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
|
||||
unsigned char *data, int bytes_per_packet);
|
||||
|
@ -86,7 +86,7 @@ void opus_encoder_destroy(OpusEncoder *st);
|
|||
|
||||
void opus_encoder_ctl(OpusEncoder *st, int request, ...);
|
||||
|
||||
OpusDecoder *opus_decoder_create(int Fs);
|
||||
OpusDecoder *opus_decoder_create(int Fs, int channels);
|
||||
|
||||
int opus_decode(OpusDecoder *st, const unsigned char *data, int len,
|
||||
short *pcm, int frame_size);
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "SKP_Silk_SDK_API.h"
|
||||
|
||||
|
||||
OpusDecoder *opus_decoder_create(int Fs)
|
||||
OpusDecoder *opus_decoder_create(int Fs, int channels)
|
||||
{
|
||||
char *raw_state;
|
||||
int ret, silkDecSizeBytes, celtDecSizeBytes;
|
||||
|
@ -68,7 +68,7 @@ OpusDecoder *opus_decoder_create(int Fs)
|
|||
}
|
||||
|
||||
/* Initialize CELT decoder */
|
||||
st->celt_dec = celt_decoder_init(st->celt_dec, 48000, 1, NULL);
|
||||
st->celt_dec = celt_decoder_init(st->celt_dec, 48000, channels, NULL);
|
||||
|
||||
return st;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "modes.h"
|
||||
#include "SKP_Silk_SDK_API.h"
|
||||
|
||||
OpusEncoder *opus_encoder_create(int Fs)
|
||||
OpusEncoder *opus_encoder_create(int Fs, int channels)
|
||||
{
|
||||
char *raw_state;
|
||||
OpusEncoder *st;
|
||||
|
@ -73,7 +73,7 @@ OpusEncoder *opus_encoder_create(int Fs)
|
|||
|
||||
/* Create CELT encoder */
|
||||
/* Initialize CELT encoder */
|
||||
st->celt_enc = celt_encoder_init(st->celt_enc, Fs, 1, NULL);
|
||||
st->celt_enc = celt_encoder_init(st->celt_enc, Fs, channels, NULL);
|
||||
|
||||
st->mode = MODE_HYBRID;
|
||||
st->bandwidth = BANDWIDTH_FULLBAND;
|
||||
|
|
|
@ -105,8 +105,8 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
enc = opus_encoder_create(rate);
|
||||
dec = opus_decoder_create(rate);
|
||||
enc = opus_encoder_create(rate, channels);
|
||||
dec = opus_decoder_create(rate, channels);
|
||||
|
||||
mode = MODE_HYBRID;
|
||||
opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(BANDWIDTH_FULLBAND));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue