AudioRecorderOptions
Chooses the file an audio recorder writes, its quality, and whether it measures the input level while it records.
Usage
Configure a component-owned voice recorder.
This type is used by audio.recorder
// Configure a component-owned voice recorder.
import { Button, audio, type RecordingFormat, type RecordingQuality } from 'kuito';
export function Memo() {
const format: RecordingFormat = 'aac';
const quality: RecordingQuality = 'high';
const recorder = audio.recorder({ format, quality });
return <Button onPress={() => void recorder.start().catch(console.error)}>Record</Button>;
}
// Declare microphone permission; finish the file with recorder.stop().Type declaration
export type AudioRecorderOptions = ScopeOptions & {
/** Defaults to `'aac'`. */
format?: RecordingFormat;
/** Sample rate, channels and bit rate (docs/audio.md). Defaults to `'high'`. */
quality?: RecordingQuality;
/** Measures the input level into `level`. Defaults to false. */
metering?: boolean;
};Members 4
| Name | Type | Required | Description |
|---|---|---|---|
scope | typeof appModule | No | — |
format | Format | No | Defaults to 'aac'. |
quality | Quality | No | Sample rate, channels and bit rate (docs/audio.md). Defaults to 'high'. |
metering | boolean | No | Measures the input level into level. Defaults to false. |
scope — nested fields
scope fields
| Name | Type | Required | Description |
|---|---|---|---|
watch | <E extends keyof Events>(event: E, listener: Events[E]) => EventSubscription | Yes | Calls listener when the system warns that memory runs low. In a
component it stops when the component unmounts; elsewhere the returned
subscription stops it. |
state | ReadonlySignal<State> | Yes | Whether the app is in the foreground. Watched, it follows the platform;
starting to observe reports the state the platform starts from, which
catches a change made in between. Default: AppStateModule.state |
openSettings | () => Promise<void> | Yes | Opens this app's page in the system Settings. Default: AppStateModule.openSettings |
watch — method signatures
Signatures
<E extends keyof Events>(event: E, listener: Events[E]): EventSubscriptionType parameters
| Name | Constraint | Default |
|---|---|---|
E | "memoryWarning" | — |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
event | E | Yes | — |
listener | Events[E] | Yes | — |
Returns
openSettings — method signatures
Signatures
(): Promise<void>Parameters
No parameters.
Returns
Promise<void>
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.