imran
January 21

this has been resolved, please refer this thread

What audio format to send back to genesys via websocket : Audio Connector

opened 07:07PM - 18 Jan 25 UTC
closed 07:04AM - 19 Jan 25 UTC

How can we send audio back to Genesys via WebSocket? I'm using the Azure TTS se


Visit Topic to respond.


Previous Replies

imran
January 21

Yes, I am receiving the audio buffer from Genesys and successfully performing speech-to-text . However, for Azure STT to function, you’ll need to convert the audio buffer you receive into one of the formats supported by Azure Cognitive Services.

Speech SDK audio input stream concepts - Azure AI services

An overview of the capabilities of the Speech SDK audio input stream.

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

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.