-
Notifications
You must be signed in to change notification settings - Fork 975
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
Can 2 Sampler instances share the set of same audio files? #1216
Comments
Or let me ask this way: can we feed the new Sampler() function a set of buffered audio files, instead of the url every time? If that's possible, we can load the audio files in the buffer first and then anytime when we need a new instance of this instrument, we just new it from the buffer. |
I am pretty sure Tone does this already: |
Thanks for the info! Unfortunately I don't know much about the TS code... Can you please help write a few lines in JS illustrating how to do 1) load audio files into a whatever buffer, and 2) new Samplers from the buffer? Thanks very much!!! |
I could, but what you are doing is most likely 'premature optimization'. Bandwidth is cheap and the browser cache will take care of all of this for you - this is what it's for. |
Say I have 2 tracks of the same piano instrument. I new-ed 2 Sampler( url:{xxx}, function(){} ), each for a track, with the same "url:{xxx}" parameter since they are the same instrument.
The issue is: each time it will download the audio files (referred to by the "url:{xxx}" parameter) from the server. I believe this is a waste of server bandwidth - since the 2 set of audio files are identical, isn't there a way that we just download one set of the audio files and let the 2 sampler instances share it?
The text was updated successfully, but these errors were encountered: