Electron-based Bot utilizing the WebRTC capabilities of the Circuit JS SDK
Clone or download
rogeru Merge pull request #2 from richardfazzio/master
Change audio stream object and removed deprecated url. Update to most recent circuit-sdk.
Latest commit 3809c98 Nov 7, 2018

README.md

webrtc-bot-example

Electron-based Bot utilizing the WebRTC capabilities of the Circuit JS SDK.

Electron is based on node.js and Chromium and is therefore able to utilize the Circuit JS WebRTC APIs unlike a regular node.js app.

Scenarios covered in this example:

Greet participants by name when joining a conference

  • Using callStatus event listen for participants joining
  • Use IBM Text to Speech service to generate audio buffer for greeting
  • Use the AudioContext of the Web Audio API to convert the audio buffer to a MediaStream
  • Use the new setAudioVideoStream API to transmit the greeting to the conference

Detect 5s of silence and play an announcement

  • Use client.getRemoteStreams and attach remote audio stream to an audio element (could also be done via call.remoteAudioStream)
  • Use client.getLastRtpStats to get AudioLevelOutput statistics to detect 5s of silence
  • Use IBM Text to Speech, Web Audio API and setAudioVideoStream to play audio as in scenario above

Getting Started

Run the app

    git clone https://github.com/circuit/webrtc-bot-example.git
    cd webrtc-bot-example
    cp config.json.template config.json
    // Edit config.json with your credentials
    npm install
    npm start // or npm run dev