Files
t3code/apps/web/src/lib/snapShotSound.ts
T
299404a754 feat(desktop): add cross-platform window capture (#8103)
Co-authored-by: Dara Adedeji <[email protected]>
Co-authored-by: Dara Adedeji <[email protected]>
Co-authored-by: Wout Stiens <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-09-07 18:21:53 -07:00

12 lines
442 B
TypeScript

import type { SnapShotSound } from "@t3tools/contracts";
import snapShotClickUrl from "../assets/snap-shot-click.mp3?url";
import snapShotWhooshUrl from "../assets/snap-shot-whoosh.mp3?url";
export function playSnapShotSound(sound: SnapShotSound): void {
const audio = new Audio(sound === "soft-pop" ? snapShotWhooshUrl : snapShotClickUrl);
audio.preload = "auto";
audio.currentTime = 0;
void audio.play().catch(() => undefined);
}