microsoft / cognitive-services-speech-sdk-js

Microsoft Azure Cognitive Services Speech SDK for JavaScript
Other
252 stars 91 forks source link

[Bug]: SpeechSDK not work on Iphone's safari, but work on Mac #832

Open vegetabo opened 3 weeks ago

vegetabo commented 3 weeks ago

What happened?

I am working on a react project with tts, I find my page work right on the mac, but no voice on the iphone. Does anyone know the reason? This really confuses me.

    const initializeSynthesizer = () => {
        const speechConfig = SpeechSDK.SpeechConfig.fromSubscription(KEY, 'eastasia');
        const audioConfig = SpeechSDK.AudioConfig.fromDefaultSpeakerOutput();
        const synthesizer = new SpeechSDK.SpeechSynthesizer(speechConfig, audioConfig);
        setSynthesizer(synthesizer);
    }

    const synthesizeSpeech = () => {
        if (synthesizer) {
            synthesizer.speakTextAsync(
                text,
                result => {
                    console.log(result)
                },
                error => {
                    console.error('Error synthesizing speech: ', error);
                }
            );
        }
    };

Version

1.36.0 (Latest)

What browser/platform are you seeing the problem on?

Safari

Relevant log output

No response