├── .gitignore ├── README.md ├── demo ├── app │ ├── App_Resources │ │ └── Android │ │ │ ├── AndroidManifest.xml │ │ │ ├── app.gradle │ │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── app-root.xml │ ├── app.css │ ├── app.ts │ ├── main-page.ts │ ├── main-page.xml │ ├── main-view-model.ts │ └── tests │ │ └── tests.js ├── karma.conf.js ├── nativescript.config.ts ├── package-lock.json ├── package.json ├── references.d.ts └── tsconfig.json ├── src ├── .npmignore ├── index.d.ts ├── package-lock.json ├── package.json ├── platforms │ └── android │ │ ├── AndroidManifest.xml │ │ └── include.gradle ├── references.d.ts ├── speech-recognition-vosk-jni.d.ts ├── speech-recognition-vosk.android.ts └── tsconfig.json └── tslint.json /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .idea/ 3 | .DS_Store 4 | *.js 5 | *.js.map 6 | *.log.* 7 | src/**/*.d.ts 8 | src/platforms/android/*.aar 9 | !src/index.d.ts 10 | !src/references.d.ts 11 | !src/speech-recognition-vosk-jni.d.ts 12 | !demo/karma.conf.js 13 | !demo/app/tests/*.js 14 | demo/**/*.d.ts 15 | !demo/references.d.ts 16 | demo/platforms 17 | demo/.nsbuildinfo 18 | node_modules 19 | publish/src 20 | publish/package 21 | demo/report/report.html 22 | demo/report/stats.json 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NativeScript Speech Recognition with Vosk Library 2 | 3 | [![Build Status][build-status]][build-url] 4 | [![NPM version][npm-image]][npm-url] 5 | [![Downloads][downloads-image]][npm-url] 6 | [![Twitter Follow][twitter-image]][twitter-url] 7 | 8 | [build-status]:https://travis-ci.org/alphacep/nativescript-vosk.svg?branch=master 9 | [build-url]:https://travis-ci.org/alphacep/nativescript-vosk 10 | [npm-image]:http://img.shields.io/npm/v/nativescript-vosk.svg 11 | [npm-url]:https://npmjs.org/package/nativescript-vosk 12 | [downloads-image]:http://img.shields.io/npm/dm/nativescript-vosk.svg 13 | [twitter-image]:https://img.shields.io/twitter/follow/alphacep.svg?style=social&label=Follow%20me 14 | [twitter-url]:https://twitter.com/alphacep 15 | 16 | This is a plugin for offline speech recognition in NativeScript library using [Vosk](https://github.com/alphacep/vosk-api) library. 17 | 18 | See the [demo](https://github.com/alphacep/nativescript-vosk/tree/master/demo) in action. 19 | 20 | ## Installation 21 | 22 | From the command prompt go to your app's root folder and execute: 23 | 24 | ```bash 25 | ns plugin add nativescript-vosk 26 | ``` 27 | 28 | ## Platforms 29 | 30 | We support only Android for now, iOS will be added some time 31 | 32 | # Thanks 33 | 34 | This demo is largely based on the code of https://github.com/EddyVerbruggen/nativescript-speech-recognition 35 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | android { 2 | defaultConfig { 3 | minSdkVersion 21 4 | targetSdkVersion 29 5 | generatedDensities = [] 6 | applicationId = "org.vosk.demo.nativescript" 7 | } 8 | aaptOptions { 9 | additionalParameters "--no-version-vectors" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphacep/nativescript-vosk/5fa5547ac59982c47e1a05f9b66b9d3b831e520a/demo/app/App_Resources/Android/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphacep/nativescript-vosk/5fa5547ac59982c47e1a05f9b66b9d3b831e520a/demo/app/App_Resources/Android/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alphacep/nativescript-vosk/5fa5547ac59982c47e1a05f9b66b9d3b831e520a/demo/app/App_Resources/Android/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Vosk NS Demo 4 | 5 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 27 | 28 | 29 | 34 | 35 | 37 | 38 | -------------------------------------------------------------------------------- /demo/app/app-root.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | @import "@nativescript/theme/css/core.css"; 2 | @import "@nativescript/theme/css/default.css"; 3 | -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | import { Application } from "@nativescript/core"; 2 | 3 | Application.run({moduleName: "app-root"}); -------------------------------------------------------------------------------- /demo/app/main-page.ts: -------------------------------------------------------------------------------- 1 | import { NavigatedData, Page } from "@nativescript/core"; 2 | import { VoskDemoModel } from "./main-view-model"; 3 | 4 | export function navigatingTo(args: NavigatedData) { 5 | // Get the event sender 6 | const page = args.object; 7 | page.bindingContext = new VoskDemoModel(); 8 | } 9 | -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |