@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 14 lines 497 Bytes
Raw
1 import { useReleasingSharedObjectWithLifecycle } from "expo";
2 import { createAudioPlayer } from "expo-audio";
3 import { disposeAudioPlayer } from "../../lib/audioSession";
4
5 export function usePlaybackAudioPlayer(uri: string | null) {
6 // Keep the native ref alive until any pending activation and release finish.
7 return useReleasingSharedObjectWithLifecycle(
8 {
9 factory: () => createAudioPlayer(uri, { updateInterval: 500 }),
10 release: disposeAudioPlayer,
11 },
12 [uri],
13 );
14 }