processFile method
Processes given audio data and returns its transcription.
path
Absolute path to the audio file. The supported formats are: 3gp (AMR)
, FLAC
,
MP3
, MP4/m4a (AAC)
, Ogg
, WAV
and WebM
.
returns LeopardTranscript object which contains the transcription results of the engine.
Implementation
Future<LeopardTranscript> processFile(String path) async {
try {
Map<String, dynamic> result = Map<String, dynamic>.from(await _channel
.invokeMethod(_NativeFunctions.PROCESSFILE.name,
{'handle': _handle, 'path': path}));
return _pluginResultToLeopardTranscript(result);
} on PlatformException catch (error) {
throw leopardStatusToException(error.code, error.message);
} on Exception catch (error) {
throw LeopardException(error.toString());
}
}