feat: Enhance speech-to-text example with live microphone transcription
- Add live microphone recording and transcription functionality - Implement audio buffer processing with 5-second intervals - Update SpeechToText initialization with more flexible configuration - Add TypeScript type definitions for node-record-lpcm16 - Improve error handling and process management for audio recording
This commit is contained in:
22
src/types/node-record-lpcm16.d.ts
vendored
Normal file
22
src/types/node-record-lpcm16.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
declare module 'node-record-lpcm16' {
|
||||
import { Readable } from 'stream';
|
||||
|
||||
interface RecordOptions {
|
||||
sampleRate?: number;
|
||||
channels?: number;
|
||||
audioType?: string;
|
||||
threshold?: number;
|
||||
thresholdStart?: number;
|
||||
thresholdEnd?: number;
|
||||
silence?: number;
|
||||
verbose?: boolean;
|
||||
recordProgram?: string;
|
||||
}
|
||||
|
||||
interface Recording {
|
||||
stream(): Readable;
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
export function record(options?: RecordOptions): Recording;
|
||||
}
|
||||
Reference in New Issue
Block a user