> ## 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 on-device

```dart theme={"theme":"css-variables"}
final transcription = await RunAnywhere.stt.transcribe(
  AudioInput.wav(bytes),
);

print(transcription.text);
```

## Signature

```dart theme={"theme":"css-variables"}
Future<Transcription> transcribe(AudioInput audio, {SttOptions? options})
```

## Building an AudioInput

Dart factory constructors:

```dart theme={"theme":"css-variables"}
AudioInput.pcm16(...)
AudioInput.float32(...)
AudioInput.wav(Uint8List bytes)
```

```dart theme={"theme":"css-variables"}
import 'dart:io';

final bytes = await File(path).readAsBytes();
final transcription = await RunAnywhere.stt.transcribe(AudioInput.wav(bytes));
```

## With options

```dart theme={"theme":"css-variables"}
final transcription = await RunAnywhere.stt.transcribe(
  AudioInput.wav(bytes),
  options: SttOptions(
    language: 'en',
    punctuation: true,
    wordTimestamps: true,
  ),
);
```

See [STT options](https://docs.runanywhere.ai/flutter/stt/options.md).

## Checking readiness

```dart theme={"theme":"css-variables"}
final state = await RunAnywhere.stt.state();
```

## Permission

Recording needs the microphone permission at runtime on both platforms. Request it before
calling into the SDK; a denied permission surfaces as a `SDKException`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.