varun
January 21

Hi, @imran, are you able to get audio buffer data through audio connector and pass to azure STT. If yes does azure STT converted it to text


Visit Topic to respond.


Previous Replies

imran
January 18

How can we send audio back to Genesys via WebSocket?

I'm using the Azure TTS service, and after generating the audioData, I convert it to a Uint8Array before sending it to Genesys. However, during a call, the audio I hear is distorted. To troubleshoot, I wrote the audioData to a file, and it played back clearly.

For context, I'm using this repository as the foundation for my audioConnector: Genesys AudioConnector Server Reference Implementation.

here is the sample code:

async getAudioBytes(text: string): Promise<Uint8Array> {
        return new Promise((resolve, reject) => {

            this.synthesizer.speakTextAsync(
                text,
                (result: sdk.SpeechSynthesisResult) => {
                    if (result.reason === sdk.ResultReason.SynthesizingAudioCompleted) {    
                        const audioData = new Uint8Array(result.audioData);
    
                        fs.writeFile("output.wav", audioData, (err) => {
                            if (err) {
                                console.error("Error writing to file:", err);
                                reject(err);
                            } else {
                                console.log(`Audio content written to file: output.wav`);
                            }
                        });
    
                        resolve(audioData);
                    } else {
                        console.error("Speech synthesis failed. Reason:", result.errorDetails);
                        reject(new Error(result.errorDetails));
                    }
                    this.synthesizer.close();
                },
                (err: any) => {
                    console.error("Error during synthesis:", err);
                    this.synthesizer.close();
                    reject(err);
                }
            );
        });
    }

can anyone help me here with this?

Thanks!


Visit Topic to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.