mirror of
https://github.com/remvze/moodist.git
synced 2026-02-28 09:03:12 +08:00
fix: replace generator with static silent audio
This commit is contained in:
BIN
public/sounds/silence.mp3
Normal file
BIN
public/sounds/silence.mp3
Normal file
Binary file not shown.
@@ -1,6 +1,5 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { getSilenceDataURL } from '@/helpers/sound';
|
||||
import { BrowserDetect } from '@/helpers/browser-detect';
|
||||
|
||||
import { useSoundStore } from '@/stores/sound';
|
||||
@@ -25,7 +24,9 @@ export function MediaSessionTrack() {
|
||||
|
||||
const generateSilence = useCallback(async () => {
|
||||
if (!masterAudioSoundRef.current) return;
|
||||
masterAudioSoundRef.current.src = await getSilenceDataURL();
|
||||
|
||||
masterAudioSoundRef.current.src = '/sounds/silence.mp3';
|
||||
|
||||
setIsGenerated(true);
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user