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

IOS 17.4 - Wavesurfer doesn't play..... #3542

Open
Gigamick opened this issue Feb 7, 2024 · 18 comments
Open

IOS 17.4 - Wavesurfer doesn't play..... #3542

Gigamick opened this issue Feb 7, 2024 · 18 comments
Labels

Comments

@Gigamick
Copy link

Gigamick commented Feb 7, 2024

I'm using V 6.2.0

plays fine on all devices / browsers except iPhones rocking iOS 17.4 beta.

Any ideas?

@Gigamick Gigamick added the bug label Feb 7, 2024
@katspaugh
Copy link
Owner

I don’t support v6 anymore, sorry. Please try with v7 and see if that works.

@Gigamick
Copy link
Author

Gigamick commented Feb 8, 2024

I don’t support v6 anymore, sorry. Please try with v7 and see if that works.

it's fine it looks like its an ios17.4 problem. Spotify web player isn't working either. You should test V7 on an iOS device running the latest beta...... or don't, I guess lol.

@katspaugh
Copy link
Owner

katspaugh commented Feb 8, 2024

I'd wait till it's out of beta, maybe they'll fix it.

@alexcraviotto
Copy link

I'm using V 6.2.0

plays fine on all devices / browsers except iPhones rocking iOS 17.4 beta.

Any ideas?

Did you fix that?

@CalvinJamesHeath
Copy link

Im having the same issue. Wavesurfer never loads, everything else is called and works correctly on Android, Chrome, and Safari on Mac OS, but didn't work on any iphone I tried.

I tracked it down and it appears that the on ready event is never fired.

wavesurfer.on('ready', () => {
					console.log('wavesurferRef.ready');
					setLoading(false);
					setDuration(formatTime(wavesurfer.getDuration()));
				});

@katspaugh
Copy link
Owner

Thanks for the heads up. Like I said I won’t be fixing it until it’s out of beta as it may well be fixed on the iOS side by that time.

@CalvinJamesHeath
Copy link

@katspaugh Do you have any suggestions or recommendations for temporary solutions or workarounds that could help me achieve functionality on iOS devices, I would greatly appreciate any guidance you can provide because its really important for the project since Im deploying next week

@katspaugh
Copy link
Owner

katspaugh commented Feb 27, 2024

You could pre-decode the audio. See this example. You can use bbc/audiowaveform to generate peaks.

@CalvinJamesHeath
Copy link

CalvinJamesHeath commented Feb 28, 2024

@katspaugh I just grabbed the peaks from the example

peaks: [ [ 0, 0.0023595101665705442, 0.012107174843549728, 0.005919494666159153, -0.31324470043182373, 0.1511787623167038, 0.2473851442337036, 0.11443428695201874, -0.036057762801647186, -0.0968964695930481, -0.03033737652003765, 0.10682467371225357, 0.23974689841270447, 0.013210971839725971, -0.12377244979143143, 0.046145666390657425, -0.015757400542497635, 0.10884027928113937, 0.06681904196739197, 0.09432944655418396, -0.17105795443058014, -0.023439358919858932, -0.10380347073078156, 0.0034454423002898693, 0.08061369508504868, 0.026129156351089478, 0.18730352818965912, 0.020447958260774612, -0.15030759572982788, 0.05689578503370285, -0.0009095853311009705, 0.2749626338481903, 0.2565386891365051, 0.07571295648813248, 0.10791446268558502, -0.06575305759906769, 0.15336275100708008, 0.07056761533021927, 0.03287476301193237, -0.09044631570577621, 0.01777501218020916, -0.04906218498945236, -0.04756792634725571, -0.006875281687825918, 0.04520256072282791, -0.02362387254834175, -0.0668797641992569, 0.12266506254673004, -0.10895221680402756, 0.03791835159063339, -0.0195105392485857, -0.031097881495952606, 0.04252675920724869, -0.09187793731689453, 0.0829525887966156, -0.003812957089394331, 0.0431736595928669, 0.07634212076663971, -0.05335947126150131, 0.0345163568854332, -0.049201950430870056, 0.02300390601158142, 0.007677287794649601, 0.015354577451944351, 0.007677287794649601, 0.007677288725972176, ], ],

and used that and I can see the generated peaks on all other devices and play the audios except on IOS mobile devices.
Wavesurfer on ready is never called on IOS. What else should I do?

PS: I think I have a different issue since no audio will play on IOS Safari even with the basic audio tag, I will update tomorrow.

@CalvinJamesHeath
Copy link

CalvinJamesHeath commented Feb 28, 2024

Audios work correctly only when I specify the type in IOS safari, for the rest of browsers I didnt have to:

<audio controls>
<source src={fileUrl} type='audio/mpeg' />
Your browser does not support the audio tag.
</audio>

And for wavesurfer I added:

const wavesurfer = WaveSurfer.create({
  container: '#waveform',
  mediaType: 'audio/mpeg', // Specify the audio file type,
  backend: 'WebAudio', // add this too 
  // Other options...
});

And it all works perfectly. Thank you.

@andyandye
Copy link

I found the same issue in v7 on Safari as the 'ready' event was not firing. I resolved it by adding
backend: 'WebAudio',

as suggested above

@CalvinJamesHeath
Copy link

CalvinJamesHeath commented Mar 16, 2024

The new issue now is that since we have to use backend: 'WebAudio' the playback pitch shifts and doesnt preserve. If backend is set to 'MediaElement' the pitch stays the same but you go back to square 1 as it will work fine on everything except IOS safari and MAC OS safari.

@psavva
Copy link

psavva commented Apr 24, 2024

We are also facing this issue.
Adding WebAudio breaks other things

@katspaugh
Copy link
Owner

Any particular audio format? The examples on https://wavesurfer.xyz/examples/ work for me on iOS 17.4.1.

@psavva
Copy link

psavva commented Apr 24, 2024

We are using mp3 files

@toumbas
Copy link
Sponsor

toumbas commented Apr 24, 2024

We are facing the same issue
Thanks @katspaugh

@katspaugh
Copy link
Owner

@toumbas thanks for the sponsorship! 💖
Can you link or upload the problematic audio?

@pierluigi
Copy link

Adding backend: "WebAudio" as others suggested seems to have no impact on the multitrack example.

It appears this.audioContext.state is always suspended and no events are being triggered by the WebAudioPlayer element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants