Reputation: 11
I'm trying to inspire my kid to play music instead of silly games. So I did a complete download of an online piano and it works offline, but without sound. So I changed all
NOTE3: 'external_path_/NOTE3.mp3'
// to
NOTE3: 'local/NOTE3.mp3'.
Like so:
document.addEventListener('DOMContentLoaded', () => {
sampler = new Tone.Sampler({
urls: {
A3: 'local_folder/A3.mp3',
B3: 'local_folder/B3.mp3',
C3: 'local_folder/C3.mp3',
D3: 'local_folder/D3.mp3',
E3: 'local_folder/E3.mp3',
F3: 'local_folder/F3.mp3',
G3: 'local_folder/G3.mp3',
},
release: 0.5,
baseUrl: '',
}).toDestination();
});
I also have these sounds of notes in mp3 files from the original page, also created folder samples and piano outside the source folder, inside, within and in every other combination with these samples inside outside in all combinations.
Also tried all combinations with a single ' and double " around NOTE3, path NOTE3: 'piano/NOTE3.mp3'. Also tried changing baseUrl by adding and removing .and/or /, just so: ./samples, ../samples, /sample, all combinations, etc. Even thou I did copy mp3s all around the project inside, outside, in samples and in piano folders - all combinations as i said. But yet no sound ...
The piano works offline, but no sound: buttons change colors when pressed, piano keys change to rainbow when slider checked, etc... Is there something inside JS, CSS files that redirects path to the original http:// ? And since I'd like it to work offline, yet it doesn't play mp3 from local path, how can I fix it?
PS: "Edited" After I realized what exactly my kid is interested in (it's simply colors). So I went ahead and got a few free very colorful virtual Pianos from the store.
PPs: I guess the author of that html piano doesn't want it to be a tiny little stand alone offline toy =) And/Or/nor html piano isn't made for offline use.
___Solved:+ Found a better solution colored toony piano and colored straight. After checking out all of piano apps ..these take the most attention of my kid.
The hardest thing was : to explain that an app :"is most likely way better than a game" ~ i said ; and surely enought she bought it, and now she thinks that apps are better than games (what i mean is 'tags)...YET thou i dun understand yet, ?. how did she notice a differece between game and an app tags... ..
Upvotes: 1
Views: 116
Reputation: 24
local_folder Make sure there are sounds in this folder. Often the wrong address also causes problems.
Upvotes: 0