MCPcopy Index your code
hub / github.com/simstudioai/sim / arrayBufferToBase64

Function arrayBufferToBase64

apps/sim/lib/speech/audio.ts:18–25  ·  view source on GitHub ↗
(buffer: ArrayBuffer)

Source from the content-addressed store, hash-verified

16 * Encode an ArrayBuffer as a base64 string for WebSocket transport.
17 */
18export function arrayBufferToBase64(buffer: ArrayBuffer): string {
19 const bytes = new Uint8Array(buffer)
20 let binary = ''
21 for (let i = 0; i < bytes.length; i++) {
22 binary += String.fromCharCode(bytes[i])
23 }
24 return btoa(binary)
25}

Callers 2

VoiceInterfaceFunction · 0.90
useSpeechToTextFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected