Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit e81345c

Browse files
authored
Merge pull request #1319 from daslyfe/jade/bug/replace_white_spaces_in_sounds
fix: replace empty spaces in registered sound keys
2 parents 9b4574c + 6b8ee8a commit e81345c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/superdough/superdough.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import { loadBuffer } from './sampler.mjs';
1717
export const soundMap = map();
1818

1919
export function registerSound(key, onTrigger, data = {}) {
20-
soundMap.setKey(key.toLowerCase(), { onTrigger, data });
20+
key = key.toLowerCase().replace(/\s+/g, '_');
21+
soundMap.setKey(key, { onTrigger, data });
2122
}
2223

2324
function aliasBankMap(aliasMap) {

0 commit comments

Comments
 (0)