Adaptions
This commit is contained in:
@@ -53,8 +53,9 @@ class AuracastBigConfig:
|
||||
name: str = 'Broadcast0'
|
||||
program_info: str = 'Some Announcements'
|
||||
audio_source: str = 'file:./auracast/announcement_48_10_96000_en.wav'
|
||||
iso_que_len: int = 64
|
||||
input_format: str = 'auto'
|
||||
loop_wav: bool = True
|
||||
iso_que_len: int = 64
|
||||
|
||||
|
||||
# Instanciate some example configurations
|
||||
|
||||
@@ -47,7 +47,7 @@ import bumble.utils
|
||||
from bumble.device import Host, BIGInfoAdvertisement, AdvertisingChannelMap
|
||||
from bumble.audio import io as audio_io
|
||||
|
||||
import auracast_config
|
||||
from auracast import auracast_config
|
||||
|
||||
|
||||
# modified from bumble
|
||||
@@ -205,8 +205,8 @@ async def init_broadcast(
|
||||
advertising_event_properties=bumble.device.AdvertisingEventProperties(
|
||||
is_connectable=False
|
||||
),
|
||||
primary_advertising_interval_min=round(100),
|
||||
primary_advertising_interval_max=round(200),
|
||||
primary_advertising_interval_min=100,
|
||||
primary_advertising_interval_max=200,
|
||||
advertising_sid=i,
|
||||
primary_advertising_phy=hci.Phy.LE_1M, # 2m phy config throws error - because for primary advertising channels, 1mbit is only supported
|
||||
secondary_advertising_phy=hci.Phy.LE_2M, # this is the secondary advertising beeing send on non advertising channels (extendend advertising)
|
||||
@@ -223,8 +223,8 @@ async def init_broadcast(
|
||||
+ advertising_manufacturer_data
|
||||
),
|
||||
periodic_advertising_parameters=bumble.device.PeriodicAdvertisingParameters(
|
||||
periodic_advertising_interval_min=round(80),
|
||||
periodic_advertising_interval_max=round(160),
|
||||
periodic_advertising_interval_min=80,
|
||||
periodic_advertising_interval_max=160,
|
||||
),
|
||||
periodic_advertising_data=bigs[f'big{i}']['basic_audio_announcement'].get_advertising_data(),
|
||||
auto_restart=True,
|
||||
@@ -295,7 +295,7 @@ async def init_audio(
|
||||
):
|
||||
for i, big in enumerate(bigs.values()):
|
||||
audio_source = big_config[i].audio_source
|
||||
input_format = 'auto'
|
||||
input_format = big_config[i].input_format
|
||||
audio_input = await audio_io.create_audio_input(audio_source, input_format)
|
||||
audio_input.rewind = big_config[i].loop_wav
|
||||
pcm_format = await audio_input.open()
|
||||
@@ -367,7 +367,7 @@ class Streamer():
|
||||
|
||||
if all(stream_finished): # Take into account that multiple files have different lengths
|
||||
logging.info('All streams finished, stopping streamer')
|
||||
self.is_streaming = True
|
||||
self.is_streaming = False
|
||||
break
|
||||
|
||||
|
||||
|
||||
@@ -7,9 +7,8 @@ import bumble.utils
|
||||
|
||||
import asyncio
|
||||
import aioconsole
|
||||
import multicast
|
||||
|
||||
import auracast_config
|
||||
from auracast import multicast
|
||||
from auracast import auracast_config
|
||||
|
||||
class Multicaster:
|
||||
"""
|
||||
@@ -26,7 +25,6 @@ class Multicaster:
|
||||
self.is_auracast_init = False
|
||||
self.is_audio_init = False
|
||||
self.streaming = False
|
||||
self.task = None # Holds the background print task
|
||||
self.global_conf = global_conf
|
||||
self.big_conf = big_conf
|
||||
self.device = None
|
||||
@@ -144,5 +142,6 @@ async def main():
|
||||
|
||||
await command_line_ui(caster)
|
||||
|
||||
# Run the application
|
||||
asyncio.run(main())
|
||||
if __name__ == '__main__':
|
||||
# Run the application
|
||||
asyncio.run(main())
|
||||
@@ -7,6 +7,7 @@ dependencies = [
|
||||
"bumble @ git+ssh://git@ssh.pstruebi.xyz:222/auracaster/bumble_mirror.git@e027bcb57a0f29c82e3c02c8bb8691dcb91eac62",
|
||||
"lc3 @ git+ssh://git@ssh.pstruebi.xyz:222/auracaster/liblc3.git@7558637303106c7ea971e7bb8cedf379d3e08bcc",
|
||||
"sounddevice",
|
||||
"aioconsole"
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user