Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios18 can not play audio The voice can be played on safari webkit #8567

Closed
5 tasks done
likenamehaojie opened this issue Sep 19, 2024 · 7 comments
Closed
5 tasks done
Assignees
Labels
🐞 bug Something isn't working

Comments

@likenamehaojie
Copy link
Contributor

likenamehaojie commented Sep 19, 2024

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

error

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

ios 18 can not play audio

✔️ Expected Behavior

11111

❌ Actual Behavior

111111

@dosubot dosubot bot added the 🐞 bug Something isn't working label Sep 19, 2024
Copy link

dosubot bot commented Sep 19, 2024

I found a similar unsolved discussion regarding audio playback issues on iOS devices: Text2speech auto play cannot work (on cloud) [1].

Additionally, there are no specific known issues or bug reports related to audio playback on iOS 18 documented in the Dify repository .

However, there are specific configurations required for audio playback on iOS devices. The code includes a compatibility check for the MediaSource or ManagedMediaSource object, which is necessary for audio streaming. If neither is available, it notifies the user to update to iOS 17.1 or later:

// Compatible with iphone ios17 ManagedMediaSource
const MediaSource = window.MediaSource || window.ManagedMediaSource
if (!MediaSource) {
  Toast.notify({
    message: 'Your browser does not support audio streaming, if you are using an iPhone, please update to iOS 17.1 or later.',
    type: 'error',
  })
}
this.mediaSource = MediaSource ? new MediaSource() : null

This indicates that for audio playback to work on iOS devices, the device must support MediaSource or ManagedMediaSource, and if using an iPhone, it should be updated to iOS 17.1 or later [2].

If the issue persists on iOS 18, it might be worth investigating further or checking for any recent updates or changes in the codebase that might affect audio playback functionality.

To continue talking to Dosu, mention @dosu.

@likenamehaojie
Copy link
Contributor Author

image ios 17 also has this bug

@likenamehaojie
Copy link
Contributor Author

the version 0.8.3 also has same bug

@crazywoola
Copy link
Member

crazywoola commented Sep 22, 2024

Link #5617
Link #7492

@JzoNgKVO

@likenamehaojie
Copy link
Contributor Author

likenamehaojie commented Sep 22, 2024

@crazywoola, I looked at this, but my problem is that there is an issue with iOS 17.1+Safari browser on my iPhone,
The prompt is that ManagedMediaSource does not have endOfStream() function,
When I commented out this line, it still cannot be played,
I refer to the description of ManagedMediaSource by W3C.
I made the following settings for the audio when building a ManagedMediaSource

this.audio.disableRemotePlayback = true;
this.audio.controls = true;

At this time, it can be played, but the first and second messages of each conversation cannot be played. The voice can be played on the third message. This is the work I have done so far

The current expectation is that the first and second messages can be played normally

@likenamehaojie likenamehaojie changed the title ios18 can not play audio ios18 can not play audio The voice can be played on safari webkit Sep 22, 2024
@likenamehaojie
Copy link
Contributor Author

@

@likenamehaojie
Copy link
Contributor Author

@crazywoola fix at. #8645 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants