Merge pull request #1319 from daslyfe/jade/bug/replace_white_spaces_in_sounds

fix: replace empty spaces in registered sound keys
This commit is contained in:
Jade (Rose) Rowland 2025-04-04 00:26:57 -04:00 committed by GitHub
commit e81345ca2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,8 @@ import { loadBuffer } from './sampler.mjs';
export const soundMap = map(); export const soundMap = map();
export function registerSound(key, onTrigger, data = {}) { export function registerSound(key, onTrigger, data = {}) {
soundMap.setKey(key.toLowerCase(), { onTrigger, data }); key = key.toLowerCase().replace(/\s+/g, '_');
soundMap.setKey(key, { onTrigger, data });
} }
function aliasBankMap(aliasMap) { function aliasBankMap(aliasMap) {