audio.AudioRecorderOptions
Chooses the file an audio recorder writes, its quality, and whether it measures the input level while it records.
Utilização
Configure a component-owned voice recorder.
Este tipo é usado por 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().Declaração do tipo
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;
};Membros 4
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
scope | typeof appModule | Não | — |
format | Format | Não | Defaults to 'aac'. |
quality | Quality | Não | Sample rate, channels and bit rate (docs/audio.md). Defaults to 'high'. |
metering | boolean | Não | Measures the input level into level. Defaults to false. |
scope — campos aninhados
scope campos
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
watch | <E extends keyof Events>(event: E, listener: Events[E]) => EventSubscription | Sim | 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> | Sim | 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. Predefinição: AppStateModule.state |
openSettings | () => Promise<void> | Sim | Opens this app's page in the system Settings. Predefinição: AppStateModule.openSettings |
watch — assinaturas de método
Assinaturas
<E extends keyof Events>(event: E, listener: Events[E]): EventSubscriptionParâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
E | "memoryWarning" | — |
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
event | E | Sim | — |
listener | Events[E] | Sim | — |
Devolve
openSettings — assinaturas de método
Assinaturas
(): Promise<void>Parâmetros
Sem parâmetros.
Devolve
Promise<void>
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.