MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / applyWebAudioRate

Function applyWebAudioRate

packages/core/src/runtime/init.ts:2669–2682  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2667 // duration at its prior rate and can't be rescaled, so when one is active we
2668 // stopAll()+reschedule at the new rate to keep trimmed clips ending on time.
2669 const applyWebAudioRate = () => {
2670 const changed = webAudio.setRate(state.playbackRate);
2671 if (
2672 changed &&
2673 !state.nativeMediaSyncDisabled &&
2674 !state.webAudioMediaDisabled &&
2675 webAudioReady &&
2676 clock.isPlaying() &&
2677 webAudio.hasBoundedActiveSources()
2678 ) {
2679 webAudio.stopAll();
2680 scheduleWebAudioForActiveClips();
2681 }
2682 };
2683
2684 player.play = () => {
2685 const tl = state.capturedTimeline;

Callers 1

Calls 5

stopAllMethod · 0.80
isPlayingMethod · 0.65
setRateMethod · 0.45

Tested by

no test coverage detected