mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
fix(app): let a sound restart immediately after being stopped (#1960)
This commit is contained in:
1 parent
38a299d852
commit
38e86acffe
1 file changed
+1
-1
@@ -499,6 +499,7 @@ export function clearCustomSoundCache(type?: SoundType): void {
|
||||
export async function stopSound(type: SoundType): Promise<void> {
|
||||
const activeSound = activeSounds.get(type);
|
||||
if (!activeSound) return;
|
||||
activeSounds.delete(type);
|
||||
const {audio, gainNode, sourceNode} = activeSound;
|
||||
try {
|
||||
await fadeOut(gainNode, 0.08);
|
||||
@@ -507,7 +508,6 @@ export async function stopSound(type: SoundType): Promise<void> {
|
||||
audio.currentTime = 0;
|
||||
audio.loop = false;
|
||||
disconnectNodes(sourceNode, gainNode);
|
||||
activeSounds.delete(type);
|
||||
}
|
||||
|
||||
export async function stopAllSounds(): Promise<void> {
|
||||
|
||||
Reference in new issue
Block a user