AudioRecorderOptions
Chooses the file an audio recorder writes, its quality, and whether it measures the input level while it records.
Utilisation
Configure a component-owned voice recorder.
Ce type est utilisé par 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().Déclaration du type
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;
};Membres 4
| Nom | Type | Requis | Description |
|---|---|---|---|
scope | typeof appModule | Non | — |
format | Format | Non | Defaults to 'aac'. |
quality | Quality | Non | Sample rate, channels and bit rate (docs/audio.md). Defaults to 'high'. |
metering | boolean | Non | Measures the input level into level. Defaults to false. |
scope — champs imbriqués
scope champs
| Nom | Type | Requis | Description |
|---|---|---|---|
watch | <E extends keyof Events>(event: E, listener: Events[E]) => EventSubscription | Oui | 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> | Oui | 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. Par défaut: AppStateModule.state |
openSettings | () => Promise<void> | Oui | Opens this app's page in the system Settings. Par défaut: AppStateModule.openSettings |
watch — signatures de méthode
Signatures
<E extends keyof Events>(event: E, listener: Events[E]): EventSubscriptionParamètres de type
| Nom | Contrainte | Par défaut |
|---|---|---|
E | "memoryWarning" | — |
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | E | Oui | — |
listener | Events[E] | Oui | — |
Retourne
openSettings — signatures de méthode
Signatures
(): Promise<void>Paramètres
Aucun paramètre.
Retourne
Promise<void>
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.