> For the complete documentation index, see [llms.txt](https://canardoux.gitbook.io/tau/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://canardoux.gitbook.io/tau/doc/pages/tau-api/recorder/start_recorder.md).

# The τ Recorder API

startRecorder()

## `startRecorder()`

* Dart API: [startRecorder](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/recorder/pages/flutter-sound/api/recorder/FlutterSoundRecorder/startRecorder.html)

You use `startRecorder()` to start recording in an open session. `startRecorder()` has the destination file path as parameter. It has also 7 optional parameters to specify :

* codec: The codec to be used. Please refer to the [Codec compatibility Table](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/recorder/guides_codec/README.md) to know which codecs are currently supported.
* toFile: a path to the file being recorded
* toStream: if you want to record to a Dart Stream. Please look to [the following notice](https://github.com/Canardoux/tau/tree/6bd245d293bcf9a123677735835549585d32b2ee/doc/pages/tau-api/recorder/guides_record_stream/README.md). **This new functionnality needs, at least, Android SDK >= 21 (23 is better)**
* sampleRate: The sample rate in Hertz
* numChannels: The number of channels (1=monophony, 2=stereophony)
* bitRate: The bit rate in Hertz
* audioSource : possible value is :
  * defaultSource
  * microphone
  * voiceDownlink *(if someone can explain me what it is, I will be grateful ;-) )*

[path\_provider](https://pub.dev/packages/path_provider) can be useful if you want to get access to some directories on your device.

Flutter Sound does not take care of the recording permission. It is the App responsability to check or require the Recording permission. [Permission\_handler](https://pub.dev/packages/permission_handler) is probably useful to do that.

*Example:*

[Dart](/tau/doc/pages/tau-api/recorder/start_recorder.md#dart)

[Javascript](/tau/doc/pages/tau-api/recorder/start_recorder.md#javascript)

```

    // Request Microphone permission if needed
    PermissionStatus status = await Permission.microphone.request();
    if (status != PermissionStatus.granted)
            throw RecordingPermissionException("Microphone permission not granted");

    Directory tempDir = await getTemporaryDirectory();
    File outputFile = await File ('${tempDir.path}/flutter_sound-tmp.aac');
    await myRecorder.startRecorder(toFile: outputFile.path, codec: t_CODEC.CODEC_AAC,);
```

```

        Lorem ipsum ...
```

\</div>
