go mod tidy
go run cmd/main.go <livekit-url> <livekit-api-key> <livekit-api-secret> <directory>
Pass data/test/ws
to listen to the audio of a PCM file generated by a WebSocket stream from ElevenLabs.
Pass data/test/post
to listen to the audio of a PCM file generated by a POST request to ElevenLabs.
go run cmd/main.go ws://---.livekit.cloud <api-key> <api-secret> data/test/ws
2024-06-26T11:28:22.874+0530 DEBUG pkg/track.go:41 Connected to room {"room": "dummy-room", "participant": "publisher"}
2024/06/26 11:28:22 "level"=0 "msg"="published track" "name"="publisher-identity" "source"="MICROPHONE" "trackID"="TR_AMFo8vjwj2YJbo"
2024-06-26T11:28:22.888+0530 INFO pkg/track.go:84 Track published {"trackID": "TR_g2SXrYTfEoDD"}
2024/06/26 11:28:22 Listener URL: https://meet.livekit.io/custom?liveKitUrl=...&token=...
2024/06/26 11:28:22 Sleeping for 10 seconds to allow the listener to join before sending the audio files
Join the above Listener URL
in a browser to listen to the audio of the PCM file in a LiveKit room.
To compare I've created 2 .wav
files from the PCM files generated by the WebSocket stream and the POST request. They are ws.wav and post.wav. You can check the script to convert them here.