-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:flutter/services.dart'; | ||
|
||
class AsrManager { | ||
static const MethodChannel _channel = const MethodChannel('asr_plugin'); | ||
|
||
/// 初始化 | ||
static Future<String> init() async { | ||
return await _channel.invokeMethod('init'); | ||
} | ||
|
||
/// 开始录音 | ||
static Future<String> start({Map params}) async { | ||
return await _channel.invokeMethod('start', params ?? {}); | ||
} | ||
|
||
/// 停止录音 | ||
static Future<String> stop() async { | ||
return await _channel.invokeMethod('stop'); | ||
} | ||
|
||
/// 取消录音 | ||
static Future<String> cancel() async { | ||
return await _channel.invokeMethod('cancel'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters