Co-authored-by: pstruebi <patrick.struebin@summitwave.eu> Reviewed-on: https://gitea.pstruebi.xyz/auracaster/bumble-auracast/pulls/16
46 lines
1.2 KiB
Python
46 lines
1.2 KiB
Python
"""
|
|
PBP/PBS/STR/BV-01-C: Standard Quality Streaming Support, 16_2_1 - PBS
|
|
(TSPC_PBP_1_1 AND TSPC_PBP_7_1) OR TSPC_ALL
|
|
|
|
Configuration: 16kHz, unencrypted, stereo (2 BISes)
|
|
PBP Features: 0x02 (Standard Quality)
|
|
"""
|
|
|
|
import logging
|
|
import os
|
|
|
|
from auracast.auracast_config import AuracastGlobalConfig, AuracastBigConfig, AuracastQosFast
|
|
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()
|
|
config.qos_config = AuracastQosFast()
|
|
config.transport = "serial:/dev/ttyAMA3,1000000,rtscts"
|
|
|
|
# 16_2_1: 16kHz, stereo
|
|
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.id = 12
|
|
big.num_bis = 1
|
|
big.name = "Broadcaster"
|
|
# Unencrypted (no code)
|
|
|
|
run_async(
|
|
broadcast(
|
|
config,
|
|
[big],
|
|
)
|
|
)
|