Skip to main content

Module system_audio_ipc

Module system_audio_ipc 

Source
Expand description

JS-bridge bindings for the M-AUDIO-SYS.2 / AUT-282 system-audio commands.

Mirrors crate::camera_ipc / crate::mic_ipc for the per-app speaker-capture path. Each function invokes a __screen* helper in index.html’s inline script, which wraps window.__TAURI__.core.invoke(...).

StructsΒ§

AudioAppView
Mirror of crates/app/src/commands.rs::AudioAppView (M-AUDIO-SYS.2).

EnumsΒ§

AudioAppFilterView
Mirror of crates/app/src/commands.rs::AudioAppFilterView. The tagged-enum serde shape lets the Tauri command pick one of the three filter modes without an extra mode: String field.
ListAudioAppsResult
Result shape carrying either the typed list or a string error so the picker can render the error inline.

FunctionsΒ§

js_error_string πŸ”’
Best-effort: turn a JsValue error into a human-readable string for inline display in the picker.
list_audio_apps
Async helper: enumerate every running app SCK can see.
list_audio_apps_js
__screenListAudioApps() β€” returns Promise<AudioAppView[]> or rejects with a string error.
open_settings_screen_recording
Async helper: shell out to open System Settings β†’ Screen Recording (M-RECP.6 / AUT-272). Silently no-ops outside Tauri and silently swallows spawn errors β€” same shape as the other deep-link helpers.
open_settings_screen_recording_js
__screenOpenSettingsScreenRecording() (M-RECP.6 / AUT-272) β€” shells out to open System Settings β†’ Privacy & Security β†’ Screen Recording. macOS only; Linux/Windows no-op.
request_screen_recording_permission
Async helper: trigger Screen Recording TCC before opening Settings. After tccutil reset ScreenCapture, this call is what makes macOS recreate the app row in the Screen & System Audio Recording list.
request_screen_recording_permission_js
__screenRequestScreenRecordingPermission() β€” triggers the macOS Screen & System Audio Recording TCC request.
set_system_audio_filter
Async helper: apply a per-app filter.
set_system_audio_filter_js
__screenSetSystemAudioFilter(filter) β€” returns Promise<void> or rejects with a string error.
start_system_audio_capture
Async helper: start the system-audio session. Returns Ok(()) or Err(message) where the message is the SCK error description.
start_system_audio_js
__screenStartSystemAudio() β€” returns Promise<void> or rejects with a string error.
stop_system_audio_capture
Async helper: stop the active session.
stop_system_audio_js
__screenStopSystemAudio() β€” returns Promise<void>.
subscribe_system_audio_level
Subscribe to the system-audio-level Tauri event (M-AUDIO.METER / AUT-287) emitted by the SCK delegate at the stream’s natural buffer rate (~20-100 Hz). Handler receives an EMA-smoothed master-stream RMS in [0.0, ~1.0]. Mirror of crate::mic_ipc::subscribe_mic_level.
system_audio_status
Async helper: status snapshot. true when a session is up.
system_audio_status_js
__screenSystemAudioStatus() β€” returns Promise<boolean>.