mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-18 14:20:42 -07:00
Refactor Tauri Integration to Use Platform Context
- 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.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user