mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-16 05:10:42 -07:00
- Replaced direct Tauri API calls with a unified platform context across multiple components, enhancing code maintainability and readability. - Removed the deprecated tauri.ts file, consolidating platform-related logic into the new PlatformContext. - Updated components such as App, AudioPlayer, and ServerSettings to utilize the new platform context for lifecycle management and server interactions. - Improved platform detection and handling for audio playback and system audio capture functionalities. - Ensured consistent error handling and user feedback across the application when interacting with platform-specific features.
28 lines
865 B
TypeScript
28 lines
865 B
TypeScript
import type { PlatformAudio, AudioDevice } from '@/platform/types';
|
|
|
|
export const webAudio: PlatformAudio = {
|
|
isSystemAudioSupported(): boolean {
|
|
return false; // System audio capture not supported in web
|
|
},
|
|
|
|
async startSystemAudioCapture(_maxDurationSecs: number): Promise<void> {
|
|
throw new Error('System audio capture is only available in the desktop app.');
|
|
},
|
|
|
|
async stopSystemAudioCapture(): Promise<Blob> {
|
|
throw new Error('System audio capture is only available in the desktop app.');
|
|
},
|
|
|
|
async listOutputDevices(): Promise<AudioDevice[]> {
|
|
return []; // No native device routing in web
|
|
},
|
|
|
|
async playToDevices(_audioData: Uint8Array, _deviceIds: string[]): Promise<void> {
|
|
throw new Error('Native audio device routing is only available in the desktop app.');
|
|
},
|
|
|
|
stopPlayback(): void {
|
|
// No-op for web
|
|
},
|
|
};
|