├── .eslintrc.js ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── demo ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── app.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── res │ │ │ │ ├── drawable-hdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-ldpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-mdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-nodpi │ │ │ │ └── splash_screen.xml │ │ │ │ ├── drawable-xhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── values-v21 │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── iOS │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── icon-1024.png │ │ │ │ ├── icon-20.png │ │ │ │ ├── icon-20@2x.png │ │ │ │ ├── icon-20@3x.png │ │ │ │ ├── icon-29.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ ├── icon-76.png │ │ │ │ ├── icon-76@2x.png │ │ │ │ └── icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Contents.json │ │ │ │ ├── Default-1125h.png │ │ │ │ ├── Default-568h@2x.png │ │ │ │ ├── Default-667h@2x.png │ │ │ │ ├── Default-736h@3x.png │ │ │ │ ├── Default-Landscape-X.png │ │ │ │ ├── Default-Landscape-XR.png │ │ │ │ ├── Default-Landscape-XS-Max.png │ │ │ │ ├── Default-Landscape.png │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ ├── Default-Portrait-XR.png │ │ │ │ ├── Default-Portrait-XS-Max.png │ │ │ │ ├── Default-Portrait.png │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ ├── Default.png │ │ │ │ └── Default@2x.png │ │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ └── LaunchScreen.AspectFill@3x.png │ │ │ └── LaunchScreen.Center.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ └── LaunchScreen.Center@3x.png │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── build.xcconfig │ ├── 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.json ├── tsconfig.json └── webpack.config.js ├── docs ├── assets │ ├── css │ │ └── main.css │ ├── images │ │ ├── icons.png │ │ ├── icons@2x.png │ │ ├── widgets.png │ │ └── widgets@2x.png │ └── js │ │ ├── main.js │ │ └── search.json ├── classes │ └── tnstexttospeech.html ├── globals.html ├── index.html └── interfaces │ ├── language.html │ └── speakoptions.html ├── lerna.json ├── package.json ├── plugin ├── .npmignore ├── CHANGELOG.md ├── package.json └── platforms │ └── android │ └── native-api-usage.json ├── references.d.ts ├── src ├── index.d.ts ├── texttospeech.android.ts └── texttospeech.ios.ts ├── tsconfig.doc.json └── tsconfig.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['plugin:prettier/recommended'], 3 | plugins: ['prettier', '@typescript-eslint'], 4 | parser: '@typescript-eslint/parser', 5 | parserOptions: { 6 | createDefaultProgram: true, 7 | project: './tsconfig.json', 8 | }, 9 | rules: { 10 | 'prettier/prettier': 'warn', 11 | '@typescript-eslint/adjacent-overload-signatures': 'error', 12 | '@typescript-eslint/array-type': 'error', 13 | '@typescript-eslint/await-thenable': 'error', 14 | '@typescript-eslint/ban-types': 'off', 15 | '@typescript-eslint/class-name-casing': 'off', 16 | '@typescript-eslint/consistent-type-assertions': 'error', 17 | '@typescript-eslint/consistent-type-definitions': 'error', 18 | '@typescript-eslint/explicit-member-accessibility': [ 19 | 'off', 20 | { 21 | accessibility: 'explicit', 22 | }, 23 | ], 24 | '@typescript-eslint/indent': [ 25 | 'error', 26 | 4, 27 | { 28 | FunctionDeclaration: { 29 | parameters: 'first', 30 | }, 31 | FunctionExpression: { 32 | parameters: 'first', 33 | }, 34 | SwitchCase: 1, 35 | }, 36 | ], 37 | '@typescript-eslint/interface-name-prefix': 'off', 38 | '@typescript-eslint/member-delimiter-style': 'error', 39 | '@typescript-eslint/member-ordering': 'off', 40 | '@typescript-eslint/no-empty-function': 'off', 41 | '@typescript-eslint/no-empty-interface': 'off', 42 | '@typescript-eslint/no-explicit-any': 'off', 43 | '@typescript-eslint/no-floating-promises': 'off', 44 | '@typescript-eslint/no-inferrable-types': 'off', 45 | '@typescript-eslint/no-misused-new': 'off', 46 | '@typescript-eslint/no-namespace': 'off', 47 | '@typescript-eslint/no-parameter-properties': 'off', 48 | '@typescript-eslint/no-require-imports': 'off', 49 | '@typescript-eslint/no-unnecessary-qualifier': 'error', 50 | '@typescript-eslint/no-unnecessary-type-assertion': 'error', 51 | '@typescript-eslint/no-use-before-declare': 'off', 52 | '@typescript-eslint/no-var-requires': 'off', 53 | '@typescript-eslint/prefer-for-of': 'off', 54 | '@typescript-eslint/prefer-function-type': 'error', 55 | '@typescript-eslint/prefer-namespace-keyword': 'error', 56 | '@typescript-eslint/quotes': [ 57 | 'error', 58 | 'single', 59 | { 60 | avoidEscape: true, 61 | }, 62 | ], 63 | '@typescript-eslint/semi': ['error'], 64 | '@typescript-eslint/space-within-parens': ['off', 'never'], 65 | '@typescript-eslint/triple-slash-reference': 'off', 66 | '@typescript-eslint/type-annotation-spacing': 'error', 67 | '@typescript-eslint/unified-signatures': 'error', 68 | 'arrow-body-style': 'error', 69 | 'arrow-parens': ['off', 'as-needed'], 70 | camelcase: 'off', 71 | 'capitalized-comments': 'off', 72 | complexity: 'off', 73 | 'constructor-super': 'error', 74 | curly: ['error', 'multi-line'], 75 | 'dot-notation': 'off', 76 | 'eol-last': 'error', 77 | eqeqeq: ['error', 'smart'], 78 | 'guard-for-in': 'off', 79 | 'id-blacklist': ['error', 'any', 'string', 'boolean', 'Undefined'], 80 | 'id-match': 'error', 81 | 'sort-imports': [ 82 | 'error', 83 | { 84 | ignoreCase: false, 85 | ignoreDeclarationSort: true, 86 | ignoreMemberSort: false, 87 | memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], 88 | }, 89 | ], 90 | 'linebreak-style': 'off', 91 | 'max-classes-per-file': 'off', 92 | 'max-len': [ 93 | 'off', 94 | { 95 | ignorePattern: '^import |^export {(.*?)}', 96 | code: 200, 97 | }, 98 | ], 99 | 'new-parens': 'off', 100 | 'newline-per-chained-call': 'off', 101 | 'no-bitwise': 'off', 102 | 'no-caller': 'error', 103 | 'no-cond-assign': 'off', 104 | 'no-console': [ 105 | 'off', 106 | { 107 | allow: [ 108 | 'log', 109 | 'warn', 110 | 'dir', 111 | 'timeLog', 112 | 'assert', 113 | 'clear', 114 | 'count', 115 | 'countReset', 116 | 'group', 117 | 'groupEnd', 118 | 'table', 119 | 'debug', 120 | 'dirxml', 121 | 'error', 122 | 'groupCollapsed', 123 | 'Console', 124 | 'profile', 125 | 'profileEnd', 126 | 'timeStamp', 127 | 'context', 128 | ], 129 | }, 130 | ], 131 | 'no-constant-condition': 'error', 132 | 'no-control-regex': 'off', 133 | 'no-debugger': 'error', 134 | 'no-duplicate-imports': 'error', 135 | 'no-empty': 'off', 136 | 'no-eval': 'off', 137 | 'no-extra-semi': 'off', 138 | 'no-fallthrough': 'error', 139 | 'no-invalid-regexp': 'error', 140 | 'no-invalid-this': 'off', 141 | 'no-irregular-whitespace': 'off', 142 | 'no-multiple-empty-lines': 'off', 143 | 'no-new-wrappers': 'error', 144 | 'no-redeclare': ['error', { builtinGlobals: false }], 145 | 'no-regex-spaces': 'error', 146 | 'no-return-await': 'error', 147 | 'no-shadow': [ 148 | 'off', 149 | { 150 | hoist: 'all', 151 | }, 152 | ], 153 | 'no-throw-literal': 'error', 154 | 'no-trailing-spaces': 'error', 155 | 'no-undef-init': 'error', 156 | 'no-underscore-dangle': 'off', 157 | 'no-unsafe-finally': 'error', 158 | 'no-unused-expressions': [ 159 | 'error', 160 | { 161 | allowTaggedTemplates: true, 162 | allowShortCircuit: true, 163 | }, 164 | ], 165 | 'no-unused-labels': 'error', 166 | 'no-var': 'error', 167 | 'object-shorthand': 'error', 168 | 'one-var': ['off', 'never'], 169 | 'prefer-arrow/prefer-arrow-functions': 'off', 170 | 'prefer-const': 'error', 171 | 'quote-props': 'off', 172 | radix: 'error', 173 | 'space-before-function-paren': 'off', 174 | 'use-isnan': 'error', 175 | 'valid-typeof': 'off', 176 | }, 177 | }; 178 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build CI 2 | 3 | # Trigger the workflow on push 4 | on: [push] 5 | 6 | jobs: 7 | job1: 8 | name: Android Builds 9 | runs-on: macos-latest 10 | steps: 11 | - uses: actions/checkout@v1 12 | - uses: actions/setup-java@v1 13 | with: 14 | java-version: 1.8 15 | 16 | - name: Base Setup 17 | run: npm run ci.base.setup 18 | 19 | - name: Lint 20 | run: npm run ci.tslint 21 | 22 | - name: Build Vanilla Android Demo App 23 | run: npm run ci.vanilla.android.build 24 | 25 | # - name: Install Android sdkmanager 26 | # run: | 27 | # wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip 28 | # sudo unzip -d $ANDROID_HOME android-sdk.zip > /dev/null 29 | # - name: Install required Android tools 30 | # run: | 31 | # echo "y" | sudo $ANDROID_HOME/tools/bin/sdkmanager "ndk;${ANDROID_NDK}" > /dev/null 32 | # - name: Android Test 33 | # run: | 34 | # echo no | android create avd --force -n test -b armeabi-v7a 35 | # emulator -avd test -no-audio -no-window & 36 | # android-wait-for-emulator 37 | # cd src && npm i && npm run tsc && cd ../demo && tns build android 38 | # tns test android --justlaunch 39 | 40 | job2: 41 | name: iOS Builds 42 | runs-on: macos-latest 43 | steps: 44 | - uses: actions/checkout@v1 45 | 46 | - name: Base Setup 47 | run: npm run ci.base.setup && npm run ci.pip.install 48 | 49 | - name: Build Vanilla iOS Demo App 50 | run: npm run ci.vanilla.ios.build 51 | # - name: iOS Test 52 | # run: | 53 | # cd src && npm i && npm run tsc && cd ../demo && tns build ios 54 | # tns test ios --justlaunch 55 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | .idea 31 | 32 | # Thumbnails 33 | ._* 34 | 35 | # Files that might appear on external disk 36 | .Spotlight-V100 37 | .Trashes 38 | 39 | # Directories potentially created on remote AFP share 40 | .AppleDB 41 | .AppleDesktop 42 | Network Trash Folder 43 | Temporary Items 44 | .apdisk 45 | 46 | bin 47 | obj 48 | build/ 49 | .vs 50 | .tscache 51 | *.user 52 | !demo-vue/app/app.js 53 | *.map 54 | !gruntfile.js 55 | node_modules 56 | *.tmp.* 57 | demo*/platforms 58 | lib 59 | !webpack.*.js 60 | !build.esm.js 61 | report 62 | *.log 63 | 64 | *.framework 65 | *.aar 66 | 67 | Pods 68 | *.lock 69 | *.xcworkspace 70 | plugin/**/*.d.ts 71 | /plugin/README.md 72 | package-lock.json 73 | /.vscode 74 | /pnpm-lock.yaml 75 | 76 | .update_backup 77 | .migration_backup 78 | plugin/**/*js.map 79 | plugin/**/*js 80 | pnpm-lock.yaml 81 | hooks 82 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 200, 3 | "semi": true, 4 | "tabWidth": 4, 5 | "singleQuote": true 6 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | ## [3.1.2](https://github.com/nativescript-community/texttospeech/compare/v3.1.1...v3.1.2) (2022-10-12) 7 | 8 | **Note:** Version bump only for package @nativescript-community/texttospeech 9 | 10 | ## [3.1.1](https://github.com/nativescript-community/texttospeech/compare/v3.1.0...v3.1.1) (2022-10-12) 11 | 12 | ### Bug Fixes 13 | 14 | - **ios:** throw error if no voice is found ([a0e9242](https://github.com/nativescript-community/texttospeech/commit/a0e924283978bf4439d458b179a5eb5ade4e28cd)) 15 | 16 | # [3.1.0](https://github.com/nativescript-community/texttospeech/compare/v3.0.8...v3.1.0) (2022-05-18) 17 | 18 | ### Features 19 | 20 | - **android:** native api usage ([dd94c64](https://github.com/nativescript-community/texttospeech/commit/dd94c640b55f446c6e33e540aaf5bdc610064744)) 21 | 22 | ## [3.0.8](https://github.com/nativescript-community/texttospeech/compare/v3.0.7...v3.0.8) (2022-05-18) 23 | 24 | ### Bug Fixes 25 | 26 | - **android:** fix crash on <= 21 ([b4d8edb](https://github.com/nativescript-community/texttospeech/commit/b4d8edbb0e32b0aa3571fc7ffffcdd152b22d596)) 27 | 28 | ## [3.0.7](https://github.com/nativescript-community/texttospeech/compare/v3.0.6...v3.0.7) (2022-05-18) 29 | 30 | ### Bug Fixes 31 | 32 | - **android:** optional optiosn ([b0b7a73](https://github.com/nativescript-community/texttospeech/commit/b0b7a73f790380099d3ba73dbac18665b0d9a0e4)) 33 | 34 | ## [3.0.6](https://github.com/nativescript-community/texttospeech/compare/v3.0.5...v3.0.6) (2022-05-18) 35 | 36 | ### Features 37 | 38 | - **android:** init options to define audioattributes ([99528ba](https://github.com/nativescript-community/texttospeech/commit/99528bad42613cbac6ab7e17cfc9ac232215d2c1)) 39 | 40 | ## [3.0.5](https://github.com/nativescript-community/texttospeech/compare/v3.0.4...v3.0.5) (2022-02-08) 41 | 42 | ### Bug Fixes 43 | 44 | - **ios:** fix related to `sessionMode` ([1dabe18](https://github.com/nativescript-community/texttospeech/commit/1dabe188aa6d4ecc05e1b8d23cd624c3b24270bf)) 45 | 46 | ## [3.0.4](https://github.com/nativescript-community/texttospeech/compare/v3.0.3...v3.0.4) (2022-02-07) 47 | 48 | ### Bug Fixes 49 | 50 | - removed logs ([5e310fe](https://github.com/nativescript-community/texttospeech/commit/5e310fed43543ffcef12ac0a29719a3b621cc68a)) 51 | 52 | ### Features 53 | 54 | - **ios:** allow to customize audio session (for background playback) ([b38b205](https://github.com/nativescript-community/texttospeech/commit/b38b2057faa78564bc70f76fea063fa3b372092c)) 55 | 56 | ## [3.0.3](https://github.com/nativescript-community/texttospeech/compare/v3.0.2...v3.0.3) (2020-11-20) 57 | 58 | ### Bug Fixes 59 | 60 | - andriod init funciton fix ([32e15ae](https://github.com/nativescript-community/texttospeech/commit/32e15ae083dada545348a979e939b4f73ad3d5d5)) 61 | 62 | ## 3.0.2 (2020-11-20) 63 | 64 | # 2.0.0 (2017-08-09) 65 | 66 | ## 1.3.1 (2016-12-05) 67 | 68 | # 1.3.0 (2016-09-23) 69 | 70 | ## 1.1.1 (2015-07-21) 71 | 72 | ## 1.0.2 (2015-05-08) 73 | 74 | ## 1.0.1 (2015-04-19) 75 | 76 | **Note:** Version bump only for package @nativescript-community/texttospeech 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![npm](https://img.shields.io/npm/v/@nativescript-community/texttospeech.svg)](https://www.npmjs.com/package/@nativescript-community/texttospeech) 2 | [![npm](https://img.shields.io/npm/dt/@nativescript-community/texttospeech.svg?label=npm%20downloads)](https://www.npmjs.com/package/@nativescript-community/texttospeech) 3 | 4 | # @nativescript-community/texttospeech :loudspeaker: 5 | 6 | A Text to Speech NativeScript plugin for Android & iOS 7 | 8 | #### Native Controls 9 | 10 | - Android - [TextToSpeech](https://developer.android.com/reference/android/speech/tts/TextToSpeech.html) 11 | - iOS - [AVSpeechSynthesizer](https://developer.apple.com/reference/avfoundation/avspeechsynthesizer) 12 | 13 | ## Installation 14 | 15 | Run the following command from the root of your project: 16 | 17 | ``` 18 | tns plugin add @nativescript-community/texttospeech 19 | ``` 20 | 21 | This command automatically installs the necessary files, as well as stores @nativescript-community/texttospeech as a dependency in your project's package.json file. 22 | 23 | ## Video Tutorial 24 | 25 | [egghead lesson @ https://egghead.io/lessons/typescript-using-text-to-speech-with-nativescript](https://egghead.io/lessons/typescript-using-text-to-speech-with-nativescript) 26 | 27 | ## Usage 28 | 29 | ```js 30 | /// javascript 31 | const TextToSpeech = require('@nativescript-community/texttospeech'); 32 | 33 | /// TypeScript 34 | import { TNSTextToSpeech, SpeakOptions } from '@nativescript-community/texttospeech'; 35 | 36 | const TTS = new TNSTextToSpeech(); 37 | 38 | const speakOptions: SpeakOptions = { 39 | text: 'Whatever you like', /// *** required *** 40 | speakRate: 0.5, // optional - default is 1.0 41 | pitch: 1.0, // optional - default is 1.0 42 | volume: 1.0, // optional - default is 1.0 43 | locale: 'en-GB', // optional - default is system locale, 44 | finishedCallback: Function, // optional 45 | }; 46 | 47 | // Call the `speak` method passing the SpeakOptions object 48 | TTS.speak(speakOptions).then( 49 | () => { 50 | // everything is fine 51 | }, 52 | (err) => { 53 | // oops, something went wrong! 54 | } 55 | ); 56 | ``` 57 | 58 | #### API 59 | 60 | - `speak(options: SpeakOptions): Promise` - start speaking with the given options 61 | - `pause(): void` - pause the speech 62 | - `resume(): void` - resume the speech 63 | - `destroy(): void` - release resources for the speech synthesizer/engine 64 | 65 | - `SpeakOptions = {}` 66 | - `text: string` ** required ** 67 | - `queue?: boolean = false` 68 | - `pitch?: number = 1.0` 69 | - `speakRate?: number = 1.0` 70 | - `volume?: number = 1.0` 71 | - `locale?: string = default system locale or language` 72 | - `finishedCallback?: Function` 73 | 74 | If you wish to set a custom locale, you need to provide a valid BCP-47 code, e.g. `en-US`. If you wish to set only a custom language (without a preferred country code), you need to provide a valid ISO 639-1 language code. 75 | 76 | The plugin checks whether the supplied locale code has the correct syntax but will not prevent setting a nonexistent codes. Please use this feature with caution. 77 | 78 | Example with language code only: 79 | 80 | ```js 81 | const speakOptions: SpeakOptions = { 82 | text: 'Whatever you like', // *** required *** 83 | locale: 'en', // english language will be used 84 | }; 85 | ``` 86 | 87 | Example with locale: 88 | 89 | ```js 90 | const speakOptions: SpeakOptions = { 91 | text: 'Whatever you like', // *** required *** 92 | locale: 'en-AU', // australian english language will be used 93 | }; 94 | ``` 95 | 96 | ### Tip 97 | 98 | - The speech synthesizer takes a moment to initialize on most devices. A simple way to get around this (tested in the demo app) is to create your new instance of the TNSTextToSpeech and then immediately call the `init` method . This will force the synthesizer to "warm up" . Now when you call the `speak` method for your app's functionality it will already have "warmed up" the synthesizer so the delay should be minimal. 99 | It's possible this "Warm up" process could be put into the plugin source itself, I don't have time to do it right now but welcome any contribution that is well tested to make this the default behavior of the synthesizers. 100 | 101 | ### Android Only Methods 102 | 103 | - `getAvailableLanguages(): Promise>;` - returns an array of available languages (use to prevent using non-existing language/local codes) 104 | 105 | ## Credits 106 | 107 | Inspired by James Montemagno's [TextToSpeech Xamarin plugin](https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/TextToSpeech) 108 | 109 | Thanks to [anarchicknight](https://github.com/anarchicknight) for this plugin. 110 | Thanks to [stefalda](https://github.com/stefalda) for his great work on pause/resume and the finishedCallback events :bomb: 111 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // implementation 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | // If you want to add something to be applied before applying plugins' include.gradle files 9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1" 10 | // create a file named before-plugins.gradle in the current directory and place it there 11 | 12 | android { 13 | defaultConfig { 14 | generatedDensities = [] 15 | } 16 | aaptOptions { 17 | additionalParameters "--no-version-vectors" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 21 | 22 | 23 | 31 | 32 | 34 | 35 | 36 | 42 | 43 | 45 | 46 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon-29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "icon-29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon-40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "icon-40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "icon-20.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "icon-20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "icon-29.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "icon-29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "icon-40.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "icon-40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "icon-76.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "icon-76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "icon-83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "icon-1024.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "2688h", 7 | "filename" : "Default-Portrait-XS-Max.png", 8 | "minimum-system-version" : "12.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "2688h", 16 | "filename" : "Default-Landscape-XS-Max.png", 17 | "minimum-system-version" : "12.0", 18 | "orientation" : "landscape", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "1792h", 25 | "filename" : "Default-Portrait-XR.png", 26 | "minimum-system-version" : "12.0", 27 | "orientation" : "portrait", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "extent" : "full-screen", 32 | "idiom" : "iphone", 33 | "subtype" : "1792h", 34 | "filename" : "Default-Landscape-XR.png", 35 | "minimum-system-version" : "12.0", 36 | "orientation" : "landscape", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "extent" : "full-screen", 41 | "idiom" : "iphone", 42 | "subtype" : "2436h", 43 | "filename" : "Default-1125h.png", 44 | "minimum-system-version" : "11.0", 45 | "orientation" : "portrait", 46 | "scale" : "3x" 47 | }, 48 | { 49 | "extent" : "full-screen", 50 | "idiom" : "iphone", 51 | "subtype" : "2436h", 52 | "filename" : "Default-Landscape-X.png", 53 | "minimum-system-version" : "11.0", 54 | "orientation" : "landscape", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "extent" : "full-screen", 59 | "idiom" : "iphone", 60 | "subtype" : "736h", 61 | "filename" : "Default-736h@3x.png", 62 | "minimum-system-version" : "8.0", 63 | "orientation" : "portrait", 64 | "scale" : "3x" 65 | }, 66 | { 67 | "extent" : "full-screen", 68 | "idiom" : "iphone", 69 | "subtype" : "736h", 70 | "filename" : "Default-Landscape@3x.png", 71 | "minimum-system-version" : "8.0", 72 | "orientation" : "landscape", 73 | "scale" : "3x" 74 | }, 75 | { 76 | "extent" : "full-screen", 77 | "idiom" : "iphone", 78 | "subtype" : "667h", 79 | "filename" : "Default-667h@2x.png", 80 | "minimum-system-version" : "8.0", 81 | "orientation" : "portrait", 82 | "scale" : "2x" 83 | }, 84 | { 85 | "orientation" : "portrait", 86 | "idiom" : "iphone", 87 | "filename" : "Default@2x.png", 88 | "extent" : "full-screen", 89 | "minimum-system-version" : "7.0", 90 | "scale" : "2x" 91 | }, 92 | { 93 | "extent" : "full-screen", 94 | "idiom" : "iphone", 95 | "subtype" : "retina4", 96 | "filename" : "Default-568h@2x.png", 97 | "minimum-system-version" : "7.0", 98 | "orientation" : "portrait", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "orientation" : "portrait", 103 | "idiom" : "ipad", 104 | "filename" : "Default-Portrait.png", 105 | "extent" : "full-screen", 106 | "minimum-system-version" : "7.0", 107 | "scale" : "1x" 108 | }, 109 | { 110 | "orientation" : "landscape", 111 | "idiom" : "ipad", 112 | "filename" : "Default-Landscape.png", 113 | "extent" : "full-screen", 114 | "minimum-system-version" : "7.0", 115 | "scale" : "1x" 116 | }, 117 | { 118 | "orientation" : "portrait", 119 | "idiom" : "ipad", 120 | "filename" : "Default-Portrait@2x.png", 121 | "extent" : "full-screen", 122 | "minimum-system-version" : "7.0", 123 | "scale" : "2x" 124 | }, 125 | { 126 | "orientation" : "landscape", 127 | "idiom" : "ipad", 128 | "filename" : "Default-Landscape@2x.png", 129 | "extent" : "full-screen", 130 | "minimum-system-version" : "7.0", 131 | "scale" : "2x" 132 | }, 133 | { 134 | "orientation" : "portrait", 135 | "idiom" : "iphone", 136 | "filename" : "Default.png", 137 | "extent" : "full-screen", 138 | "scale" : "1x" 139 | }, 140 | { 141 | "orientation" : "portrait", 142 | "idiom" : "iphone", 143 | "filename" : "Default@2x.png", 144 | "extent" : "full-screen", 145 | "scale" : "2x" 146 | }, 147 | { 148 | "orientation" : "portrait", 149 | "idiom" : "iphone", 150 | "filename" : "Default-568h@2x.png", 151 | "extent" : "full-screen", 152 | "subtype" : "retina4", 153 | "scale" : "2x" 154 | }, 155 | { 156 | "orientation" : "portrait", 157 | "idiom" : "ipad", 158 | "extent" : "to-status-bar", 159 | "scale" : "1x" 160 | }, 161 | { 162 | "orientation" : "portrait", 163 | "idiom" : "ipad", 164 | "filename" : "Default-Portrait.png", 165 | "extent" : "full-screen", 166 | "scale" : "1x" 167 | }, 168 | { 169 | "orientation" : "landscape", 170 | "idiom" : "ipad", 171 | "extent" : "to-status-bar", 172 | "scale" : "1x" 173 | }, 174 | { 175 | "orientation" : "landscape", 176 | "idiom" : "ipad", 177 | "filename" : "Default-Landscape.png", 178 | "extent" : "full-screen", 179 | "scale" : "1x" 180 | }, 181 | { 182 | "orientation" : "portrait", 183 | "idiom" : "ipad", 184 | "extent" : "to-status-bar", 185 | "scale" : "2x" 186 | }, 187 | { 188 | "orientation" : "portrait", 189 | "idiom" : "ipad", 190 | "filename" : "Default-Portrait@2x.png", 191 | "extent" : "full-screen", 192 | "scale" : "2x" 193 | }, 194 | { 195 | "orientation" : "landscape", 196 | "idiom" : "ipad", 197 | "extent" : "to-status-bar", 198 | "scale" : "2x" 199 | }, 200 | { 201 | "orientation" : "landscape", 202 | "idiom" : "ipad", 203 | "filename" : "Default-Landscape@2x.png", 204 | "extent" : "full-screen", 205 | "scale" : "2x" 206 | } 207 | ], 208 | "info" : { 209 | "version" : 1, 210 | "author" : "xcode" 211 | } 212 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchScreen.AspectFill@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchScreen.Center@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nativescript-community/texttospeech/b92e8f88df7859cbdff5d81ce3af678d702606c1/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | // To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html 5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID; 6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 8 | -------------------------------------------------------------------------------- /demo/app/app-root.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | @import '~nativescript-theme-core/css/core.light.css'; 2 | 3 | .title { 4 | font-size: 30; 5 | horizontal-align: center; 6 | margin: 20; 7 | } 8 | 9 | button { 10 | horizontal-align: center; 11 | } 12 | 13 | .message { 14 | font-size: 20; 15 | color: #284848; 16 | horizontal-align: center; 17 | margin: 0 20; 18 | text-align: center; 19 | } 20 | -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | import { Application } from '@nativescript/core'; 2 | Application.run({ moduleName: 'app-root' }); 3 | -------------------------------------------------------------------------------- /demo/app/main-page.ts: -------------------------------------------------------------------------------- 1 | import { EventData, Page } from '@nativescript/core'; 2 | import { HelloWorldModel } from './main-view-model'; 3 | 4 | // Event handler for Page "navigatingTo" event attached in main-page.xml 5 | export function navigatingTo(args: EventData) { 6 | const page = args.object as Page; 7 | page.bindingContext = new HelloWorldModel(page); 8 | } 9 | -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |