100Note: When changing a SQLite table's schema, change the table's name (e.g., add _2 or _3) to create a fresh table.
101
102### OpenAI
103```ts
104import { OpenAI } from "https://esm.town/v/std/openai";
105const openai = new OpenAI();
106const completion = await openai.chat.completions.create({
107 messages: [
108 { role: "user", content: "Say hello in a creative way" },
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import {
15
16const app = new Hono();
17const openai = new OpenAI();
18
19// Get all voice notes (for admin/dashboard)
143async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
144 try {
145 // Convert ArrayBuffer to File for OpenAI
146 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
147
148 const transcription = await openai.audio.transcriptions.create({
149 file: audioFile,
150 model: "whisper-1",
6
7- ๐๏ธ Record voice notes directly in the browser
8- ๐ค AI-powered transcription using OpenAI Whisper
9- ๐ Share voice notes via unique URLs
10- โฐ Set expiration by max listens or date
53- **Database**: SQLite for voice note metadata
54- **Storage**: Val Town Blob storage for audio files
55- **AI**: OpenAI Whisper for transcription
56- **Frontend**: React with TypeScript
57- **Styling**: TailwindCSS
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import {
15
16const app = new Hono();
17const openai = new OpenAI();
18
19// Get all voice notes (for admin/dashboard)
143async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
144 try {
145 // Convert ArrayBuffer to File for OpenAI
146 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
147
148 const transcription = await openai.audio.transcriptions.create({
149 file: audioFile,
150 model: "whisper-1",
6
7- ๐๏ธ Record voice notes directly in the browser
8- ๐ค AI-powered transcription using OpenAI Whisper
9- ๐ Share voice notes via unique URLs
10- โฐ Set expiration by max listens or date
53- **Database**: SQLite for voice note metadata
54- **Storage**: Val Town Blob storage for audio files
55- **AI**: OpenAI Whisper for transcription
56- **Frontend**: React with TypeScript
57- **Styling**: TailwindCSS
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import {
15
16const app = new Hono();
17const openai = new OpenAI();
18
19// Get all voice notes (for admin/dashboard)
143async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
144 try {
145 // Convert ArrayBuffer to File for OpenAI
146 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
147
148 const transcription = await openai.audio.transcriptions.create({
149 file: audioFile,
150 model: "whisper-1",
6
7- ๐๏ธ Record voice notes directly in the browser
8- ๐ค AI-powered transcription using OpenAI Whisper
9- ๐ Share voice notes via unique URLs
10- โฐ Set expiration by max listens or date
53- **Database**: SQLite for voice note metadata
54- **Storage**: Val Town Blob storage for audio files
55- **AI**: OpenAI Whisper for transcription
56- **Frontend**: React with TypeScript
57- **Styling**: TailwindCSS
1export async function projectIdea(topic = "ุงูุตุญุฉ") {
2 const response = await fetch("https://api.openai.com/v1/chat/completions", {
3 method: "POST",
4 headers: {
5 "Content-Type": "application/json",
6 Authorization: `Bearer ${process.env.OPENAI_API_KEY}`,
7 },
8 body: JSON.stringify({
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { blob } from "https://esm.town/v/std/blob";
3import { OpenAI } from "https://esm.town/v/std/openai";
4import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
5import {
15
16const app = new Hono();
17const openai = new OpenAI();
18
19// Get all voice notes (for admin/dashboard)
143async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
144 try {
145 // Convert ArrayBuffer to File for OpenAI
146 const audioFile = new File([audioBuffer], "audio.webm", { type: "audio/webm" });
147
148 const transcription = await openai.audio.transcriptions.create({
149 file: audioFile,
150 model: "whisper-1",
6
7- ๐๏ธ Record voice notes directly in the browser
8- ๐ค AI-powered transcription using OpenAI Whisper
9- ๐ Share voice notes via unique URLs
10- โฐ Set expiration by max listens or date
53- **Database**: SQLite for voice note metadata
54- **Storage**: Val Town Blob storage for audio files
55- **AI**: OpenAI Whisper for transcription
56- **Frontend**: React with TypeScript
57- **Styling**: TailwindCSS