aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
704 stars 475 forks source link

repro startAudioInput bug #2712

Closed evangeline closed 1 year ago

evangeline commented 1 year ago

Bug repro for https://github.com/aws/amazon-chime-sdk-js/issues/2709

When you call startAudioInput repeatedly with an audio stream, audio will fail to send (audioSendingFailed)

Run the browser demo, the following scenarios will cause audioSendingFailed:

  1. Calling startAudioInput repeatedly with the same audio track but in a new media stream

        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
  2. Calling startAudioInput repeatedly with the same audio track but making sure to stopAudioInput before starting again

        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
        await this.audioVideo?.stopAudioInput();
        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
        await this.audioVideo?.stopAudioInput();
        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
        await this.audioVideo?.stopAudioInput();
        await this.audioVideo?.startAudioInput(new MediaStream([audioTrack]));
  3. Putting the track into the same media stream, ie:

        const stream = new MediaStream([audioTrack]);
        await this.audioVideo?.startAudioInput(stream);
        await this.audioVideo?.stopAudioInput();
        await this.audioVideo?.startAudioInput(stream);
        await this.audioVideo?.stopAudioInput();
        await this.audioVideo?.startAudioInput(stream);
        await this.audioVideo?.stopAudioInput();
        await this.audioVideo?.startAudioInput(stream);