Skip to content

Commit 869dcbb

Browse files
committed
Format
1 parent 7707e40 commit 869dcbb

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

examples/data_tracks/publisher.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
TOKEN = os.environ.get("LIVEKIT_TOKEN")
99
URL = os.environ.get("LIVEKIT_URL")
1010

11+
1112
async def read_sensor() -> bytes:
1213
# Dynamically read some sensor data...
1314
return bytes([0xFA] * 256)
1415

16+
1517
async def push_frames(track: rtc.LocalDataTrack):
1618
while True:
1719
logging.info("Pushing frame")
@@ -23,6 +25,7 @@ async def push_frames(track: rtc.LocalDataTrack):
2325
logging.error("Failed to push frame: %s", e)
2426
await asyncio.sleep(0.5)
2527

28+
2629
async def main(room: rtc.Room):
2730
logging.basicConfig(level=logging.INFO)
2831
logger = logging.getLogger(__name__)
@@ -33,6 +36,7 @@ async def main(room: rtc.Room):
3336
track = await room.local_participant.publish_data_track("my_sensor_data")
3437
await push_frames(track)
3538

39+
3640
if __name__ == "__main__":
3741
logging.basicConfig(
3842
level=logging.INFO,

examples/data_tracks/subscriber.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
TOKEN = os.environ.get("LIVEKIT_TOKEN")
99
URL = os.environ.get("LIVEKIT_URL")
1010

11+
1112
async def subscribe(track: rtc.RemoteDataTrack):
1213
logging.info(
1314
"Subscribing to '%s' published by '%s'",
@@ -22,6 +23,7 @@ async def subscribe(track: rtc.RemoteDataTrack):
2223
if latency is not None:
2324
logging.info("Latency: %.3f s", latency)
2425

26+
2527
async def main(room: rtc.Room):
2628
logging.basicConfig(level=logging.INFO)
2729
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)