Microphone

Microphone capture is sensitive and should be explicit. The shared app asks for a bounded recording; the host owns device selection, permission, capture, encoding, and cancellation.
This reference is for the exact API shape. If you are wiring the feature into an app for the first time, start with the Microphone guide, then return here when you need operation names, request types, provider contracts, or platform configuration details.

Public API

Item
Value
Effect helper or entrypoint
ctx.effects.microphone()
Provider trait or host contract
MicrophoneHost
Test provider or test entrypoint
MemoryMicrophoneHost
Primary request types
MicrophonePermissionRequest / MicrophoneCaptureRequest
Primary success types
MicrophoneAvailability / MicrophonePermission / MicrophoneCapture
Error type
MicrophoneError
CLI value
microphone

Operations

Method or operation
Purpose
Request
Success
availability
Read microphone permission and visible input devices.
()
MicrophoneAvailability
request_permission
Ask the host to request microphone permission.
MicrophonePermissionRequest
MicrophonePermission
capture_audio
Capture a bounded audio sample as a stream.
MicrophoneCaptureRequest
MicrophoneCapture
cancel_capture
Cancel an active recording.
()
()

Provider contract

Register a MicrophoneHost with .with_microphone_host(...). Use MemoryMicrophoneHost in tests. Providers should keep capture bounded and return typed errors for denied permission, no input devices, and unsupported formats.
MicrophoneCapture returns a DataStreamId plus metadata such as byte length, content type, sample rate, channel count, sample format, and duration. The provider should register the audio stream through CapabilityCtx::register_data_stream(...); reducers should pass that handle to a job or service for decoding, upload, or storage.
Providers should return typed errors for unsupported operations, denied permissions, unavailable hardware, cancellation, timeouts, and platform policy restrictions. Silent success is not acceptable because reducers need a truthful result to update state and explain what happened.

Platform configuration

The CLI adds Android RECORD_AUDIO and iOS NSMicrophoneUsageDescription. Packaged macOS apps need microphone usage text, and Windows packages may need microphone capability metadata.
When a CLI value exists, fission add-capability <value> --project-dir . records the capability in fission.toml and updates generated target files where Fission can do that deterministically. Android generated configuration lives in platforms/android/AndroidManifest.xml. iOS generated configuration lives in platforms/ios/Info.plist and platforms/ios/Entitlements.plist when entitlements are required. Desktop package metadata is reviewed during packaging because Windows, macOS, and Linux use different permission and distribution systems.

Runtime behavior

Capability calls are queued from reducers through ctx.effects. The active shell resolves the request with the registered provider and then dispatches the configured success or error action. Missing providers should produce typed unsupported errors. Packaging mistakes usually show up as denied permissions, missing entitlements, missing route registration, or provider-specific failures.
Fission
A cross-platform, GPU-accelerated user interface framework for Rust. MIT licensed.
Copyright (c) 2026 Fission
Ready to use today. Widget APIs are expected to remain stable; some runtime and shell APIs may change before 1.0.0.
Fission 0.7.0