@JS The most likely reason for this error is that on a webapp or app service you will have to set the audio config for TTS or STT scenarios since the remote app service does not have access to a microphone or speaker the audio config should be set to a audio file.
Please this [thread](https://learn.microsoft.com/en-us/answers/questions/1184428/azure-text-to-speech-error-code-0x38-(spxerr-audio) for details which fixed the issue for the user.
Try to add the following to your speechSyntheszier() config.
file_name = "outputaudio.wav"
file_config = speechsdk.audio.AudioOutputConfig(filename=file_name)
speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=file_config)
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.