| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import 'dart:async';
- import 'package:flutter/services.dart';
- class SpeechPlugin {
- static const MethodChannel _channel =
- const MethodChannel('speech_plugin');
- static final SpeechPlugin _instance = SpeechPlugin();
- static SpeechPlugin get instance => _instance;
- static Future<String> get platformVersion async {
- final String version = await _channel.invokeMethod('getPlatformVersion');
- return version;
- }
- Future<void> initSdk() {
- return _channel.invokeMethod("initSpeechSdk");
- }
- Future<Map> evaluatorByAudio(String pathEvaluatorDecode, int index, String videoId, String recordPath, String en) {
- return _channel.invokeMethod("evaluatorByAudio", {
- "pathEvaluatorDecode": pathEvaluatorDecode,
- "index": index,
- "videoId": videoId,
- "recordPath": recordPath,
- "en": en
- });
- }
- Future<Map> evaluatorByMp4(String pathEvaluatorDecode, int index, String videoId, String recordPath, String en) {
- return _channel.invokeMethod("evaluatorByMp4", {
- "pathEvaluatorDecode": pathEvaluatorDecode,
- "index": index,
- "videoId": videoId,
- "recordPath": recordPath,
- "en": en
- });
- }
- }
|