audio.AudioRecorderOptions
Chooses the file an audio recorder writes, its quality, and whether it measures the input level while it records.
Verwendung
Configure a component-owned voice recorder.
Dieser Typ wird verwendet von 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().Typdeklaration
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;
};Mitglieder 4
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
scope | typeof appModule | Nein | — |
format | Format | Nein | Defaults to 'aac'. |
quality | Quality | Nein | Sample rate, channels and bit rate (docs/audio.md). Defaults to 'high'. |
metering | boolean | Nein | Measures the input level into level. Defaults to false. |
scope — verschachtelte Felder
scope Felder
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
watch | <E extends keyof Events>(event: E, listener: Events[E]) => EventSubscription | Ja | 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> | Ja | 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. Standard: AppStateModule.state |
openSettings | () => Promise<void> | Ja | Opens this app's page in the system Settings. Standard: AppStateModule.openSettings |
watch — Methodensignaturen
Signaturen
<E extends keyof Events>(event: E, listener: Events[E]): EventSubscriptionTypparameter
| Name | Einschränkung | Standard |
|---|---|---|
E | "memoryWarning" | — |
Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | E | Ja | — |
listener | Events[E] | Ja | — |
Rückgabe
openSettings — Methodensignaturen
Signaturen
(): Promise<void>Parameter
Keine Parameter.
Rückgabe
Promise<void>
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.