From f8e9904e4e7be252c2d23f1d0e97ee34237ec097 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 18 Jul 2018 21:37:59 +0200 Subject: [PATCH] Added Opus::getPreSkip function --- lib/opus.cpp | 5 +++++ lib/opus.h | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/opus.cpp b/lib/opus.cpp index 122a21d4..b5e1fcfc 100644 --- a/lib/opus.cpp +++ b/lib/opus.cpp @@ -3,6 +3,11 @@ namespace Opus{ + + uint16_t getPreSkip(const char * initData){ + return initData[10] + initData[11]* 256; + } + unsigned int Opus_getDuration(const char *part){ const char config = part[0] >> 3; const char code = part[0] & 3; diff --git a/lib/opus.h b/lib/opus.h index 4c756728..0a09fc28 100644 --- a/lib/opus.h +++ b/lib/opus.h @@ -1,6 +1,7 @@ #include namespace Opus{ + uint16_t getPreSkip(const char * initData); unsigned int Opus_getDuration(const char *part); std::string Opus_prettyPacket(const char *part, int len); }