Description
Using the testSpeaker
api, I have encountered a few problems. First, it works fine until you try stopping and starting again (it becomes silent). Secondly, if you call destroy()
, it throws an error when you create a new testSpeaker. I based some of my code off of the react demo app, and yes, the react demo app causes the same errors too.
Browser Console Error
Various console errors I’ve encountered:
InvalidStateError - Failed to execute 'stop' on 'AudioScheduledSourceNode': cannot call stop without calling start first.
InvalidAccessError - Failed to execute 'connect' on 'AudioNode': cannot connect to an AudioNode belonging to a different audio context.
Which Web Video SDK version?
1.5.5
Video SDK Code Snippets
// Play default test speaker sound on selected speaker
const onTestSpeakerClick = () => {
speakerTesterRef.current = localAudio.testSpeaker({
speakerId: previewSpeakerSelectionId,
onAnalyseFrequency: (value: number) => {
setOutputLevel(Math.min(100, value))
},
})
setIsPlayingAudio(true)
}
// Stop test speaker after 3 seconds
useEffect(() => {
if (!isPlayingAudio) {
return
}
setSecondsLeft(3)
const interval = setInterval(() => {
setSecondsLeft((prev) => {
const newSeconds = prev - 1
if (newSeconds <= 0) {
clearInterval(interval)
setIsPlayingAudio(false)
setOutputLevel(0)
speakerTesterRef.current?.stop()
}
return newSeconds
})
}, 1000)
}, [isPlayingAudio])
To Reproduce(If applicable)
Steps to reproduce the behavior:
- Start up react demo app
- Go to preview
- Click test speaker, it works
- Stop speaker and test again, it is silent
- Switch speakers and test again, still silent
Screenshots
N/A
Troubleshooting Routes
Tested on the react demo app and encountered the same issues. Followed the sample code with no luck. The errors are originating from the vSDK library as far as I can tell. No permission issues at all.
Device (please complete the following information):
- Device: Macbook Pro M1
- OS: macOS 12.6
- Browser: Chrome
- Browser Version 106.0.5249.119 (Official Build) (arm64)
Additional context
testMicrophone
works like a charm. It is only testSpeaker
that is giving me issues.