UNPKG

voice-stream

Version:

A powerful React hook for real-time voice streaming, designed for AI-powered applications. Perfect for real-time transcription, voice assistants, and audio processing with features like silence detection and configurable audio processing.

9 lines (8 loc) 256 B
export const int16ArrayToBase64 = (buffer: Int16Array): string => { let binary = ""; const bytes = new Uint8Array(buffer.buffer); for (let i = 0; i < bytes.byteLength; i++) { binary += String.fromCharCode(bytes[i]); } return btoa(binary); };