Skip to main content

Module mic_ipc

Module mic_ipc 

Source
Expand description

JS-bridge bindings for the M-MIC.1 / AUT-278 microphone commands (M-MIC.2 / AUT-279).

Mirrors crate::camera_ipc for the audio path. Each function invokes a __screen* helper declared in index.html’s inline script, which wraps window.__TAURI__.core.invoke(...).

Returned values are deserialised from JsValue into typed Rust structs via serde_wasm_bindgen — same pattern as the camera + player IPC modules.

Structs§

MicrophoneView
Mirror of crates/app/src/commands.rs::MicrophoneView (M-MIC.1).

Enums§

MicLifecycle
Mirror of crates/app/src/audio/mod.rs::MicLifecycle. Tagged representation matches the Rust enum’s default serde shape (one of "Idle" / "Starting" / "Running" / "Stopping").

Functions§

list_microphones
Async helper: list every microphone the OS exposes.
list_microphones_js
__screenListMicrophones() — returns Promise<MicrophoneView[]>.
mic_status
Async helper: snapshot the worker lifecycle.
mic_status_js
__screenMicStatus() — returns Promise<MicLifecycle>.
microphone_permission_status
Async helper: probe OS microphone permission state.
microphone_permission_status_js
__screenMicrophonePermissionStatus() — returns Promise<CameraPermission> (same three-variant shape).
open_settings_microphone
Async helper: shell out to open System Settings → Microphone (M-RECP.8 / AUT-286). Same shape + silent-failure semantics as crate::camera_ipc::open_settings_camera.
open_settings_microphone_js
__screenOpenSettingsMicrophone() (M-RECP.8 / AUT-286) — shells out to open System Settings → Privacy & Security → Microphone.
start_mic_capture
Async helper: kick off start_mic_capture for the given mic id.
start_mic_capture_js
__screenStartMicCapture(micId) — returns Promise<void>.
stop_mic_capture
Async helper: tear down the active mic worker.
stop_mic_capture_js
__screenStopMicCapture() — returns Promise<void>.
subscribe_mic_level
Subscribe to the mic-level Tauri event (M-AUDIO.METER / AUT-287) emitted by MicCapturePipeline at ~20 Hz. The handler receives an EMA-smoothed RMS in [0.0, ~1.0].