From 5582393eb7f0510323d7fde10ec22f05e688b4a8 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 11 Sep 2022 16:37:39 +0300 Subject: [PATCH] add opus test [skip build] --- test/opus.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/opus.cpp diff --git a/test/opus.cpp b/test/opus.cpp new file mode 100644 index 00000000..0ca6e898 --- /dev/null +++ b/test/opus.cpp @@ -0,0 +1,20 @@ +#include + +int main() +{ + int error = OPUS_INVALID_STATE; + + OpusEncoder* encoder = opus_encoder_create(48000, 2, OPUS_APPLICATION_AUDIO, &error); + AEDI_EXPECT(encoder != nullptr); + AEDI_EXPECT(error == OPUS_OK); + AEDI_EXPECT(opus_encoder_ctl(encoder, OPUS_SET_BITRATE(OPUS_AUTO)) == OPUS_OK); + opus_encoder_destroy(encoder); + + OpusDecoder* decoder = opus_decoder_create(48000, 2, &error); + AEDI_EXPECT(decoder != nullptr); + AEDI_EXPECT(error == OPUS_OK); + AEDI_EXPECT(opus_decoder_ctl(decoder, OPUS_SET_GAIN(0)) == OPUS_OK); + opus_decoder_destroy(decoder); + + return 0; +}