TTS audio does not play reliably in Safari and Firefox
### 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 a bug report.
- [x] I have searched existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report.
- [x] I have kept all required template fields.
### Dify version
1.15.0 self-hosted. The affected audio player implementation was also verified against the current `main` branch.
### Cloud or Self Hosted
- Self Hosted (Docker)
- Self Hosted (Source)
### Steps to reproduce
1. Configure a TTS model that returns valid MPEG audio.
2. Open a Dify application in Safari or Firefox.
3. Generate a response and start TTS playback.
4. Observe the playback behavior.
In Safari, the TTS endpoint returns valid audio that can be downloaded and played directly, but playback in Dify may remain silent when the `AudioContext` is suspended or interrupted.
In Firefox, `MediaSource` exists but does not support `audio/mpeg`. Creating the source buffer fails with errors such as:
```text
MediaSource.addSourceBuffer: Type not supported in MediaSource
Cannot play media. No decoders for requested formats: audio/mpeg
```
### Expected Behavior
TTS audio should play in Safari and Firefox. Playback should recover from a suspended or interrupted audio context, and browsers without MPEG MediaSource support should use a compatible fallback.
### Actual Behavior
Safari may remain silent even though the TTS request succeeds and returns playable audio.
Firefox fails to initialize an MPEG `SourceBuffer`, so TTS audio cannot be played through the current streaming path.
关闭于 27 天前 1 条评论