stopCalibration method
Implementation
Future<Map<String, dynamic>> stopCalibration(
String apiKey,
) async {
recorder.hasPermission();
Map<String, dynamic> resultStopRecord = {
'status': false,
'content': null,
'percent_result': 0,
};
try {
Map<String, dynamic> transcript =
await RecordService(recorder: recorder).stopRecord(apiKey, language);
if (transcript["status"] == false) return transcript;
Map<String, dynamic> speechToTextResult =
await _service.getEncoder(apiKey, transcript['transcript'], baseText);
print(speechToTextResult);
if (speechToTextResult["status"]) {
return speechToTextResult;
}
return resultStopRecord;
} catch (e) {
return resultStopRecord;
}
}