This commit is contained in:
Half-Shot
2024-12-05 11:27:07 +00:00
parent a3723b75d5
commit c7a56f7d66

View File

@@ -26,7 +26,7 @@ type SoundDefinition = { mp3?: string; ogg: string };
* @param buffer The buffer to play.
* @returns A promise that resolves when the sound has finished playing.
*/
function playSound(
async function playSound(
ctx: AudioContext,
buffer: AudioBuffer,
volume: number,
@@ -100,7 +100,7 @@ interface Props<S extends string> {
}
interface UseAudioContext<S> {
playSound(soundName: S): void;
playSound(soundName: S): Promise<void>;
}
/**
@@ -166,7 +166,7 @@ export function useAudioContext<S extends string>(
return null;
}
return {
playSound: (name): Promise<void> => {
playSound: async (name): Promise<void> => {
if (!audioBuffers[name]) {
logger.debug(`Tried to play a sound that wasn't buffered (${name})`);
return;