Update ToneAudioBuffer.ts

improving url parsing regexp to avoid hangs in edge case filepaths
This commit is contained in:
Marcel Blum 2020-10-14 23:45:40 -04:00
parent e7e372d37e
commit 09a524994d

View file

@ -356,7 +356,7 @@ export class ToneAudioBuffer extends Tone {
static async load(url: string): Promise<AudioBuffer> {
// test if the url contains multiple extensions
const matches = url.match(/\[(.+\|?)+\]$/);
const matches = url.match(/\[([^\]\[]+\|.+)\]$/);
if (matches) {
const extensions = matches[1].split("|");
let extension = extensions[0];