科大讯飞语音识别插件 A plugin for xunfei dictation for iOS and Android.

Overview

xfvoice

科大讯飞语音识别插件 A plugin for xunfei dictation for iOS and Android.

Install

First, add xfvoice as a dependency in your pubspec.yaml file.

Setting

Set privacy on iOS in Info.plist


   
    NSMicrophoneUsageDescription
   

   

   
    NSLocationUsageDescription
   

   

   
    NSLocationAlwaysUsageDescription
   

   

   
    NSContactsUsageDescription
   

   

Set privacy on Android in AndroidManifest.xml

">


  


  


  


  


  


  


  


  


  


  



  


  

Usage

final voice = XFVoice.shared;
voice.init(appIdIos: 'the app id for ios', appIdAndroid: 'the app id for android');
  • Set the parameter. Class XFVoiceParam is usefull.
    // 请替换成你的appid
    voice.init(appIdIos: '5d133a41', appIdAndroid: '5d133aae');
    final param = new XFVoiceParam();
    param.domain = 'iat';
    // param.asr_ptt = '0';   //取消注释可去掉标点符号
    param.asr_audio_path = 'audio.pcm';
    param.result_type = 'json'; //可以设置plain
    final map = param.toMap();
    map['dwa'] = 'wpgs';        //设置动态修正,开启动态修正要使用json类型的返回格式
    voice.setParameter(map);
  • Start dictation. Use XFVoiceListener for listen on the callback.
final listener = XFVoiceListener(
      onVolumeChanged: (volume) {
        print('$volume');
      },
      onResults: (String result, isLast) {
        print(result.toString());
      },
      onCompleted: (Map
   
     errInfo, String filePath) {
        print('onCompleted');
      }
    );
voice.start(listener: listener);

   

The result type is based on the parameter result_type you setted before. It may be json/xml/plain.

  • Stop dictate.
voice.stop();

Important

The binary downloaded from xunfei is bind with you appid.
So, when you use this plugin, you should replace the binary in both Android and iOS project.

iOS

xfvoice/ios/Frameworks/iflyMSC.framework

Android

xfvoice/android/libs/Msc.jar
You might also like...
AudioPlayer is a simple class for playing audio in iOS, macOS and tvOS apps.
AudioPlayer is a simple class for playing audio in iOS, macOS and tvOS apps.

AudioPlayer AudioPlayer is a simple class for playing audio in iOS, macOS and tvOS apps.

Soundable is a tiny library that uses AVFoundation to manage the playing of sounds in iOS applications in a simple and easy way

Soundable is a tiny library that uses AVFoundation to manage the playing of sounds in iOS applications in a simple and easy way. You can play

Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS
Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

AudioKit AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS (including Catalyst), and tvOS. Installation To add AudioKit

Painless high-performance audio on iOS and Mac OS X

An analgesic for high-performance audio on iOS and OSX. Really fast audio in iOS and Mac OS X using Audio Units is hard, and will leave you scarred an

A sound fader for AVAudioPlayer written in Swift for iOS, tvOS and macOS.
A sound fader for AVAudioPlayer written in Swift for iOS, tvOS and macOS.

Cephalopod, a sound fader for AvAudioPlayer written in Swift - iOS, tvOS and macOS This library can help fading sounds in and out with AvAudioPlayer.

Audio Filters on iOS and OSX

Audio Filters on iOS and OSX Implement high quality audio filters with just a few lines of code and Novocaine, or your own audio library of choice. NV

🅿️ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.
🅿️ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.

Made by Applikey Solutions Find this project on Dribbble Table of Contents Purpose Features Supported OS & SDK Versions Installation Usage Demo Releas

An original digital art work for macOS, iOS and web
An original digital art work for macOS, iOS and web

WordClock WordClock versions of various vintages, for various platforms. https://www.simonheys.com/wordclock/ Downloads Currently avaiaible to downloa

iOS framework that enables detecting and handling voice commands using microphone.

iOS framework that enables detecting and handling voice commands using microphone. Built using Swift with minumum target iOS 14.3.

Owner
canyonwan
https://github.com/canyonwan
canyonwan
AudiosPlugin is a Godot iOS Audio Plugin that resolves the audio recording issue in iOS for Godot Engine.

This plugin solves the Godot game engine audio recording and playback issue in iOS devices. Please open the Audios Plugin XCode Project and compile the project. You can also use the libaudios_plugin.a binary in your project.

null 3 Dec 22, 2022
Titanium Amplitude - Use the native Amplitude iOS/Android SDK in Titanium

Titanium Amplitude Module A lightweight module to use the native Amplitude SDK's in Titanium. Example import Amplitude from 'ti.amplitude'; // Initia

Hans Knöchel 6 Jan 14, 2022
An iOS app that visually clones Spotify's app and consumes the official Spotify's Web API to show(and play) songs, podcasts, artists and more.

SpotifyClone An iOS app that visually clones Spotify's app and consumes the official Spotify's Web API to show(and play) songs, podcasts, artists and

null 104 Jan 7, 2023
AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS, and tvOS.

AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS (including Catalyst), and tvOS. Installation To add AudioKit

AudioKit 9.5k Dec 31, 2022
Voice Memos is an audio recorder App for iPhone and iPad that covers some of the new technologies and APIs introduced in iOS 8 written in Swift.

VoiceMemos Voice Memos is a voice recorder App for iPhone and iPad that covers some of the new technologies and APIs introduced in iOS 8 written in Sw

Zhouqi Mo 322 Aug 4, 2022
Extensions and classes in Swift that make it easy to get an iOS device reading and processing MIDI data

MorkAndMIDI A really thin Swift layer on top of CoreMIDI that opens a virtual MIDI destination and port and connects to any MIDI endpoints that appear

Brad Howes 11 Nov 5, 2022
An iOS and macOS audio visualization framework built upon Core Audio useful for anyone doing real-time, low-latency audio processing and visualizations.

A simple, intuitive audio framework for iOS and OSX. Deprecated EZAudio has recently been deprecated in favor of AudioKit. However, since some people

Syed Haris Ali 4.9k Jan 2, 2023
MusicKit is a framework and DSL for creating, analyzing, and transforming music in Swift.

MusicKit MusicKit is a framework and DSL for creating, analyzing, and transforming music in Swift. Examples Functional harmony let C5 = Pitch(midi: 72

Ben Guo 591 Oct 18, 2022
What is eCortex? A informative tool to manage and organize thoughts and ideas sparked through out the day into custom categories.

eCortex What is eCortex? A informative tool to manage and organize thoughts and ideas sparked through out the day into custom categories. What problem

Myra 21 May 11, 2022
Nobetci Eczacim is open-source App Store Application which users can get pharmacy information and location easily and safely.

Pharmacy-On-Duty Nobetci Eczacim Project Description This project designed for make it easier for people to search for a pharmacy on duty. App Store A

Mert Demirtas 5 Sep 19, 2022