You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 16, 2023. It is now read-only.
Used memory increases the longer samples are played in one session. You'll see a lot of GainNode objects piling up.
For those interested, I shared our fix here: danigb/sample-player#8
In our library (OpenSheetMusicDisplay, early access audio player), we patch this fix into node_modules/sample-player, otherwise we'd have to wait for a new release of sample-player and soundfont-player.
You can do this hotfix like this:
Add this in package.json under scripts:
prebuild is automatically executed with npm run build.
(you can just put the bottom line into prebuild if you don't have other prebuild scripts, otherwise use npm-run-all in prebuild)
(of course you need to put the patched .js files into src/SamplePlayerPatch/lib/)
Dependencies: ncp is a dependency you'll need to add: "ncp": "^2.0.0",
This is just cp (a copy command) that works on Mac, Linux and Windows. I'm not aware of another easy platform-agnostic way to do that. And it's 17.5KB.
Also npm-run-all, if you want to use it in prebuild:
"npm-run-all": "^4.1.5",
-> prebuild: npm-run-all myPrebuild prebuildSamplePlayer
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Used memory increases the longer samples are played in one session. You'll see a lot of
GainNode
objects piling up.For those interested, I shared our fix here:
danigb/sample-player#8
In our library (OpenSheetMusicDisplay, early access audio player), we patch this fix into
node_modules/sample-player
, otherwise we'd have to wait for a new release of sample-player and soundfont-player.You can do this hotfix like this:
Add this in package.json under scripts:
prebuild
is automatically executed withnpm run build
.(you can just put the bottom line into prebuild if you don't have other prebuild scripts, otherwise use
npm-run-all
inprebuild
)(of course you need to put the patched .js files into
src/SamplePlayerPatch/lib/
)Dependencies:
ncp
is a dependency you'll need to add:"ncp": "^2.0.0",
This is just
cp
(a copy command) that works on Mac, Linux and Windows. I'm not aware of another easy platform-agnostic way to do that. And it's 17.5KB.Also
npm-run-all
, if you want to use it inprebuild
:"npm-run-all": "^4.1.5",
->
prebuild: npm-run-all myPrebuild prebuildSamplePlayer
The text was updated successfully, but these errors were encountered: