TTS audio fails to play in browser due to Content-Type mismatch (WAV data served as audio/mpeg)
bug
### Self Checks
- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [x] I confirm that I am using English to submit this report, otherwise it will be closed.
- [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- [x] Please do not modify this template :) and fill in all the required fields.
### Dify version
1.15.0
### Cloud or Self Hosted
Self Hosted (Docker)
### Steps to reproduce
1.Configure TTS in ChatFlow using Tongyi's qwen3-tts-flash model.
2.Generate a conversation and click the audio playback button.
3.Observe that no sound is played.
### ✔️ Expected Behavior
Audio plays normally in the browser.
### ❌ Actual Behavior
TTS audio fails to play in the browser. The browser console shows the following error:
**Chrome**:
```
Uncaught (in promise) NotSupportedError: Failed to load because no supported source was found.
```
**Edge**:
```
Uncaught (in promise) NotSupportedError: Failed to load because no supported source was found.
```
**Firefox**:
```
Uncaught DOMException: MediaSource.addSourceBuffer: Type not supported in MediaSource
```
Upon inspecting the API response, I found:
- The actual audio data returned is **WAV format** (starts with `RIFF....WAVE`)
- But the HTTP response `Content-Type` is set to **`audio/mpeg`**
This is exactly the same root cause identified in [#35880](https://github.com/langgenius/dify/issues/35880) by @euxx:
> "The Tongyi TTS implementation does not specify an output format and returns the downloaded audio bytes unchanged. The actual response is WAV data (RIFF....WAVE, PCM 24 kHz), while Dify responds with Content-Type: audio/mpeg."
Although [#35901](https://github.com/langgenius/dify/pull/35901) was merged to fix AudioContext issues, the **audio format mismatch** between the actual WAV data and the `audio/mpeg` Content-Type header persists in v1.15.0.
<img width="958" height="402" alt="Image" src="https://github.com/user-attachments/assets/8c483844-eefa-4a6f-bd81-89e0a4630cec" />
<img width="1152" height="479" alt="Image" src="https://github.com/user-attachments/assets/b5e35c5b-2019-42dc-b282-001cb13f4eb2" />
3 条评论