Cross-Platform Voice Recorder (voice/voice-recorder.ts)

qwen-code · packages/cli/src/ui/voice/voice-recorder.ts · typescript · Apache-2.0
voice, cli

A unified interface for recording audio across different platforms by selecting the appropriate system-level recorder like arecord or SoX.

// Source: https://github.com/QwenLM/qwen-code | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * @license
 * Copyright 2025 Qwen
 * SPDX-License-Identifier: Apache-2.0
 */

import process from 'node:process';
import { createDebugLogger } from '@qwen-code/qwen-code-core';
import type {
  RecordedVoiceAudio,
  VoiceRecorder,
  VoiceRecorderStartOptions,
} from '../hooks/use-voice-input.js';
import { createArecordRecorder } from './arecord-recorder.js';
import { createNativeAudioRecorder } from './native-audio-recorder.js';
import { createSoxRecorder } from './sox-recorder.js';

const debugLogger = createDebugLogger('VOICE_RECORDER');

interface VoiceRecorderOptions {
  createNa

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key