diff --git a/bumble/a2dp.py b/bumble/a2dp.py index b16de874..9be306da 100644 --- a/bumble/a2dp.py +++ b/bumble/a2dp.py @@ -923,7 +923,7 @@ async def generate_frames() -> AsyncGenerator[OpusPacket, None]: logger.debug("first packet (header)") if packet[:8] != b"OpusHead": raise ValueError("first packet is not OpusHead") - packet_count = ( + channel_mode = ( OpusPacket.ChannelMode.MONO if packet[9] == 1 else OpusPacket.ChannelMode.STEREO diff --git a/tests/a2dp_test.py b/tests/a2dp_test.py index 54fb591c..a08a0a75 100644 --- a/tests/a2dp_test.py +++ b/tests/a2dp_test.py @@ -489,6 +489,33 @@ async def test_opus_parser(): assert packet.payload == audio_data_packet +# ----------------------------------------------------------------------------- +async def test_opus_parser_mono(): + page_header = ( + b'OggS' # Capture pattern + + b'\x00' # Version + + b'\x02' # Header type + + struct.pack("