Git Product home page Git Product logo

pcm-to-opus's Introduction

Steps to run this

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.

Example

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.

Note

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.

pcm-to-opus's People

Contributors

deepankarm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.