@rapidaai/react 1.1.46 → 1.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28809,16 +28809,31 @@ var VoiceAgent = class extends Agent {
28809
28809
  * @param input
28810
28810
  * @returns
28811
28811
  */
28812
+ // public setInputChannel = async (input: Channel) => {
28813
+ // if (this.inputChannel == input) {
28814
+ // return;
28815
+ // }
28816
+ // if (input == Channel.Audio) {
28817
+ // await this.connectAudio();
28818
+ // } else {
28819
+ // await this.disconnectAudio();
28820
+ // }
28821
+ // this.inputChannel = input;
28822
+ // this.emit(AgentEvent.InputChannelChangeEvent, this.inputChannel);
28823
+ // };
28812
28824
  setInputChannel = async (input) => {
28813
- if (this.inputChannel == input) {
28825
+ if (this.inputChannel === input) {
28814
28826
  return;
28815
28827
  }
28816
- if (input == "audio" /* Audio */) {
28817
- await this.connectAudio();
28818
- } else {
28819
- await this.disconnectAudio();
28820
- }
28828
+ await this.disconnectAudio();
28821
28829
  this.inputChannel = input;
28830
+ if (input === "audio" /* Audio */) {
28831
+ if (this.isConnected) {
28832
+ await this.connectAudio();
28833
+ } else {
28834
+ console.log("Audio initialization deferred until connect()");
28835
+ }
28836
+ }
28822
28837
  this.emit("onInputChannelChangeEvent" /* InputChannelChangeEvent */, this.inputChannel);
28823
28838
  };
28824
28839
  /**