> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simular.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Microphone

> A []'s default microphone, recording in a fixed .

A \[`Machine`]'s default microphone, recording in a fixed
`AudioFormat`.

Obtain via \[`Machine.microphone`]. The stream records from the moment
it is opened and stops when the handle is garbage-collected; collect
fixed-size chunks with `record()`.

## Constructor

```typescript
Microphone(): Microphone
```

### Returns

`Microphone`

## Properties

<ResponseField name={"channels"} type={"number"} required>
  Number of interleaved channels (1 = mono, 2 = stereo).
</ResponseField>

<ResponseField name={"sampleRate"} type={"number"} required>
  Samples per second per channel (e.g. 44100, 48000).
</ResponseField>

## Methods

### record()

```typescript
record(durationMs: number): SamplesBuffer
```

Blocks for exactly `duration_ms` and returns the captured audio as
a `SamplesBuffer`. Call repeatedly to stream fixed-size chunks.

#### Parameters

<ResponseField name={"durationMs"} type={"number"} required />

#### Returns

`SamplesBuffer`
