adjust output sample rate and create user token
This commit is contained in:
@@ -60,6 +60,9 @@ async def configure_livekit():
|
|||||||
|
|
||||||
token = generate_token(room_name, "Say One Thing", api_key, api_secret)
|
token = generate_token(room_name, "Say One Thing", api_key, api_secret)
|
||||||
|
|
||||||
|
user_token = generate_token(room_name, "User", api_key, api_secret)
|
||||||
|
logger.info(f"User token: {user_token}")
|
||||||
|
|
||||||
return (url, token, room_name)
|
return (url, token, room_name)
|
||||||
|
|
||||||
|
|
||||||
@@ -68,10 +71,7 @@ async def main():
|
|||||||
(url, token, room_name) = await configure_livekit()
|
(url, token, room_name) = await configure_livekit()
|
||||||
|
|
||||||
transport = LiveKitTransport(
|
transport = LiveKitTransport(
|
||||||
url=url,
|
url=url, token=token, room_name=room_name, params=LiveKitParams(audio_out_enabled=True, audio_out_sample_rate=16000)
|
||||||
token=token,
|
|
||||||
room_name=room_name,
|
|
||||||
params=LiveKitParams(audio_out_enabled=True)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
tts = CartesiaTTSService(
|
tts = CartesiaTTSService(
|
||||||
@@ -87,7 +87,8 @@ async def main():
|
|||||||
# participant joins.
|
# participant joins.
|
||||||
@transport.event_handler("on_first_participant_joined")
|
@transport.event_handler("on_first_participant_joined")
|
||||||
async def on_first_participant_joined(transport, participant_id):
|
async def on_first_participant_joined(transport, participant_id):
|
||||||
await task.queue_frame(TextFrame(f"Hello there!"))
|
await asyncio.sleep(1)
|
||||||
|
await task.queue_frame(TextFrame("Hello there! How are you doing today? Would you like to talk about the weather?"))
|
||||||
|
|
||||||
await runner.run(task)
|
await runner.run(task)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user