fix: audio path fix.
This commit is contained in:
parent
0eec71eb01
commit
6e6662553c
|
@ -1469,6 +1469,7 @@ export class Game {
|
||||||
reject
|
reject
|
||||||
);
|
);
|
||||||
else if (lib.path.extname(path)) resolve(`${lib.assetURL}${path}`);
|
else if (lib.path.extname(path)) resolve(`${lib.assetURL}${path}`);
|
||||||
|
else if (URL.canParse(path)) resolve(path);
|
||||||
else resolve(`${lib.assetURL}${path}.mp3`);
|
else resolve(`${lib.assetURL}${path}.mp3`);
|
||||||
}).then((resolvedPath) => {
|
}).then((resolvedPath) => {
|
||||||
audio.src = resolvedPath;
|
audio.src = resolvedPath;
|
||||||
|
@ -1603,7 +1604,11 @@ export class Game {
|
||||||
let path = "",
|
let path = "",
|
||||||
format = "";
|
format = "";
|
||||||
if (!/^db:|^ext:|\//.test(audioInfo)) path = "skill/";
|
if (!/^db:|^ext:|\//.test(audioInfo)) path = "skill/";
|
||||||
if (!/\.\w+$/.test(audioInfo)) format = ".mp3";
|
if (
|
||||||
|
!/\.\w+$/.test(audioInfo) &&
|
||||||
|
!["data:", "blob:"].some((name) => audioInfo.startsWith(name))
|
||||||
|
)
|
||||||
|
format = ".mp3";
|
||||||
if (path && format) return parseAudio(audioInfo, options, [true, 2]);
|
if (path && format) return parseAudio(audioInfo, options, [true, 2]);
|
||||||
return [`${path}${audioInfo}${format}`];
|
return [`${path}${audioInfo}${format}`];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue