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.
- 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
- Use
client.getRemoteStreams
and attach remote audio stream to an audio element (could also be done viacall.remoteAudioStream
) - Use
client.getLastRtpStats
to getAudioLevelOutput
statistics to detect 5s of silence - Use IBM Text to Speech, Web Audio API and
setAudioVideoStream
to play audio as in scenario above
- Register an account on circuitsandbox.net (if you didn't yet)
- Register a bot on the sandbox (OAuth 2.0 Client Credentials)
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