2

I am working on an experimental peer-to-server WebRTC project, in which

  1. clients (Chrome) send their local audio stream to a remote server
  2. the remote server records that audio stream into a file for later processing
  3. the server makes that particular file available for the client who sent it to listen back in their browser
  4. the server does 2 and 3 as audio streams come in

I know how to do 1. For 2 I am currently using the native WebRTC API (i.e., StartRecordingPlayout) inside the "trunk\talk\examples\peerconnection\client" project which is written in C++. I was able to record an audio stream sent from a remote peer (Chrome) into a WAV file on the receiving side and to listen back using VLC media player.

I am now researching what other technologies/languages are available for my project. This is because I feel there are not many resources for developing native WebRTC applications at the moment. I then recently discovered Node.js.

Would a combination of WebRTC and Node.js be a good choice for creating such server application explained above?

Any advice would be appreciated.

jpen
  • 2,129
  • 5
  • 32
  • 56
  • would you mind to share your code? I'm having a hard time making audio work with the webrtc native demo clients, thanks! – dh1tw Sep 12 '14 at 21:55

1 Answers1

0

The only realistic way currently would be to record or manipulate the audio stream natively. The Audio Web API(specifically AudioContext) that is available in JavaScript cannot parse a remote party's buffers that arrive from a rtcpeerconnection. This is a current low priority bug in chrome. I am not sure if all the other implementations of the API have the same issues.

You could try to get the audio api that is implemented Node.js or the RecordRTC for Node but I would bet that both would have the same issues. I would be happily surprised if they do not and if they do not, both could be valid options for your application.

The only option other than a native solution would be to have the client send the audio buffers separately from the peerconnection but that would pretty much defeat the purpose of using WebRTC peerconnection.

Community
  • 1
  • 1
Benjamin Trent
  • 7,378
  • 3
  • 31
  • 41
  • Thanks for the links. I wasn't aware of these issues. I found this thread: https://groups.google.com/forum/#!topic/mozilla.dev.media/pos7woJMimo – jpen May 17 '14 at 21:24
  • Ah but it looks like the application (videomail.io) mentioned in the above thread is video only. – jpen May 17 '14 at 21:33
  • @jpen, yeah, the Audio part of the session is the tricky part. With video you just capture frames but the audio buffers are just not accessible with the AudioContext API it would seem. – Benjamin Trent May 17 '14 at 22:19