Skip to content

Instantly share code, notes, and snippets.

View jordonmckoy's full-sized avatar

Jordon McKoy jordonmckoy

View GitHub Profile
@jordonmckoy
jordonmckoy / AudioRecorder.tsx
Created February 8, 2024 12:49
File upload to Google Cloud Storage (GCS) in Next.js 14 API Route
"use client"
export default function AudioRecorder() {
const [audioBlob, setAudioBlob] = useState<Blob | null>(null);
// ...app code omitted
const uploadAudio = async () => {
if (!audioBlob) {
throw new Error("No audio to upload");
}