Comments (2)
I don't think there is anything in IcecastMetadataPlayer that would cause this. What's probably happening is that each listener's audio is playing at different rates that, while not noticeable to the ear, eventually accumulate to cause significant differences after playing for long durations. IcecastMetadataPlayer has a few different playback methods for compatibility reasons, but they all rely on the client to playback the audio using the interfaces provided in a browser (MediaSource, Web Audio, and HTML5 audio element).
You might try running tests for each playbackMethod
to see if that changes anything. Depending on your browser and OS, one of these web interfaces could be better than the other for playing the audio consistently.
You might also try a test where you play your stream on two different devices that you know have had this issue and record the output. Then you could align these recordings in Audacity and see if there's any consistency to how audio becomes out of sync between devices.
Finally, there is the onCodecUpdate
callback that is triggered with codec information parsed from the compressed audio while the stream is playing. The duration fields in there are sample accurate and garenteed to be correct. You can check to see if playback starts to drift over time based on this.
Other that stopping and starting playback in your app when you think the audio is out of sync, at this point I can't think of anything that should be done in IcecastMetadataPlayer to fix the client's audio playback rate, unless you find a bug somewhere in the playback methods that is causing the audio to drift.
from icecast-metadata-js.
Thank you for a great answer :) Setting the preferred playback method to 'webaudio' seems to solve the problem. I tested on iOS Safari and Windows Chrome. Previously, in both those browsers 'mediasource' was chosen by default (if no preferred method was provided), but only in Windows Chrome it seems (on my computer) a delay would build up often. Now those browsers will use 'webaudio' and things seem fine in Windows Chrome, but I have to test a bit more to be sure.
It's interesting to learn about these things. The media source documentation says it's experimental technology, so as long as the stream type is supported, it might be best to use webaudio anyway.
I'll keep a resync/restart mechanism in my app, just in case.
I suppose you can close this issue, and keep it around as information, in case someone experiences the same thing.
from icecast-metadata-js.
Related Issues (20)
- webaudio analyser ? HOT 3
- Full screen visualizer in demo
- multiple instances of metadata HOT 4
- icecast-metadata-stats NodeJS support HOT 6
- Authenticated streams not working? HOT 4
- CORS or header problem from icecast2 HOT 3
- iOS does not recognize playback correctly
- AbortError with streams from Icecast 2.4.0-kh22 HOT 10
- Uncaught ReferenceError: player is not defined HOT 8
- Play and replay issue on iOS HOT 9
- icecast-metadata-player retry / reconnect logic not working in iOS 17 HOT 1
- icecast-metadata-player - navigator.mediaSession.metadata not working in iOS HOT 3
- Pass custom parameter into icecast-metadata-player-1.17.1.main.min.js HOT 5
- Writing metadata to a file HOT 2
- ReferenceError: Worker is not defined HOT 5
- Audio stops playing after 5 seconds. HOT 4
- Unable to resume audio on iOS 17
- Repeated warnings when running in a Next.js app HOT 2
- Audio stream from a POST call HOT 1
- ERR_EMPTY_RESPONSE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icecast-metadata-js.