introduce presets fast and robust for qos settings Reviewed-on: https://gitea.pstruebi.xyz/auracaster/bumble-auracast/pulls/15
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
"""
|
|
BAP/BSRC/SCC/BV-20-C: Config Broadcast, LC3 16_2_2
|
|
|
|
Configuration: 16kHz, 40 octets/frame, stereo (2 BISes), QoS _2 variant
|
|
"""
|
|
|
|
import logging
|
|
import os
|
|
|
|
from auracast.auracast_config import AuracastGlobalConfig, AuracastBigConfig, AuracastQosRobust
|
|
from auracast.multicast import broadcast, run_async
|
|
|
|
|
|
if __name__ == "__main__":
|
|
logging.basicConfig(
|
|
level=os.environ.get("LOG_LEVEL", logging.INFO),
|
|
format="%(module)s.py:%(lineno)d %(levelname)s: %(message)s",
|
|
)
|
|
|
|
os.chdir(os.path.join(os.path.dirname(__file__), "../../auracast"))
|
|
|
|
config = AuracastGlobalConfig()
|
|
# _2 variant uses different QoS (RTN=2, higher latency)
|
|
config.qos_config = AuracastQosRobust()
|
|
config.transport = "serial:/dev/ttyAMA3,1000000,rtscts"
|
|
|
|
# 16_2_2: 16kHz, 40 octets/frame
|
|
config.auracast_sampling_rate_hz = 16000
|
|
config.octets_per_frame = 40
|
|
|
|
big = AuracastBigConfig()
|
|
big.random_address = "F1:F1:F2:F3:F4:F5"
|
|
big.audio_source = "file:./testdata/announcement_en.wav"
|
|
big.num_bis = 1
|
|
big.id = 12
|
|
|
|
run_async(
|
|
broadcast(
|
|
config,
|
|
[big],
|
|
)
|
|
)
|