0

I'm trying to make sound panning work with audio got through WebRTC, but with the code below it's not outputting any sound at all. But when I do the same thing with my local audio MediaStream it works.

What could be the problem?

var AudioContext = window.AudioContext || window.webkitAudioContext
audioCtx = new AudioContext()
audioCtx.listener.setOrientation(0,0,-1,0,1,0)

var panner = audioCtx.createPanner()
panner.setOrientation(1,0,0)
panner.refDistance = 20
panner.coneInnerAngle = 360
panner.coneOuterAngle = 0
panner.panningModel = 'equalpower'

var source = audioCtx.createMediaStreamSource(peer.stream)
source.connect(panner)
panner.connect(audioCtx.destination)
Artjom B.
  • 61,146
  • 24
  • 125
  • 222
gerhard
  • 427
  • 1
  • 4
  • 12

1 Answers1

1

What browser are you using? There are browser bugs that prevent it from working in some versions. Try a Firefox Nightly build (https://nightly.mozilla.org/), we've fixed the WebAudio/WebRTC integration.

padenot
  • 1,515
  • 8
  • 11
  • thanks! that's great that firefox fixed this issue, but unfortunately I need to use chrome and as I found out the issue isn't fixed in it yet :( – gerhard Jul 04 '15 at 22:59