Spaces:
Sleeping
Sleeping
Download src/components/AudioControls.tsx from rolexx/gamejam_v1: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/rolexx/gamejam_v1/resolve/main/src/components/AudioControls.tsx
- Command line
-
hf download hf://spaces/rolexx/gamejam_v1/src/components/AudioControls.tsx
-
curl -L -o AudioControls.tsx https://huggingface.co/spaces/rolexx/gamejam_v1/resolve/main/src/components/AudioControls.tsx
1.06 kB
| import React from 'react'; | |
| import { useAudioRecorder } from '../hooks/useAudioRecorder'; | |
| export const AudioControls: React.FC = () => { | |
| const { isRecording, audioURL, startRecording, stopRecording, playRecording } = useAudioRecorder(); | |
| return ( | |
| <div className="audio-controls"> | |
| {!isRecording ? ( | |
| <button | |
| onClick={startRecording} | |
| className="record-button" | |
| > | |
| 🎤 Démarrer l'enregistrement | |
| </button> | |
| ) : ( | |
| <button | |
| onClick={stopRecording} | |
| className="stop-button" | |
| > | |
| ⏹️ Arrêter l'enregistrement | |
| </button> | |
| )} | |
| {audioURL && ( | |
| <button | |
| onClick={playRecording} | |
| className="play-button" | |
| > | |
| ▶️ Écouter l'enregistrement | |
| </button> | |
| )} | |
| </div> | |
| ); | |
| }; |