Skip to content

Commit 951251b

Browse files
committed
update the decoder to account for the stupid behaviour
1 parent 96ba8d2 commit 951251b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

sdks/python/omi/decoder.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
from opuslib import Decoder
22

3+
34
class OmiOpusDecoder:
45
def __init__(self):
56
self.decoder = Decoder(16000, 1) # 16kHz mono
67

7-
def decode_packet(self, data):
8+
def decode_packet(self, data: bytes, strip_header: bool = True):
89
if len(data) <= 3:
910
return b''
1011

1112
# Remove 3-byte header
12-
clean_data = bytes(data[3:])
13+
if strip_header:
14+
clean_data = bytes(data[3:])
15+
else:
16+
clean_data = data
1317

1418
# Decode Opus to PCM 16-bit
1519
try:

sdks/python/omi/py.typed

Whitespace-only changes.

sdks/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "omi-sdk"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
dependencies = [
55
"aiohttp>=3.11.14",
66
"bleak>=0.22.3",

0 commit comments

Comments
 (0)