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

# transcribe()

> Convert speech to text

```ts theme={null}
const transcription = await RunAnywhere.stt.transcribe(RunAnywhere.audio.wav(bytes))

console.log(transcription.text)
```

## Signature

```ts theme={null}
transcribe(input: AudioInput, options?: SttOptions): Promise<Transcription>
```

## Building an AudioInput

Input constructors hang off the facade as `RunAnywhere.audio`, so renderer code builds the same
values main-process code does:

```ts theme={null}
RunAnywhere.audio.pcm16(bytes, sampleRate?, channels?)
RunAnywhere.audio.float32(samples, sampleRate?, channels?)
RunAnywhere.audio.wav(bytes)
RunAnywhere.audio.file(path)
```

`file` is the desktop path: point it at a recording on disk with no reading step of your own.

```ts theme={null}
import { readFile } from 'node:fs/promises'

const transcription = await RunAnywhere.stt.transcribe(RunAnywhere.audio.file(path))
```

## With options

```ts theme={null}
const transcription = await RunAnywhere.stt.transcribe(audio, {
  language: 'en',
  punctuation: true,
  wordTimestamps: true,
})
```

See [STT options](/electron/stt/options).

## Checking readiness

```ts theme={null}
const state = await RunAnywhere.stt.state()
```

## Microphone permission

On macOS, recording needs `NSMicrophoneUsageDescription` in the app's Info.plist and the user's
consent. Electron surfaces the prompt on first use, and a denial is permanent until the user
changes it in System Settings, so handle the refusal rather than retrying.
