* Stop only audio capture. * Works on desktop (macOS) and iOS.
()
| 1369 | * Works on desktop (macOS) and iOS. |
| 1370 | */ |
| 1371 | async stopAudio(): Promise<void> { |
| 1372 | if (!isTauri()) { |
| 1373 | throw new Error('Audio capture only available in Tauri'); |
| 1374 | } |
| 1375 | |
| 1376 | try { |
| 1377 | if (isDesktop()) { |
| 1378 | await invoke('sc_stop_audio'); |
| 1379 | } else { |
| 1380 | // iOS: Stop audio stream and broadcast |
| 1381 | await invoke('stop_audio_stream_cmd'); |
| 1382 | await invoke('plugin:screen-capture|stop_capture_cmd'); |
| 1383 | } |
| 1384 | this.latestAudioData = null; |
| 1385 | } catch (error) { |
| 1386 | throw error; |
| 1387 | } |
| 1388 | } |
| 1389 | |
| 1390 | /** |
| 1391 | * Unified status + frame query - the single source of truth for broadcast state. |