> For the complete documentation index, see [llms.txt](https://ftech.gitbook.io/fstt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ftech.gitbook.io/fstt/ios-fstt-sdk/2.-fstt-sdk-features.md).

# 2. FSTT SDK features

**init SDK**

```swift
FTechSSTManager.instance().initSDK(appId: "", key: "")
```

| Param | Type   | Description    |
| ----- | ------ | -------------- |
| appId | String | Application id |
| key   | String | Secret key     |

Contact us for get `app_id` & `secret_key`

**Register callback**

```swift
FTechSSTManager.instance().delegate = self
```

**Implement `FTechSSTManagerDelegate`**

* After registration, the SDK will return the corresponding status in the callback.

| status       | Description                                            |
| ------------ | ------------------------------------------------------ |
| onStart      | Called at start record                                 |
| onRecording  | Called while in process recording                      |
| onCompletion | Called when completed record process and return result |
| onFailure    | Called when an error occurs in process recording       |

```swift
extension ViewController: FTechSSTManagerDelegate {
    func onStart() {
    }
    
    func onRecording() {
    }
    
    func onCompletion(data: STTResponse) {
    }
    
    func onFailure(error: FTError) {
    }
}
```

**Start STT**

* Used to start record for STT
* When successful start, the SDK starts entering the recording state, it will be called on onStart() in callback. Handling start record successfully here.
* When start record fails, it will be processed at callback onFailure() in callback

```swift
FTechSSTManager.instance().startRecording()
```

**Stop STT**

* Used to stop record and process record to text result
* When successful, the SDK will be return text result on onCompletion() in callback. Handling stop record successfully here.
* When fails, it will be processed at callback onFailure() in callback.

```swift
FTechSSTManager.instance().stopRecoding()
```
