ssh199956 / flutter_kdxf_sst_nrt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fl_kdxf_sst_rt

As shown in the figure below:

Welcome to my personal website:https://www.sshlearning.cn

Welcome to my github and invite you to build more:https://github.com/ssh199956

Welcome to my personal blog:https://blog.sshlearning.cn

Welcome to follow my document content:https://data.sshlearning.cn

Welcome to the static e-commerce website made during my study:https://shenfeng.sshlearning.cn

Getting started

A Flutter plugin that supports KDXF for Streaming Speech Recognition , suitable for Android, iOS and other platforms.

Usage

//'Attention, set this content first before using all content'
setKDXFInfo("", "", "", "");
class WsWidgetPage extends StatefulWidget {
  @override
  _WsWidgetPageState createState() => _WsWidgetPageState();
}

class _WsWidgetPageState extends State<WsWidgetPage>
    with KDXFBaseSpeechRecognitionMixin {
  @override
  void initState() {
    super.initState();
    //this is your keys of kdxf.
    setKDXFInfo("", "", "", "");
    KDXFInit();
  }

  @override
  void dispose() {
    KDXFDispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('讯飞语音转文字测试'),
      ),
      body: Column(
        children: [
          ElevatedButton(
            onPressed: () async {
              await SoundRecord.startListening();
              updateMsg = "录音中..";
            },
            child: Text('开始录音'),
          ),
          ElevatedButton(
            onPressed: KDXFStopListening,
            child: Text('停止录音'),
          ),
          Container(
            height: 20,
          ),
          Center(child: Text(showMsg)),
        ],
      ),
    );
  }
}

About

License:MIT License


Languages

Language:Dart 43.7%Language:C++ 26.4%Language:CMake 20.5%Language:C 2.4%Language:Swift 2.3%Language:HTML 1.7%Language:Ruby 1.5%Language:Kotlin 1.4%Language:Objective-C 0.0%