[Audio] Fix #1207 (discussions)
Eliminates audio stuttering even when AudioContext is enabled. Make lyrics account for the extra latency introduced by Audio Lab.
This commit is contained in:
parent
4d459a3a21
commit
e28b484d92
2 changed files with 15 additions and 18 deletions
|
@ -24,7 +24,7 @@ const CiderAudio = {
|
|||
CiderAudio.connectContext(document.getElementById("apple-music-player"), 0);
|
||||
|
||||
cb();
|
||||
clearInterval(searchInt);
|
||||
clearInterval(searchInt);
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
|
@ -49,7 +49,8 @@ const CiderAudio = {
|
|||
},
|
||||
connectContext: function (mediaElem) {
|
||||
if (!CiderAudio.context) {
|
||||
CiderAudio.context = new window.AudioContext({ sampleRate: 96000 }); // Don't ever remove the sample rate arg. Ask Maikiwi.
|
||||
CiderAudio.context = new window.AudioContext({ sampleRate: 96000, latencyHint: "playback"}); // Don't ever remove the sample rate arg. Ask Maikiwi.
|
||||
app.lyricOffset = CiderAudio.context.baseLatency
|
||||
}
|
||||
if (!CiderAudio.source) {
|
||||
CiderAudio.source = CiderAudio.context.createMediaElementSource(mediaElem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue