Giter Site home page Giter Site logo

mmaclach / webrtc-audio-stream-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jmcker/webrtc-audio-stream-example

0.0 1.0 0.0 3.27 MB

Proof of concept work for streaming audio over a WebRTC connection (Socket.io signaling server)

License: MIT License

HTML 10.36% JavaScript 88.60% CSS 1.05%

webrtc-audio-stream-example's Introduction

WebRTC-Audio-Stream-Example

Node/Socket.io Signaling Server

The signaling server identifies and facilitates negotiations between transceivers before they drop into a peer-to-peer connection. It must be run on a machine that is accessible by both transceivers.

  1. npm install
  2. Run node ./server.js on a machine accessible by both planned transceivers.
  3. Update the IP or URL and port in the index.html call to new Socket(ipaddr, port). These should point to your signaling server.
  4. Leave this running.

Electron Transceiver

  1. npm install
  2. Run npm start.
  3. Enter a room name.
  4. Select the stream source.
  5. Press the Connect button.
  6. Audio/video should start to flow.

Browser Receiver

Serve the required files over file:// or HTTP to use them in the browser. This has been confirmed to work (some receiver only) in Chrome, FireFox, and Chrome Android.

Make sure to npm install or some of the dependencies won't exist.

file:// protocol

  1. The simplest test would be loading the file over the file:// protocol.
  2. Open index.html in a browser by double-clicking it or dragging it into an open window.

HTTP Server

  • Temporarily serve the current directory for testing: python -m SimpleHTTPServer
  • Or move the project folder (with node_modules) into a pre-existing webserver setup.

Notes

  • Video can be enabled in lib.js. Flip showVideo to true.
  • Linux and Mac have no support for capturing an audio stream. Uncomment line ~26 in lib.js if you want to transmit video from them. Left as is, they will still function as receivers.
  • Beware of the firewall when trying to reach the signaling server. Mine blocked traffic to it. The signaling server is setup to respond with 404 to any HTTP request. You can check if connection is possible in a browser; helpful in verifying connectivity.
  • Unmuting the Local audio element can be used to verify that the stream is actually capturing. You should hear an echoey/phasey effect.

webrtc-audio-stream-example's People

Contributors

jmcker avatar

Watchers

James Cloos 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.