diff --git a/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/bug_report.md b/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..614a6708 --- /dev/null +++ b/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,21 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +## 🐛 Bug Report + + + +### Expected behavior + +### Reproduction steps + +### Configuration + +**Version:** 0.1.x + +**Platform:** +- [ ] :iphone: iOS +- [ ] :robot: Android diff --git a/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/feature_request.md b/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..35a881a3 --- /dev/null +++ b/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +## 🚀 Feature Requests + + + +### Contextualize the feature + + +### Describe the feature + + +### Platforms affected (mark all that apply) +- [ ] :iphone: iOS +- [ ] :robot: Android diff --git a/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/questions-and-help.md b/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/questions-and-help.md new file mode 100644 index 00000000..ba501f3c --- /dev/null +++ b/flutter_tts-voice_enhancement/.github/ISSUE_TEMPLATE/questions-and-help.md @@ -0,0 +1,9 @@ +--- +name: Questions and Help +about: If you have questions, please use this for support + +--- + +## 💬 Questions and Help + +Provide question related to this flutter plugin. diff --git a/flutter_tts-voice_enhancement/.github/workflows/main.yml b/flutter_tts-voice_enhancement/.github/workflows/main.yml new file mode 100644 index 00000000..832dd069 --- /dev/null +++ b/flutter_tts-voice_enhancement/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: github pages + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: Setup Flutter + run: | + git clone https://github.com/flutter/flutter.git --depth 1 -b beta _flutter + echo "::add-path::${GITHUB_WORKSPACE}/_flutter/bin" + + - name: Install + run: | + cd example + flutter config --enable-web + flutter pub get + + - name: Build + run: | + cd example + flutter build web + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./example/build/web diff --git a/flutter_tts-voice_enhancement/.gitignore b/flutter_tts-voice_enhancement/.gitignore new file mode 100644 index 00000000..bc0883df --- /dev/null +++ b/flutter_tts-voice_enhancement/.gitignore @@ -0,0 +1,94 @@ +# Miscellaneous +*.class +*.lock +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.project +.svn/ +bin/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# Android Studio related +android/.classpath +android/.settings/ + +# Visual Studio Code related +.vscode/ + +# Flutter repo-specific +/bin/cache/ +/bin/mingit/ +/dev/benchmarks/mega_gallery/ +/dev/bots/.recipe_deps +/dev/bots/android_tools/ +/dev/docs/doc/ +/dev/docs/lib/ +/dev/docs/pubspec.yaml +/packages/flutter/coverage/ +version + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.packages +.pub-cache/ +.pub/ +build/ +flutter_*.png +linked_*.ds +unlinked.ds +unlinked_spec.ds + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +example/ios/Flutter/flutter_export_environment.sh diff --git a/flutter_tts-voice_enhancement/CHANGELOG.md b/flutter_tts-voice_enhancement/CHANGELOG.md new file mode 100644 index 00000000..bff8b759 --- /dev/null +++ b/flutter_tts-voice_enhancement/CHANGELOG.md @@ -0,0 +1,197 @@ +# ChangeLog + +## 1.3.0 + +- All: Adding await speak completion + +## 1.2.7 + +- iOS: Adding utterance settings to synthesizeToFile +- Android: Fix crash when utterance completes after Engine is detached + +## 1.2.6 + +- Android: Fixing new API onAttachedToEngine call + +## 1.2.5 + +- macOS: Adding support + +## 1.2.4 + +- iOS: Deactivate audio session only when needed +- Android: Better exception handling for getLanguages +- Android: Adding getEngines +- Android: Adding new Android plugin APIs + +## 1.2.3 + +- iOS: Adding synthesize to file +- iOS: Fix set category ios + +## 1.2.2 + +- Web: Adding pause and continue + +## 1.2.1 + +- iOS: Fix setting iOS Category +- iOS/Android: Adding additional platform calls + +## 1.2.0 + +- iOS: Adding Set Audio Session Category +- Android: Bug fixes + +## 1.1.0 + +- iOS: Adding Pause +- iOS: Adding set Shared Instance + +## 1.0.0 + +- iOS/Android: Feature - Speech marks +- iOS/Android: Breaking changes to Speech rate + +## 0.9.2 + +- iOS: Changing audio session to playAndRecord + +## 0.9.1 + +- Android: Fixing method call error + +## 0.9.0 + +- Android: Adding synthesize to file + +## 0.8.7 + +- Android: Fix sporadic ANR on initialization + +## 0.8.6 + +- iOS: Reducing volume of other sessions while TTS is playing + +## 0.8.5 + +- Android: Fix Android async platform initialization +- Android: Removing initHandler + +## 0.8.2 + +- Web: Adding isLanguageAvailable method +- All: Fixing isLanguageAvailable platform channel and making it case insensitive + +## 0.8.0 + +- Web: Adding Web Support + +## 0.7.0 + +- iOS: Adding Swift version 4.2 to podspec and correct audio playback category + +## 0.6.0 + +- Android: AndroidX support + +## 0.5.2 + +- Android: Bug Fix on isLanguageAvailable + +## 0.5.1 + +- Applying flutter format to fix health suggestion + +## 0.5.0 + +- Android: Adding silence before speak +- Android: Removing deprecated API + +## 0.2.6 + +- IOS: Add voice selection implementation + +## 0.2.5 + +- Android: Ensure invokeMethod runs on main thread + +## 0.2.4 + +- Android: setting minSDK back to 21 and adding instructions to readme +- Android: Adding fallback for getLanguages and defaultLanguage + +## 0.2.3 + +- IOS: Audio continues with the Ring/Silent switch set to silent + +## 0.2.2 + +- Android: Fixing Locale bug + +## 0.2.1 + +- IOS: Fixing getLanguages bug + +## 0.2.0 + +- Android: Adding exception catch for samsung devices +- Android: Using default com.google.android.tts engine +- Android: Get and Set Voice +- Android: InitHandler +- Cleaning up the example + +## 0.1.2 + +- Support for Android background execution +- Updating Android build gradle version to 3.2.1 + +## 0.1.1 + +- Fixing TTS bound error in the example +- Fixing default voice language not found error on Android + +## 0.1.0 + +- Updating version for improved maintenance score +- Updating package description for improved maintenance score + +## 0.0.8 + +- Adding analysis_options.yaml for improved health score +- Fixing info/errors from flutter analyze + +## 0.0.7 + +- Updating SDK version in pubspec.yaml +- Adding package link to README +- Fixing language string warning received from xcode + +## 0.0.6 + +- Android: Upgrading Gradle 4.1 to 4.4 +- Android: Setting minSdk version to 21 +- Android: Adding try/catch to getAvailableLanguages & getDefaultVoice methods (Issues with API 21 & 22) + +## 0.0.5 + +- Adding IOS/Android isLanguageAvailable +- Rename setRate to setSpeechRate + +## 0.0.4 + +- Simplify podspec for Cocoapods 1.5.0 + +## 0.0.3 + +- Adding IOS/Android speech pitch and volume + +## 0.0.2 + +- Flutter formatting and fixing pubspec sdk versioning + +## 0.0.1 + +- first POC : + - methods : speak, stop, setRate, setLangauge, getLanguages + - a globalHandler for completion diff --git a/flutter_tts-voice_enhancement/CODE_OF_CONDUCT.md b/flutter_tts-voice_enhancement/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..43989576 --- /dev/null +++ b/flutter_tts-voice_enhancement/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at eyedea32@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/flutter_tts-voice_enhancement/LICENSE b/flutter_tts-voice_enhancement/LICENSE new file mode 100644 index 00000000..56dcdf22 --- /dev/null +++ b/flutter_tts-voice_enhancement/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Daniel Lutton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/flutter_tts-voice_enhancement/README.md b/flutter_tts-voice_enhancement/README.md new file mode 100644 index 00000000..4e32d45d --- /dev/null +++ b/flutter_tts-voice_enhancement/README.md @@ -0,0 +1,194 @@ +# Text To Speech + +[![pub package](https://img.shields.io/pub/v/flutter_tts.svg?style=for-the-badge&colorB=green)](https://pub.dartlang.org/packages/flutter_tts) + +A flutter text to speech plugin (Swift,Java) + +## Features + +- [x] Android, iOS, Web, & macOS + - [x] speak + - [x] stop + - [x] get languages + - [x] set language + - [x] set speech rate + - [x] set speech volume + - [x] set speech pitch + - [x] is language available +- [x] Android, iOS + - [x] get voices + - [x] set voice + - [x] speech marks (requires iOS 7+ and Android 26+) + - [x] synthesize to file (requires iOS 13+) +- [x] iOS, Web + - [x] pause +- [x] Android + - [x] set Silence +- [x] iOS + - [x] set shared instance + - [x] set audio session category + +## Usage + +## macOS + +```bash +OSX version: 10.15 +``` + +[Example App](https://github.com/dlutton/flutter_tts/tree/macOS_app) from the macOS_app branch + +## Web + +[Website](https://dlutton.github.io/flutter_tts) from the example directory. + +## Android + +Change the minimum Android sdk version to 21 (or higher) in your `android/app/build.gradle` file. + +```java +minSdkVersion 21 +``` + +## iOS + +There's a known issue with integrating plugins that use Swift into a Flutter project created with the Objective-C template. [Flutter#16049](https://github.com/flutter/flutter/issues/16049) + +[Example](https://github.com/dlutton/flutter_tts/blob/master/example/lib/main.dart) + +To use this plugin : + +- add the dependency to your [pubspec.yaml](https://github.com/dlutton/flutter_tts/blob/master/example/pubspec.yaml) file. + +```yaml + dependencies: + flutter: + sdk: flutter + flutter_tts: +``` + +- instantiate FlutterTts + +```dart +FlutterTts flutterTts = FlutterTts(); + +``` + +To set shared audio [instance](https://developer.apple.com/documentation/avfoundation/avaudiosession/1616504-sharedinstance) (iOS only): + +```dart +await flutterTts.setSharedInstance(true); +``` + +To set audio [category and options](https://developer.apple.com/documentation/avfoundation/avaudiosession) (iOS only): + +```dart +await flutterTts + .setIosAudioCategory(IosTextToSpeechAudioCategory.playAndRecord, [ + IosTextToSpeechAudioCategoryOptions.allowBluetooth, + IosTextToSpeechAudioCategoryOptions.allowBluetoothA2DP, + IosTextToSpeechAudioCategoryOptions.mixWithOthers + ]); +``` + +To await speak completion. + +```dart +await flutterTts.awaitSpeakCompletion(true); +``` + +### speak, stop, getLanguages, setLanguage, setSpeechRate, setVoice, setVolume, setPitch, isLanguageAvailable, setSharedInstance + +```dart +Future _speak() async{ + var result = await flutterTts.speak("Hello World"); + if (result == 1) setState(() => ttsState = TtsState.playing); +} + +Future _stop() async{ + var result = await flutterTts.stop(); + if (result == 1) setState(() => ttsState = TtsState.stopped); +} + +List languages = await flutterTts.getLanguages; + +await flutterTts.setLanguage("en-US"); + +await flutterTts.setSpeechRate(1.0); + +await flutterTts.setVolume(1.0); + +await flutterTts.setPitch(1.0); + +await flutterTts.isLanguageAvailable("en-US"); + +// iOS and Web only +await flutterTts.pause(); + +// iOS, macOS, and Android only +await flutterTts.synthesizeToFile("Hello World", Platform.isAndroid ? "tts.wav" : "tts.caf"); + +await flutterTts.setVoice({"name": "Karen", "locale": "en-AU"}); + +// iOS only +await flutterTts.setSharedInstance(true); + +// Android only +await flutterTts.setSilence(2); + +await flutterTts.getEngines(); +``` + +### Listening for platform calls + +```dart +flutterTts.setStartHandler(() { + setState(() { + ttsState = TtsState.playing; + }); +}); + +flutterTts.setCompletionHandler(() { + setState(() { + ttsState = TtsState.stopped; + }); +}); + +flutterTts.setProgressHandler((String text, int startOffset, int endOffset, String word) { + setState(() { + _currentWord = word; + }); +}); + +flutterTts.setErrorHandler((msg) { + setState(() { + ttsState = TtsState.stopped; + }); +}); + +flutterTts.setCancelHandler((msg) { + setState(() { + ttsState = TtsState.stopped; + }); +}); + +// iOS and Web +flutterTts.setPauseHandler((msg) { + setState(() { + ttsState = TtsState.paused; + }); +}); + +flutterTts.setContinueHandler((msg) { + setState(() { + ttsState = TtsState.continued; + }); +}); +``` + +## Getting Started + +For help getting started with Flutter, view our online +[documentation](https://flutter.dev/). + +For help on editing plugin code, view the [documentation](https://flutter.dev/platform-plugins/#edit-code). diff --git a/flutter_tts-voice_enhancement/analysis_options.yaml b/flutter_tts-voice_enhancement/analysis_options.yaml new file mode 100644 index 00000000..e8779c50 --- /dev/null +++ b/flutter_tts-voice_enhancement/analysis_options.yaml @@ -0,0 +1,35 @@ +analyzer: + strong-mode: + implicit-casts: false + errors: + unused_import: error + unused_local_variable: error + dead_code: error +linter: + rules: + - avoid_empty_else + - comment_references + - control_flow_in_finally + - empty_statements + - hash_and_equals + - only_throw_errors + - test_types_in_equals + - throw_in_finally + - unrelated_type_equality_checks + - valid_regexps + - avoid_init_to_null + - avoid_return_types_on_setters + - await_only_futures + - camel_case_types + - directives_ordering + - empty_catches + - empty_constructor_bodies + - library_names + - library_prefixes + - non_constant_identifier_names + - omit_local_variable_types + - prefer_final_fields + - prefer_is_not_empty + - prefer_typing_uninitialized_variables + - slash_for_doc_comments + - type_init_formals \ No newline at end of file diff --git a/flutter_tts-voice_enhancement/android/.gitignore b/flutter_tts-voice_enhancement/android/.gitignore new file mode 100644 index 00000000..c6cbe562 --- /dev/null +++ b/flutter_tts-voice_enhancement/android/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/flutter_tts-voice_enhancement/android/build.gradle b/flutter_tts-voice_enhancement/android/build.gradle new file mode 100644 index 00000000..1308c920 --- /dev/null +++ b/flutter_tts-voice_enhancement/android/build.gradle @@ -0,0 +1,48 @@ +def PLUGIN = "flutter_tts"; +def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning"; +gradle.buildFinished { buildResult -> + if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) { + println ' *********************************************************' + println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.' + println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.' + println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.' + println ' *********************************************************' + rootProject.ext.set(ANDROIDX_WARNING, true); + } +} + +group 'com.tundralabs.fluttertts' +version '1.0-SNAPSHOT' + +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.4.2' + } +} + +rootProject.allprojects { + repositories { + google() + jcenter() + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 28 + + defaultConfig { + minSdkVersion 21 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + targetSdkVersion 27 + } + lintOptions { + disable 'InvalidPackage' + } +} diff --git a/flutter_tts-voice_enhancement/android/gradle.properties b/flutter_tts-voice_enhancement/android/gradle.properties new file mode 100644 index 00000000..a6738207 --- /dev/null +++ b/flutter_tts-voice_enhancement/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true +android.enableR8=true diff --git a/flutter_tts-voice_enhancement/android/gradle/wrapper/gradle-wrapper.properties b/flutter_tts-voice_enhancement/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..8d9c8a3f --- /dev/null +++ b/flutter_tts-voice_enhancement/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Sep 27 12:18:40 PDT 2019 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/flutter_tts-voice_enhancement/android/settings.gradle b/flutter_tts-voice_enhancement/android/settings.gradle new file mode 100644 index 00000000..26aeb433 --- /dev/null +++ b/flutter_tts-voice_enhancement/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'flutter_tts' diff --git a/flutter_tts-voice_enhancement/android/src/main/AndroidManifest.xml b/flutter_tts-voice_enhancement/android/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9cad3a1b --- /dev/null +++ b/flutter_tts-voice_enhancement/android/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + diff --git a/flutter_tts-voice_enhancement/android/src/main/java/com/tundralabs/fluttertts/FlutterTtsPlugin.java b/flutter_tts-voice_enhancement/android/src/main/java/com/tundralabs/fluttertts/FlutterTtsPlugin.java new file mode 100644 index 00000000..92e6a092 --- /dev/null +++ b/flutter_tts-voice_enhancement/android/src/main/java/com/tundralabs/fluttertts/FlutterTtsPlugin.java @@ -0,0 +1,454 @@ +package com.tundralabs.fluttertts; + +import android.content.Context; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.speech.tts.TextToSpeech; +import android.speech.tts.UtteranceProgressListener; +import android.speech.tts.Voice; +import android.util.Log; +import androidx.annotation.NonNull; +import io.flutter.embedding.engine.plugins.FlutterPlugin; +import io.flutter.plugin.common.BinaryMessenger; +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import io.flutter.plugin.common.MethodChannel.MethodCallHandler; +import io.flutter.plugin.common.MethodChannel.Result; +import io.flutter.plugin.common.PluginRegistry.Registrar; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.UUID; + +/** FlutterTtsPlugin */ +public class FlutterTtsPlugin implements MethodCallHandler, FlutterPlugin { + private Handler handler; + private MethodChannel methodChannel; + private MethodChannel.Result speakResult; + private boolean awaitSpeakCompletion = false; + private boolean speaking = false; + private Context context; + private TextToSpeech tts; + private final String tag = "TTS"; + private final String googleTtsEngine = "com.google.android.tts"; + private boolean isTtsInitialized = false; + private ArrayList pendingMethodCalls = new ArrayList<>(); + private final HashMap utterances = new HashMap<>(); + Bundle bundle; + private int silencems; + private static final String SILENCE_PREFIX = "SIL_"; + private static final String SYNTHESIZE_TO_FILE_PREFIX = "STF_"; + + /** Plugin registration. */ + public static void registerWith(Registrar registrar) { + FlutterTtsPlugin instance = new FlutterTtsPlugin(); + instance.initInstance(registrar.messenger(), registrar.activeContext()); + } + + private void initInstance(BinaryMessenger messenger, Context context) { + this.context = context; + methodChannel = new MethodChannel(messenger, "flutter_tts"); + methodChannel.setMethodCallHandler(this); + handler = new Handler(Looper.getMainLooper()); + bundle = new Bundle(); + tts = new TextToSpeech(context, onInitListener, googleTtsEngine); + } + + /** Android Plugin APIs */ + @Override + public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { + initInstance(binding.getBinaryMessenger(), binding.getApplicationContext()); + } + + @Override + public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { + stop(); + tts.shutdown(); + context = null; + methodChannel.setMethodCallHandler(null); + methodChannel = null; + } + + private UtteranceProgressListener utteranceProgressListener = + new UtteranceProgressListener() { + @Override + public void onStart(String utteranceId) { + if (utteranceId != null && utteranceId.startsWith(SYNTHESIZE_TO_FILE_PREFIX)) { + invokeMethod("synth.onStart", true); + } else { + Log.d(tag, "Utterance ID has started: " + utteranceId); + invokeMethod("speak.onStart", true); + } + if (Build.VERSION.SDK_INT < 26) { + this.onProgress(utteranceId, 0, utterances.get(utteranceId).length()); + } + } + + @Override + public void onDone(String utteranceId) { + if (utteranceId != null && utteranceId.startsWith(SILENCE_PREFIX)) return; + if (utteranceId != null && utteranceId.startsWith(SYNTHESIZE_TO_FILE_PREFIX)) { + invokeMethod("synth.onComplete", true); + } else { + Log.d(tag, "Utterance ID has completed: " + utteranceId); + if (awaitSpeakCompletion) { + speakCompletion(1); + } + invokeMethod("speak.onComplete", true); + } + utterances.remove(utteranceId); + } + + @Override + public void onStop(String utteranceId, boolean interrupted) { + Log.d( + tag, + "Utterance ID has been stopped: " + utteranceId + ". Interrupted: " + interrupted); + if (awaitSpeakCompletion) { + speaking = false; + } + invokeMethod("speak.onCancel", true); + } + + private void onProgress(String utteranceId, int startAt, int endAt) { + if (utteranceId != null && !utteranceId.startsWith(SYNTHESIZE_TO_FILE_PREFIX)) { + final String text = utterances.get(utteranceId); + final HashMap data = new HashMap<>(); + data.put("text", text); + data.put("start", Integer.toString(startAt)); + data.put("end", Integer.toString(endAt)); + data.put("word", text.substring(startAt, endAt)); + invokeMethod("speak.onProgress", data); + } + } + + // Requires Android 26 or later + @Override + public void onRangeStart(String utteranceId, int startAt, int endAt, int frame) { + if (utteranceId != null && !utteranceId.startsWith(SYNTHESIZE_TO_FILE_PREFIX)) { + super.onRangeStart(utteranceId, startAt, endAt, frame); + this.onProgress(utteranceId, startAt, endAt); + } + } + + @Override + @Deprecated + public void onError(String utteranceId) { + if (utteranceId != null && utteranceId.startsWith(SYNTHESIZE_TO_FILE_PREFIX)) { + invokeMethod("synth.onError", "Error from TextToSpeech (synth)"); + } else { + if (awaitSpeakCompletion) { + speaking = false; + } + invokeMethod("speak.onError", "Error from TextToSpeech (speak)"); + } + } + + @Override + public void onError(String utteranceId, int errorCode) { + if (utteranceId != null && utteranceId.startsWith(SYNTHESIZE_TO_FILE_PREFIX)) { + invokeMethod("synth.onError", "Error from TextToSpeech (synth) - " + errorCode); + } else { + if (awaitSpeakCompletion) { + speaking = false; + } + invokeMethod("speak.onError", "Error from TextToSpeech (speak) - " + errorCode); + } + } + }; + + void speakCompletion(final int success) { + speaking = false; + handler.post( + new Runnable() { + @Override + public void run() { + speakResult.success(success); + } + }); + } + + private TextToSpeech.OnInitListener onInitListener = + new TextToSpeech.OnInitListener() { + @Override + public void onInit(int status) { + if (status == TextToSpeech.SUCCESS) { + tts.setOnUtteranceProgressListener(utteranceProgressListener); + + try { + Locale locale = tts.getDefaultVoice().getLocale(); + if (isLanguageAvailable(locale)) { + tts.setLanguage(locale); + } + } catch (NullPointerException | IllegalArgumentException e) { + Log.e(tag, "getDefaultLocale: " + e.getMessage()); + } + + // Handle pending method calls (sent while TTS was initializing) + isTtsInitialized = true; + for (Runnable call : pendingMethodCalls) { + call.run(); + } + } else { + Log.e(tag, "Failed to initialize TextToSpeech"); + } + } + }; + + @Override + public void onMethodCall(@NonNull final MethodCall call, @NonNull final Result result) { + // If TTS is still loading + if (!isTtsInitialized) { + // Suspend method call until the TTS engine is ready + final Runnable suspendedCall = + new Runnable() { + public void run() { + onMethodCall(call, result); + } + }; + pendingMethodCalls.add(suspendedCall); + return; + } + switch (call.method) { + case "speak": + { + String text = call.arguments.toString(); + if (this.speaking) { + result.success(0); + break; + } + speak(text); + if (this.awaitSpeakCompletion) { + this.speaking = true; + this.speakResult = result; + } else { + result.success(1); + } + break; + } + case "awaitSpeakCompletion": + { + this.awaitSpeakCompletion = Boolean.parseBoolean(call.arguments.toString()); + result.success(1); + break; + } + case "synthesizeToFile": + { + String text = call.argument("text"); + String fileName = call.argument("fileName"); + synthesizeToFile(text, fileName); + result.success(1); + break; + } + case "stop": + stop(); + result.success(1); + break; + case "setSpeechRate": + String rate = call.arguments.toString(); + setSpeechRate(Float.parseFloat(rate)); + result.success(1); + break; + case "setVolume": + String volume = call.arguments.toString(); + setVolume(Float.parseFloat(volume), result); + break; + case "setPitch": + String pitch = call.arguments.toString(); + setPitch(Float.parseFloat(pitch), result); + break; + case "setLanguage": + { + String language = call.arguments.toString(); + setLanguage(language, result); + break; + } + case "getLanguages": + getLanguages(result); + break; + case "getVoices": + getVoices(result); + break; + case "getSpeechRateValidRange": + getSpeechRateValidRange(result); + break; + case "getEngines": + getEngines(result); + break; + case "setVoice": + HashMap voice = call.arguments(); + setVoice(voice, result); + break; + case "isLanguageAvailable": + { + String language = call.arguments().toString(); + Locale locale = Locale.forLanguageTag(language); + result.success(isLanguageAvailable(locale)); + break; + } + case "setSilence": + String silencems = call.arguments.toString(); + this.silencems = Integer.parseInt(silencems); + break; + case "setSharedInstance": + result.success(1); + break; + default: + result.notImplemented(); + break; + } + } + + void setSpeechRate(float rate) { + tts.setSpeechRate(rate); + } + + Boolean isLanguageAvailable(Locale locale) { + return tts.isLanguageAvailable(locale) >= TextToSpeech.LANG_AVAILABLE; + } + + void setLanguage(String language, Result result) { + Locale locale = Locale.forLanguageTag(language); + if (isLanguageAvailable(locale)) { + tts.setLanguage(locale); + result.success(1); + } else { + result.success(0); + } + } + + void setVoice(HashMap voice, Result result) { + for (Voice ttsVoice : tts.getVoices()) { + if (ttsVoice.getName().equals(voice.get("name")) && ttsVoice.getLocale().toLanguageTag().equals(voice.get("locale"))) { + tts.setVoice(ttsVoice); + result.success(1); + return; + } + } + Log.d(tag, "Voice name not found: " + voice); + result.success(0); + } + + void setVolume(float volume, Result result) { + if (volume >= 0.0F && volume <= 1.0F) { + bundle.putFloat(TextToSpeech.Engine.KEY_PARAM_VOLUME, volume); + result.success(1); + } else { + Log.d(tag, "Invalid volume " + volume + " value - Range is from 0.0 to 1.0"); + result.success(0); + } + } + + void setPitch(float pitch, Result result) { + if (pitch >= 0.5F && pitch <= 2.0F) { + tts.setPitch(pitch); + result.success(1); + } else { + Log.d(tag, "Invalid pitch " + pitch + " value - Range is from 0.5 to 2.0"); + result.success(0); + } + } + + void getVoices(Result result) { + ArrayList> voices = new ArrayList<>(); + try { + for (Voice voice : tts.getVoices()) { + HashMap voiceMap = new HashMap<>(); + voiceMap.put("name", voice.getName()); + voiceMap.put("locale", voice.getLocale().toLanguageTag()); + voices.add(voiceMap); + } + result.success(voices); + } catch (NullPointerException e) { + Log.d(tag, "getVoices: " + e.getMessage()); + result.success(null); + } + } + + void getLanguages(Result result) { + ArrayList locales = new ArrayList<>(); + try { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + // While this method was introduced in API level 21, it seems that it + // has not been implemented in the speech service side until API Level 23. + for (Locale locale : tts.getAvailableLanguages()) { + locales.add(locale.toLanguageTag()); + } + } else { + for (Locale locale : Locale.getAvailableLocales()) { + if (locale.getVariant().isEmpty() && isLanguageAvailable(locale)) { + locales.add(locale.toLanguageTag()); + } + } + } + } catch (MissingResourceException | NullPointerException e) { + Log.d(tag, "getLanguages: " + e.getMessage()); + } + result.success(locales); + } + + void getEngines(Result result) { + ArrayList engines = new ArrayList<>(); + try { + for (TextToSpeech.EngineInfo engineInfo : tts.getEngines()) { + engines.add(engineInfo.name); + } + } catch (Exception e) { + Log.d(tag, "getEngines: " + e.getMessage()); + } + result.success(engines); + } + + void getSpeechRateValidRange(Result result) { + // Valid values available in the android documentation. + // https://developer.android.com/reference/android/speech/tts/TextToSpeech#setSpeechRate(float) + final HashMap data = new HashMap(); + data.put("min", "0"); + data.put("normal", "1"); + data.put("max", "3"); + data.put("platform", "android"); + result.success(data); + } + + private void speak(String text) { + String uuid = UUID.randomUUID().toString(); + utterances.put(uuid, text); + if (silencems > 0) { + tts.playSilentUtterance(silencems, TextToSpeech.QUEUE_FLUSH, SILENCE_PREFIX + uuid); + tts.speak(text, TextToSpeech.QUEUE_ADD, bundle, uuid); + } else { + tts.speak(text, TextToSpeech.QUEUE_FLUSH, bundle, uuid); + } + } + + private void stop() { + tts.stop(); + } + + private void synthesizeToFile(String text, String fileName) { + File file = new File(context.getExternalFilesDir(null), fileName); + String uuid = UUID.randomUUID().toString(); + bundle.putString(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, SYNTHESIZE_TO_FILE_PREFIX + uuid); + + int result = tts.synthesizeToFile(text, bundle, file, SYNTHESIZE_TO_FILE_PREFIX + uuid); + if (result == TextToSpeech.SUCCESS) { + Log.d(tag, "Successfully created file : " + file.getPath()); + } else { + Log.d(tag, "Failed creating file : " + file.getPath()); + } + } + + private void invokeMethod(final String method, final Object arguments) { + handler.post( + new Runnable() { + @Override + public void run() { + if (methodChannel != null) methodChannel.invokeMethod(method, arguments); + } + }); + } +} diff --git a/flutter_tts-voice_enhancement/example/.gitignore b/flutter_tts-voice_enhancement/example/.gitignore new file mode 100644 index 00000000..7e6bbd47 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/.gitignore @@ -0,0 +1,11 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +build/ + +.flutter-plugins +.flutter-plugins-dependencies +lib/generated_plugin_registrant.dart \ No newline at end of file diff --git a/flutter_tts-voice_enhancement/example/.metadata b/flutter_tts-voice_enhancement/example/.metadata new file mode 100644 index 00000000..3c0dd2c8 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/.metadata @@ -0,0 +1,8 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: b397406561f5e7a9c94e28f58d9e49fca0dd58b7 + channel: beta diff --git a/flutter_tts-voice_enhancement/example/README.md b/flutter_tts-voice_enhancement/example/README.md new file mode 100644 index 00000000..a1356260 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/README.md @@ -0,0 +1,16 @@ +# example + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/flutter_tts-voice_enhancement/example/android/.gitignore b/flutter_tts-voice_enhancement/example/android/.gitignore new file mode 100644 index 00000000..65b7315a --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/.gitignore @@ -0,0 +1,10 @@ +*.iml +*.class +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +GeneratedPluginRegistrant.java diff --git a/flutter_tts-voice_enhancement/example/android/.settings/org.eclipse.buildship.core.prefs b/flutter_tts-voice_enhancement/example/android/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..9f105273 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +#Sat Apr 14 11:55:40 PDT 2018 +connection.project.dir= diff --git a/flutter_tts-voice_enhancement/example/android/app/.classpath b/flutter_tts-voice_enhancement/example/android/app/.classpath new file mode 100644 index 00000000..8d8d85f1 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/flutter_tts-voice_enhancement/example/android/app/.settings/org.eclipse.buildship.core.prefs b/flutter_tts-voice_enhancement/example/android/app/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 00000000..0601ea50 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +#Sat Apr 14 11:55:40 PDT 2018 +connection.project.dir=.. diff --git a/flutter_tts-voice_enhancement/example/android/app/build.gradle b/flutter_tts-voice_enhancement/example/android/app/build.gradle new file mode 100644 index 00000000..563b8f89 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/build.gradle @@ -0,0 +1,50 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + applicationId "com.tundralabs.flutterttsexample" + minSdkVersion 21 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' +} diff --git a/flutter_tts-voice_enhancement/example/android/app/src/debug/AndroidManifest.xml b/flutter_tts-voice_enhancement/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..49f10e46 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/AndroidManifest.xml b/flutter_tts-voice_enhancement/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..1caca009 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/res/drawable/launch_background.xml b/flutter_tts-voice_enhancement/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/flutter_tts-voice_enhancement/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/flutter_tts-voice_enhancement/example/android/app/src/main/res/values/styles.xml b/flutter_tts-voice_enhancement/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..1f83a33f --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/android/app/src/profile/AndroidManifest.xml b/flutter_tts-voice_enhancement/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..49f10e46 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/flutter_tts-voice_enhancement/example/android/build.gradle b/flutter_tts-voice_enhancement/example/android/build.gradle new file mode 100644 index 00000000..cd23eff8 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/build.gradle @@ -0,0 +1,29 @@ +buildscript { + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.0.0' + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/flutter_tts-voice_enhancement/example/android/gradle.properties b/flutter_tts-voice_enhancement/example/android/gradle.properties new file mode 100644 index 00000000..b6e61b62 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/gradle.properties @@ -0,0 +1,4 @@ +android.enableJetifier=true +android.useAndroidX=true +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true diff --git a/flutter_tts-voice_enhancement/example/android/gradle/wrapper/gradle-wrapper.properties b/flutter_tts-voice_enhancement/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..495eba36 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Jul 07 01:11:38 PDT 2020 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/flutter_tts-voice_enhancement/example/android/settings.gradle b/flutter_tts-voice_enhancement/example/android/settings.gradle new file mode 100644 index 00000000..5a2f14fb --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/settings.gradle @@ -0,0 +1,15 @@ +include ':app' + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} diff --git a/flutter_tts-voice_enhancement/example/android/settings_aar.gradle b/flutter_tts-voice_enhancement/example/android/settings_aar.gradle new file mode 100644 index 00000000..e7b4def4 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/flutter_tts-voice_enhancement/example/ios/.gitignore b/flutter_tts-voice_enhancement/example/ios/.gitignore new file mode 100644 index 00000000..1e1aafd6 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/.gitignore @@ -0,0 +1,42 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/app.flx +/Flutter/app.zip +/Flutter/flutter_assets/ +/Flutter/App.framework +/Flutter/Flutter.framework +/Flutter/Generated.xcconfig +/ServiceDefinitions.json + +Pods/ diff --git a/flutter_tts-voice_enhancement/example/ios/Flutter/.last_build_id b/flutter_tts-voice_enhancement/example/ios/Flutter/.last_build_id new file mode 100644 index 00000000..bfaaeba1 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Flutter/.last_build_id @@ -0,0 +1 @@ +b443c2d1b6b1e4df6c6fcc277a981410 \ No newline at end of file diff --git a/flutter_tts-voice_enhancement/example/ios/Flutter/AppFrameworkInfo.plist b/flutter_tts-voice_enhancement/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..6c2de808 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + UIRequiredDeviceCapabilities + + arm64 + + MinimumOSVersion + 8.0 + + diff --git a/flutter_tts-voice_enhancement/example/ios/Flutter/Debug.xcconfig b/flutter_tts-voice_enhancement/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..e8efba11 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/flutter_tts-voice_enhancement/example/ios/Flutter/Flutter.podspec b/flutter_tts-voice_enhancement/example/ios/Flutter/Flutter.podspec new file mode 100644 index 00000000..5ca30416 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Flutter/Flutter.podspec @@ -0,0 +1,18 @@ +# +# NOTE: This podspec is NOT to be published. It is only used as a local source! +# + +Pod::Spec.new do |s| + s.name = 'Flutter' + s.version = '1.0.0' + s.summary = 'High-performance, high-fidelity mobile apps.' + s.description = <<-DESC +Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. + DESC + s.homepage = 'https://flutter.io' + s.license = { :type => 'MIT' } + s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } + s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } + s.ios.deployment_target = '8.0' + s.vendored_frameworks = 'Flutter.framework' +end diff --git a/flutter_tts-voice_enhancement/example/ios/Flutter/Release.xcconfig b/flutter_tts-voice_enhancement/example/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..399e9340 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/flutter_tts-voice_enhancement/example/ios/Podfile b/flutter_tts-voice_enhancement/example/ios/Podfile new file mode 100644 index 00000000..1e8c3c90 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.pbxproj b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..28d4b795 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,488 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 72BCD356E80F9F5F32A2B586 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE3436CECE15DEA290DCD6B6 /* Pods_Runner.framework */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BE3436CECE15DEA290DCD6B6 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CED86603210BC43D753C699B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + CF068A80D9BD19FC43D3FE99 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 72BCD356E80F9F5F32A2B586 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 04223708A30129901099FE16 /* Frameworks */ = { + isa = PBXGroup; + children = ( + BE3436CECE15DEA290DCD6B6 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 1ED2DC2A248FC04D7FB5EA8C /* Pods */ = { + isa = PBXGroup; + children = ( + CF068A80D9BD19FC43D3FE99 /* Pods-Runner.debug.xcconfig */, + CED86603210BC43D753C699B /* Pods-Runner.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 1ED2DC2A248FC04D7FB5EA8C /* Pods */, + 04223708A30129901099FE16 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 3B0CA933DCDA45D4F71410D4 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 46F7EA90EF3F4667EDB9E562 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0940; + ORGANIZATIONNAME = "The Chromium Authors"; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0910; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 3B0CA933DCDA45D4F71410D4 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 46F7EA90EF3F4667EDB9E562 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${PODS_ROOT}/../Flutter/Flutter.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tundralabs.flutterTtsExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tundralabs.flutterTtsExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..4bafc458 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..21a3cc14 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/AppDelegate.swift b/flutter_tts-voice_enhancement/example/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..71cc41e3 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..3d43d11e Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/flutter_tts-voice_enhancement/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Base.lproj/Main.storyboard b/flutter_tts-voice_enhancement/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Info.plist b/flutter_tts-voice_enhancement/example/ios/Runner/Info.plist new file mode 100644 index 00000000..dd2d9263 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + flutter_tts_example + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/flutter_tts-voice_enhancement/example/ios/Runner/Runner-Bridging-Header.h b/flutter_tts-voice_enhancement/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..7335fdf9 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" \ No newline at end of file diff --git a/flutter_tts-voice_enhancement/example/lib/main.dart b/flutter_tts-voice_enhancement/example/lib/main.dart new file mode 100644 index 00000000..97530bbb --- /dev/null +++ b/flutter_tts-voice_enhancement/example/lib/main.dart @@ -0,0 +1,292 @@ +import 'dart:async'; +import 'dart:io' show Platform; +import 'package:flutter/foundation.dart' show kIsWeb; + +import 'package:flutter/material.dart'; +import 'package:flutter_tts/flutter_tts.dart'; + +void main() => runApp(MyApp()); + +class MyApp extends StatefulWidget { + @override + _MyAppState createState() => _MyAppState(); +} + +enum TtsState { playing, stopped, paused, continued } + +class _MyAppState extends State { + FlutterTts flutterTts; + dynamic languages; + String language; + double volume = 0.5; + double pitch = 1.0; + double rate = 0.5; + + String _newVoiceText; + + TtsState ttsState = TtsState.stopped; + + get isPlaying => ttsState == TtsState.playing; + + get isStopped => ttsState == TtsState.stopped; + + get isPaused => ttsState == TtsState.paused; + + get isContinued => ttsState == TtsState.continued; + + @override + initState() { + super.initState(); + initTts(); + } + + initTts() { + flutterTts = FlutterTts(); + + _getLanguages(); + + if (!kIsWeb) { + if (Platform.isAndroid) { + _getEngines(); + } + } + + flutterTts.setStartHandler(() { + setState(() { + print("Playing"); + ttsState = TtsState.playing; + }); + }); + + flutterTts.setCompletionHandler(() { + setState(() { + print("Complete"); + ttsState = TtsState.stopped; + }); + }); + + flutterTts.setCancelHandler(() { + setState(() { + print("Cancel"); + ttsState = TtsState.stopped; + }); + }); + + if (kIsWeb || Platform.isIOS) { + flutterTts.setPauseHandler(() { + setState(() { + print("Paused"); + ttsState = TtsState.paused; + }); + }); + + flutterTts.setContinueHandler(() { + setState(() { + print("Continued"); + ttsState = TtsState.continued; + }); + }); + } + + flutterTts.setErrorHandler((msg) { + setState(() { + print("error: $msg"); + ttsState = TtsState.stopped; + }); + }); + } + + Future _getLanguages() async { + languages = await flutterTts.getLanguages; + if (languages != null) setState(() => languages); + } + + Future _getEngines() async { + var engines = await flutterTts.getEngines; + if (engines != null) { + for (dynamic engine in engines) { + print(engine); + } + } + } + + Future _speak() async { + await flutterTts.setVolume(volume); + await flutterTts.setSpeechRate(rate); + await flutterTts.setPitch(pitch); + + if (_newVoiceText != null) { + if (_newVoiceText.isNotEmpty) { + await flutterTts.awaitSpeakCompletion(true); + await flutterTts.speak(_newVoiceText); + } + } + } + + Future _stop() async { + var result = await flutterTts.stop(); + if (result == 1) setState(() => ttsState = TtsState.stopped); + } + + Future _pause() async { + var result = await flutterTts.pause(); + if (result == 1) setState(() => ttsState = TtsState.paused); + } + + @override + void dispose() { + super.dispose(); + flutterTts.stop(); + } + + List> getLanguageDropDownMenuItems() { + var items = List>(); + for (dynamic type in languages) { + items.add( + DropdownMenuItem(value: type as String, child: Text(type as String))); + } + return items; + } + + void changedLanguageDropDownItem(String selectedType) { + setState(() { + language = selectedType; + flutterTts.setLanguage(language); + }); + } + + void _onChange(String text) { + setState(() { + _newVoiceText = text; + }); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: Text('Flutter TTS'), + ), + body: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column(children: [ + _inputSection(), + _btnSection(), + languages != null ? _languageDropDownSection() : Text(""), + _buildSliders() + ])))); + } + + Widget _inputSection() => Container( + alignment: Alignment.topCenter, + padding: EdgeInsets.only(top: 25.0, left: 25.0, right: 25.0), + child: TextField( + onChanged: (String value) { + _onChange(value); + }, + )); + + Widget _btnSection() { + if (!kIsWeb && Platform.isAndroid) { + return Container( + padding: EdgeInsets.only(top: 50.0), + child: + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ + _buildButtonColumn(Colors.green, Colors.greenAccent, + Icons.play_arrow, 'PLAY', _speak), + _buildButtonColumn( + Colors.red, Colors.redAccent, Icons.stop, 'STOP', _stop), + ])); + } else { + return Container( + padding: EdgeInsets.only(top: 50.0), + child: + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ + _buildButtonColumn(Colors.green, Colors.greenAccent, + Icons.play_arrow, 'PLAY', _speak), + _buildButtonColumn( + Colors.red, Colors.redAccent, Icons.stop, 'STOP', _stop), + _buildButtonColumn( + Colors.blue, Colors.blueAccent, Icons.pause, 'PAUSE', _pause), + ])); + } + } + + Widget _languageDropDownSection() => Container( + padding: EdgeInsets.only(top: 50.0), + child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ + DropdownButton( + value: language, + items: getLanguageDropDownMenuItems(), + onChanged: changedLanguageDropDownItem, + ) + ])); + + Column _buildButtonColumn(Color color, Color splashColor, IconData icon, + String label, Function func) { + return Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + icon: Icon(icon), + color: color, + splashColor: splashColor, + onPressed: () => func()), + Container( + margin: const EdgeInsets.only(top: 8.0), + child: Text(label, + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w400, + color: color))) + ]); + } + + Widget _buildSliders() { + return Column( + children: [_volume(), _pitch(), _rate()], + ); + } + + Widget _volume() { + return Slider( + value: volume, + onChanged: (newVolume) { + setState(() => volume = newVolume); + }, + min: 0.0, + max: 1.0, + divisions: 10, + label: "Volume: $volume"); + } + + Widget _pitch() { + return Slider( + value: pitch, + onChanged: (newPitch) { + setState(() => pitch = newPitch); + }, + min: 0.5, + max: 2.0, + divisions: 15, + label: "Pitch: $pitch", + activeColor: Colors.red, + ); + } + + Widget _rate() { + return Slider( + value: rate, + onChanged: (newRate) { + setState(() => rate = newRate); + }, + min: 0.0, + max: 1.0, + divisions: 10, + label: "Rate: $rate", + activeColor: Colors.green, + ); + } +} diff --git a/flutter_tts-voice_enhancement/example/macos/.gitignore b/flutter_tts-voice_enhancement/example/macos/.gitignore new file mode 100644 index 00000000..d2fd3772 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/.gitignore @@ -0,0 +1,6 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/xcuserdata/ diff --git a/flutter_tts-voice_enhancement/example/macos/Flutter/Flutter-Debug.xcconfig b/flutter_tts-voice_enhancement/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..785633d3 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/flutter_tts-voice_enhancement/example/macos/Flutter/Flutter-Release.xcconfig b/flutter_tts-voice_enhancement/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..5fba960c --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/flutter_tts-voice_enhancement/example/macos/Flutter/GeneratedPluginRegistrant.swift b/flutter_tts-voice_enhancement/example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..1e6ac53b --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import flutter_tts + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin")) +} diff --git a/flutter_tts-voice_enhancement/example/macos/Podfile b/flutter_tts-voice_enhancement/example/macos/Podfile new file mode 100644 index 00000000..5bf4307c --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Podfile @@ -0,0 +1,82 @@ +platform :osx, '10.15' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + pods_ary = [] + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) { |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + pods_ary.push({:name => podname, :path => podpath}); + else + puts "Invalid plugin specification: #{line}" + end + } + return pods_ary +end + +def pubspec_supports_macos(file) + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return false; + end + File.foreach(file_abs_path) { |line| + return true if line =~ /^\s*macos:/ + } + return false +end + +target 'Runner' do + use_frameworks! + use_modular_headers! + + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + ephemeral_dir = File.join('Flutter', 'ephemeral') + symlink_dir = File.join(ephemeral_dir, '.symlinks') + symlink_plugins_dir = File.join(symlink_dir, 'plugins') + system("rm -rf #{symlink_dir}") + system("mkdir -p #{symlink_plugins_dir}") + + # Flutter Pods + generated_xcconfig = parse_KV_file(File.join(ephemeral_dir, 'Flutter-Generated.xcconfig')) + if generated_xcconfig.empty? + puts "Flutter-Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." + end + generated_xcconfig.map { |p| + if p[:name] == 'FLUTTER_FRAMEWORK_DIR' + symlink = File.join(symlink_dir, 'flutter') + File.symlink(File.dirname(p[:path]), symlink) + pod 'FlutterMacOS', :path => File.join(symlink, File.basename(p[:path])) + end + } + + # Plugin Pods + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.map { |p| + symlink = File.join(symlink_plugins_dir, p[:name]) + File.symlink(p[:path], symlink) + if pubspec_supports_macos(File.join(symlink, 'pubspec.yaml')) + pod p[:name], :path => File.join(symlink, 'macos') + end + } +end + +# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. +install! 'cocoapods', :disable_input_output_paths => true diff --git a/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/project.pbxproj b/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..39fbd18c --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,656 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; }; + 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 3640FC23D5951A8FB0D6ECA0 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A470206CCCE0007DE0E2807A /* Pods_Runner.framework */; }; + D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; }; + D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */, + 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */, + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 517AA5C8DE31A9B49D27971F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 66FE8AA741C2B7FC12BF1304 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + A470206CCCE0007DE0E2807A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C15A67B64555E7FFE7AD8B76 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D73912F022F37F9E000D13A0 /* App.framework in Frameworks */, + 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */, + 3640FC23D5951A8FB0D6ECA0 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 5F9F48FBDE9334256A3D8D1C /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* example.app */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + D73912EF22F37F9E000D13A0 /* App.framework */, + 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + 5F9F48FBDE9334256A3D8D1C /* Pods */ = { + isa = PBXGroup; + children = ( + 66FE8AA741C2B7FC12BF1304 /* Pods-Runner.debug.xcconfig */, + 517AA5C8DE31A9B49D27971F /* Pods-Runner.release.xcconfig */, + C15A67B64555E7FFE7AD8B76 /* Pods-Runner.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + A470206CCCE0007DE0E2807A /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9A62F257D3FF7C7C94E365B2 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + F7AADAC6A864E8BF8890B1EC /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1150; + ORGANIZATIONNAME = "The Flutter Authors"; + TargetAttributes = { + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh\ntouch Flutter/ephemeral/tripwire\n"; + }; + 9A62F257D3FF7C7C94E365B2 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + F7AADAC6A864E8BF8890B1EC /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter/ephemeral", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter/ephemeral", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter/ephemeral", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..6111bd0a --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/flutter_tts-voice_enhancement/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..21a3cc14 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/flutter_tts-voice_enhancement/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/AppDelegate.swift b/flutter_tts-voice_enhancement/example/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..d53ef643 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..3c4935a7 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..ed4cc164 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..483be613 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bcbf36df Binary files /dev/null and b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..9c0a6528 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..e71a7261 Binary files /dev/null and b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..8a31fe2d Binary files /dev/null and b/flutter_tts-voice_enhancement/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Base.lproj/MainMenu.xib b/flutter_tts-voice_enhancement/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..537341ab --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Configs/AppInfo.xcconfig b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..f960fd48 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.tundralabs.example + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2020 com.tundralabs. All rights reserved. diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Debug.xcconfig b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Release.xcconfig b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Warnings.xcconfig b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/DebugProfile.entitlements b/flutter_tts-voice_enhancement/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..dddb8a30 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Info.plist b/flutter_tts-voice_enhancement/example/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/MainFlutterWindow.swift b/flutter_tts-voice_enhancement/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..2722837e --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController.init() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/flutter_tts-voice_enhancement/example/macos/Runner/Release.entitlements b/flutter_tts-voice_enhancement/example/macos/Runner/Release.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/flutter_tts-voice_enhancement/example/pubspec.yaml b/flutter_tts-voice_enhancement/example/pubspec.yaml new file mode 100644 index 00000000..54cbe6ed --- /dev/null +++ b/flutter_tts-voice_enhancement/example/pubspec.yaml @@ -0,0 +1,59 @@ +name: flutter_tts_example +description: Demonstrates how to use the flutter_tts plugin. + +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^0.1.2 + +dev_dependencies: + flutter_test: + sdk: flutter + + flutter_tts: + path: ../ + +# For information on the generic Dart part of this file, see the +# following page: https://www.dartlang.org/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.io/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.io/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.io/custom-fonts/#from-packages diff --git a/flutter_tts-voice_enhancement/example/test/widget_test.dart b/flutter_tts-voice_enhancement/example/test/widget_test.dart new file mode 100644 index 00000000..6db856cd --- /dev/null +++ b/flutter_tts-voice_enhancement/example/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../lib/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/flutter_tts-voice_enhancement/example/web/favicon.png b/flutter_tts-voice_enhancement/example/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/flutter_tts-voice_enhancement/example/web/favicon.png differ diff --git a/flutter_tts-voice_enhancement/example/web/icons/Icon-192.png b/flutter_tts-voice_enhancement/example/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/flutter_tts-voice_enhancement/example/web/icons/Icon-192.png differ diff --git a/flutter_tts-voice_enhancement/example/web/icons/Icon-512.png b/flutter_tts-voice_enhancement/example/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/flutter_tts-voice_enhancement/example/web/icons/Icon-512.png differ diff --git a/flutter_tts-voice_enhancement/example/web/index.html b/flutter_tts-voice_enhancement/example/web/index.html new file mode 100644 index 00000000..20b0c00a --- /dev/null +++ b/flutter_tts-voice_enhancement/example/web/index.html @@ -0,0 +1,10 @@ + + + + + Flutter TTS example + + + + + diff --git a/flutter_tts-voice_enhancement/example/web/manifest.json b/flutter_tts-voice_enhancement/example/web/manifest.json new file mode 100644 index 00000000..8c012917 --- /dev/null +++ b/flutter_tts-voice_enhancement/example/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/flutter_tts-voice_enhancement/ios/.gitignore b/flutter_tts-voice_enhancement/ios/.gitignore new file mode 100644 index 00000000..956c87f3 --- /dev/null +++ b/flutter_tts-voice_enhancement/ios/.gitignore @@ -0,0 +1,31 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + diff --git a/flutter_tts-voice_enhancement/ios/Assets/.gitkeep b/flutter_tts-voice_enhancement/ios/Assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/flutter_tts-voice_enhancement/ios/Classes/AudioCategory.swift b/flutter_tts-voice_enhancement/ios/Classes/AudioCategory.swift new file mode 100644 index 00000000..74e8ea0b --- /dev/null +++ b/flutter_tts-voice_enhancement/ios/Classes/AudioCategory.swift @@ -0,0 +1,21 @@ +import AVFoundation + +enum AudioCategory: String { + case iosAudioCategoryAmbientSolo + case iosAudioCategoryAmbient + case iosAudioCategoryPlayback + case iosAudioCategoryPlaybackAndRecord + + func toAVAudioSessionCategory() -> AVAudioSession.Category { + switch self { + case .iosAudioCategoryAmbientSolo: + return .soloAmbient + case .iosAudioCategoryAmbient: + return .ambient + case .iosAudioCategoryPlayback: + return .playback + case .iosAudioCategoryPlaybackAndRecord: + return .playAndRecord + } + } +} diff --git a/flutter_tts-voice_enhancement/ios/Classes/AudioCategoryOptions.swift b/flutter_tts-voice_enhancement/ios/Classes/AudioCategoryOptions.swift new file mode 100644 index 00000000..f593bfdb --- /dev/null +++ b/flutter_tts-voice_enhancement/ios/Classes/AudioCategoryOptions.swift @@ -0,0 +1,42 @@ +import AVFoundation + +enum AudioCategoryOptions: String { + case iosAudioCategoryOptionsMixWithOthers + case iosAudioCategoryOptionsDuckOthers + case iosAudioCategoryOptionsInterruptSpokenAudioAndMixWithOthers + case iosAudioCategoryOptionsAllowBluetooth + case iosAudioCategoryOptionsAllowBluetoothA2DP + case iosAudioCategoryOptionsAllowAirPlay + case iosAudioCategoryOptionsDefaultToSpeaker + + func toAVAudioSessionCategoryOptions() -> AVAudioSession.CategoryOptions? { + switch self { + case .iosAudioCategoryOptionsMixWithOthers: + return .mixWithOthers + case .iosAudioCategoryOptionsDuckOthers: + return .duckOthers + case .iosAudioCategoryOptionsInterruptSpokenAudioAndMixWithOthers: + if #available(iOS 9.0, *) { + return .interruptSpokenAudioAndMixWithOthers + } else { + return nil + } + case .iosAudioCategoryOptionsAllowBluetooth: + return .allowBluetooth + case .iosAudioCategoryOptionsAllowBluetoothA2DP: + if #available(iOS 10.0, *) { + return .allowBluetoothA2DP + } else { + return nil + } + case .iosAudioCategoryOptionsAllowAirPlay: + if #available(iOS 10.0, *) { + return .allowAirPlay + } else { + return nil + } + case .iosAudioCategoryOptionsDefaultToSpeaker: + return .defaultToSpeaker + } + } +} diff --git a/flutter_tts-voice_enhancement/ios/Classes/FlutterTtsPlugin.h b/flutter_tts-voice_enhancement/ios/Classes/FlutterTtsPlugin.h new file mode 100644 index 00000000..13e3a21a --- /dev/null +++ b/flutter_tts-voice_enhancement/ios/Classes/FlutterTtsPlugin.h @@ -0,0 +1,4 @@ +#import + +@interface FlutterTtsPlugin : NSObject +@end diff --git a/flutter_tts-voice_enhancement/ios/Classes/FlutterTtsPlugin.m b/flutter_tts-voice_enhancement/ios/Classes/FlutterTtsPlugin.m new file mode 100644 index 00000000..3a1f187c --- /dev/null +++ b/flutter_tts-voice_enhancement/ios/Classes/FlutterTtsPlugin.m @@ -0,0 +1,8 @@ +#import "FlutterTtsPlugin.h" +#import + +@implementation FlutterTtsPlugin ++ (void)registerWithRegistrar:(NSObject*)registrar { + [SwiftFlutterTtsPlugin registerWithRegistrar:registrar]; +} +@end diff --git a/flutter_tts-voice_enhancement/ios/Classes/SwiftFlutterTtsPlugin.swift b/flutter_tts-voice_enhancement/ios/Classes/SwiftFlutterTtsPlugin.swift new file mode 100644 index 00000000..5c78c135 --- /dev/null +++ b/flutter_tts-voice_enhancement/ios/Classes/SwiftFlutterTtsPlugin.swift @@ -0,0 +1,386 @@ +import Flutter +import UIKit +import AVFoundation + +public class SwiftFlutterTtsPlugin: NSObject, FlutterPlugin, AVSpeechSynthesizerDelegate { + final var iosAudioCategoryKey = "iosAudioCategoryKey" + final var iosAudioCategoryOptionsKey = "iosAudioCategoryOptionsKey" + + let synthesizer = AVSpeechSynthesizer() + var language: String = AVSpeechSynthesisVoice.currentLanguageCode() + var rate: Float = AVSpeechUtteranceDefaultSpeechRate + var languages = Set() + var volume: Float = 1.0 + var pitch: Float = 1.0 + var voice: AVSpeechSynthesisVoice? + var awaitSpeakCompletion: Bool = false + var speakResult: FlutterResult! + + var channel = FlutterMethodChannel() + lazy var audioSession = AVAudioSession.sharedInstance() + init(channel: FlutterMethodChannel) { + super.init() + self.channel = channel + synthesizer.delegate = self + setLanguages() + + // Allow audio playback when the Ring/Silent switch is set to silent + do { + try audioSession.setCategory(.playAndRecord, options: [.defaultToSpeaker]) + } catch { + print(error) + } + } + + private func setLanguages() { + for voice in AVSpeechSynthesisVoice.speechVoices(){ + self.languages.insert(voice.language) + } + } + + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "flutter_tts", binaryMessenger: registrar.messenger()) + let instance = SwiftFlutterTtsPlugin(channel: channel) + registrar.addMethodCallDelegate(instance, channel: channel) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + switch call.method { + case "speak": + let text: String = call.arguments as! String + self.speak(text: text, result: result) + break + case "awaitSpeakCompletion": + self.awaitSpeakCompletion = call.arguments as! Bool + result(1) + break + case "synthesizeToFile": + guard let args = call.arguments as? [String: Any] else { + result("iOS could not recognize flutter arguments in method: (sendParams)") + return + } + let text = args["text"] as! String + let fileName = args["fileName"] as! String + self.synthesizeToFile(text: text, fileName: fileName, result: result) + break + case "pause": + self.pause(result: result) + break + case "setLanguage": + let language: String = call.arguments as! String + self.setLanguage(language: language, result: result) + break + case "setSpeechRate": + let rate: Double = call.arguments as! Double + self.setRate(rate: Float(rate)) + result(1) + break + case "setVolume": + let volume: Double = call.arguments as! Double + self.setVolume(volume: Float(volume), result: result) + break + case "setPitch": + let pitch: Double = call.arguments as! Double + self.setPitch(pitch: Float(pitch), result: result) + break + case "stop": + self.stop() + result(1) + break + case "getLanguages": + self.getLanguages(result: result) + break + case "getSpeechRateValidRange": + self.getSpeechRateValidRange(result: result) + break + case "isLanguageAvailable": + let language: String = call.arguments as! String + self.isLanguageAvailable(language: language, result: result) + break + case "getVoices": + self.getVoices(result: result) + break + case "setVoice": + guard let args = call.arguments as? [String: String] else { + result("iOS could not recognize flutter arguments in method: (sendParams)") + return + } + self.setVoice(voice: args, result: result) + break + case "setSharedInstance": + let sharedInstance = call.arguments as! Bool + self.setSharedInstance(sharedInstance: sharedInstance, result: result) + break + case "setIosAudioCategory": + guard let args = call.arguments as? [String: Any] else { + result("iOS could not recognize flutter arguments in method: (sendParams)") + return + } + let audioCategory = args["iosAudioCategoryKey"] as? String + let audioOptions = args[iosAudioCategoryOptionsKey] as? Array + self.setAudioCategory(audioCategory: audioCategory, audioOptions: audioOptions, result: result) + break + default: + result(FlutterMethodNotImplemented) + } + } + + private func speak(text: String, result: @escaping FlutterResult) { + if (self.synthesizer.isPaused) { + if (self.synthesizer.continueSpeaking()) { + if self.awaitSpeakCompletion { + self.speakResult = result + } else { + result(1) + } + } else { + result(0) + } + } else { + let utterance = AVSpeechUtterance(string: text) + if self.voice != nil { + utterance.voice = self.voice! + } else { + utterance.voice = AVSpeechSynthesisVoice(language: self.language) + } + utterance.rate = self.rate + utterance.volume = self.volume + utterance.pitchMultiplier = self.pitch + + self.synthesizer.speak(utterance) + if self.awaitSpeakCompletion { + self.speakResult = result + } else { + result(1) + } + } + } + + private func synthesizeToFile(text: String, fileName: String, result: FlutterResult) { + var output: AVAudioFile? + var failed = false + let utterance = AVSpeechUtterance(string: text) + + if self.voice != nil { + utterance.voice = self.voice! + } else { + utterance.voice = AVSpeechSynthesisVoice(language: self.language) + } + utterance.rate = self.rate + utterance.volume = self.volume + utterance.pitchMultiplier = self.pitch + + if #available(iOS 13.0, *) { + self.synthesizer.write(utterance) { (buffer: AVAudioBuffer) in + guard let pcmBuffer = buffer as? AVAudioPCMBuffer else { + NSLog("unknow buffer type: \(buffer)") + failed = true + return + } + print(pcmBuffer.format) + if pcmBuffer.frameLength == 0 { + // finished + } else { + // append buffer to file + let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent(fileName) + NSLog("Saving utterance to file: \(fileURL.absoluteString)") + + if output == nil { + do { + output = try AVAudioFile( + forWriting: fileURL, + settings: pcmBuffer.format.settings, + commonFormat: .pcmFormatInt16, + interleaved: false) + } catch { + NSLog(error.localizedDescription) + failed = true + return + } + } + + try! output!.write(from: pcmBuffer) + } + } + } else { + result("Unsupported iOS version") + } + if failed { + result(0) + } + result(1) + } + + private func pause(result: FlutterResult) { + if (self.synthesizer.pauseSpeaking(at: AVSpeechBoundary.word)) { + result(1) + } else { + result(0) + } + } + + private func setLanguage(language: String, result: FlutterResult) { + if !(self.languages.contains(where: {$0.range(of: language, options: [.caseInsensitive, .anchored]) != nil})) { + result(0) + } else { + self.language = language + self.voice = nil + result(1) + } + } + + private func setRate(rate: Float) { + self.rate = rate + } + + private func setVolume(volume: Float, result: FlutterResult) { + if (volume >= 0.0 && volume <= 1.0) { + self.volume = volume + result(1) + } else { + result(0) + } + } + + private func setPitch(pitch: Float, result: FlutterResult) { + if (volume >= 0.5 && volume <= 2.0) { + self.pitch = pitch + result(1) + } else { + result(0) + } + } + + private func setSharedInstance(sharedInstance: Bool, result: FlutterResult) { + do { + try AVAudioSession.sharedInstance().setActive(sharedInstance) + result(1) + } catch { + result(0) + } + } + + private func setAudioCategory(audioCategory: String?, audioOptions: Array?, result: FlutterResult){ + let category: AVAudioSession.Category = AudioCategory(rawValue: audioCategory ?? "")?.toAVAudioSessionCategory() ?? audioSession.category + let options: AVAudioSession.CategoryOptions = audioOptions?.reduce([], { (result, option) -> AVAudioSession.CategoryOptions in + return result.union(AudioCategoryOptions(rawValue: option)?.toAVAudioSessionCategoryOptions() ?? []) + }) ?? [] + + do { + try audioSession.setCategory(category, options: options) + result(1) + } catch { + print(error) + result(0) + } + } + + private func stop() { + self.synthesizer.stopSpeaking(at: AVSpeechBoundary.immediate) + } + + private func getLanguages(result: FlutterResult) { + result(Array(self.languages)) + } + + private func getSpeechRateValidRange(result: FlutterResult) { + let validSpeechRateRange: [String:String] = [ + "min": String(AVSpeechUtteranceMinimumSpeechRate), + "normal": String(AVSpeechUtteranceDefaultSpeechRate), + "max": String(AVSpeechUtteranceMaximumSpeechRate), + "platform": "ios" + ] + result(validSpeechRateRange) + } + + private func isLanguageAvailable(language: String, result: FlutterResult) { + var isAvailable: Bool = false + if (self.languages.contains(where: {$0.range(of: language, options: [.caseInsensitive, .anchored]) != nil})) { + isAvailable = true + } + result(isAvailable); + } + + private func getVoices(result: FlutterResult) { + if #available(iOS 9.0, *) { + let voices = NSMutableArray() + var voiceDict: [String: String] = [:] + for voice in AVSpeechSynthesisVoice.speechVoices() { + voiceDict["name"] = voice.name + voiceDict["locale"] = voice.language + voices.add(voiceDict) + } + result(voices) + } else { + // Since voice selection is not supported below iOS 9, make voice getter and setter + // have the same bahavior as language selection. + getLanguages(result: result) + } + } + + private func setVoice(voice: [String:String], result: FlutterResult) { + if #available(iOS 9.0, *) { + if let voice = AVSpeechSynthesisVoice.speechVoices().first(where: { $0.name == voice["name"]! && $0.language == voice["locale"]! }) { + self.voice = voice + self.language = voice.language + result(1) + return + } + result(0) + } else { + setLanguage(language: voice["name"]!, result: result) + } + } + + private func shouldDeactivateAndNotifyOthers(_ session: AVAudioSession) -> Bool { + var options: AVAudioSession.CategoryOptions = .duckOthers + if #available(iOS 9.0, *) { + options.insert(.interruptSpokenAudioAndMixWithOthers) + } + options.remove(.mixWithOthers) + + return !options.isDisjoint(with: session.categoryOptions) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didFinish utterance: AVSpeechUtterance) { + if shouldDeactivateAndNotifyOthers(audioSession) { + do { + try audioSession.setActive(false, options: .notifyOthersOnDeactivation) + } catch { + print(error) + } + } + if self.awaitSpeakCompletion { + self.speakResult(1) + } + self.channel.invokeMethod("speak.onComplete", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didStart utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onStart", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didPause utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onPause", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didContinue utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onContinue", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didCancel utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onCancel", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, willSpeakRangeOfSpeechString characterRange: NSRange, utterance: AVSpeechUtterance) { + let nsWord = utterance.speechString as NSString + let data: [String:String] = [ + "text": utterance.speechString, + "start": String(characterRange.location), + "end": String(characterRange.location + characterRange.length), + "word": nsWord.substring(with: characterRange) + ] + self.channel.invokeMethod("speak.onProgress", arguments: data) + } + +} diff --git a/flutter_tts-voice_enhancement/ios/flutter_tts.podspec b/flutter_tts-voice_enhancement/ios/flutter_tts.podspec new file mode 100644 index 00000000..03099f45 --- /dev/null +++ b/flutter_tts-voice_enhancement/ios/flutter_tts.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# +Pod::Spec.new do |s| + s.name = 'flutter_tts' + s.version = '0.0.1' + s.summary = 'A flutter text to speech plugin.' + s.description = <<-DESC +A flutter text to speech plugin + DESC + s.homepage = 'https://github.com/dlutton/flutter_tts' + s.license = { :file => '../LICENSE' } + s.author = { 'tundralabs' => 'eyedea32@gmail.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' + s.dependency 'Flutter' + s.ios.deployment_target = '8.0' + s.swift_version = '4.2' + s.static_framework = true +end + diff --git a/flutter_tts-voice_enhancement/lib/flutter_tts.dart b/flutter_tts-voice_enhancement/lib/flutter_tts.dart new file mode 100644 index 00000000..c823a91d --- /dev/null +++ b/flutter_tts-voice_enhancement/lib/flutter_tts.dart @@ -0,0 +1,342 @@ +import 'dart:async'; +import 'dart:io' show Platform; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; + +typedef void ErrorHandler(dynamic message); +typedef ProgressHandler = void Function( + String text, int start, int end, String word); + +const String iosAudioCategoryOptionsKey = 'iosAudioCategoryOptionsKey'; +const String iosAudioCategoryKey = 'iosAudioCategoryKey'; +const String iosAudioCategoryAmbientSolo = 'iosAudioCategoryAmbientSolo'; +const String iosAudioCategoryAmbient = 'iosAudioCategoryAmbient'; +const String iosAudioCategoryPlayback = 'iosAudioCategoryPlayback'; +const String iosAudioCategoryPlaybackAndRecord = + 'iosAudioCategoryPlaybackAndRecord'; + +const String iosAudioCategoryOptionsMixWithOthers = + 'iosAudioCategoryOptionsMixWithOthers'; +const String iosAudioCategoryOptionsDuckOthers = + 'iosAudioCategoryOptionsDuckOthers'; +const String iosAudioCategoryOptionsInterruptSpokenAudioAndMixWithOthers = + 'iosAudioCategoryOptionsInterruptSpokenAudioAndMixWithOthers'; +const String iosAudioCategoryOptionsAllowBluetooth = + 'iosAudioCategoryOptionsAllowBluetooth'; +const String iosAudioCategoryOptionsAllowBluetoothA2DP = + 'iosAudioCategoryOptionsAllowBluetoothA2DP'; +const String iosAudioCategoryOptionsAllowAirPlay = + 'iosAudioCategoryOptionsAllowAirPlay'; +const String iosAudioCategoryOptionsDefaultToSpeaker = + 'iosAudioCategoryOptionsDefaultToSpeaker'; + +enum TextToSpeechPlatform { android, ios } + +enum IosTextToSpeechAudioCategory { + /// Audio is silenced by screen lock and the silent switch; audio will not mix + /// with other apps' audio. + ambientSolo, + + /// Audio is silenced by screen lock and the silent switch; audio will mix + /// with other apps' (mixable) audio. + ambient, + + /// Audio is not silenced by screen lock or silent switch; audio will not mix + /// with other apps' audio. + /// + playback, + + /// The category for recording (input) and playback (output) of audio, + /// such as for a Voice over Internet Protocol (VoIP) app. + /// The default value. + playAndRecord, +} + +enum IosTextToSpeechAudioCategoryOptions { + /// An option that indicates whether audio from this session mixes with audio + /// from active sessions in other audio apps. + mixWithOthers, + + /// An option that reduces the volume of other audio session while audio + /// from this session plays. + duckOthers, + + /// An option that determines whether to pause spoken audio content + /// from other sessions when your app plays its audio. + interruptSpokenAudioAndMixWithOthers, + + ///An option that determines whether Bluetooth hands-free devices + /// appear as available input routes. + allowBluetooth, + + ///An option that determines whether you can stream audio + /// from this session to Bluetooth devices that support the Advanced Audio Distribution Profile (A2DP). + allowBluetoothA2DP, + + ///An option that determines whether you can stream audio + /// from this session to AirPlay devices. + allowAirPlay, + + ///An option that determines whether audio + /// from the session defaults to the built-in speaker instead of the receiver. + /// The default value. + defaultToSpeaker, +} + +class SpeechRateValidRange { + final double min; + final double normal; + final double max; + final TextToSpeechPlatform platform; + + SpeechRateValidRange(this.min, this.normal, this.max, this.platform); +} + +// Provides Platform specific TTS services (Android: TextToSpeech, IOS: AVSpeechSynthesizer) +class FlutterTts { + static const MethodChannel _channel = const MethodChannel('flutter_tts'); + + VoidCallback startHandler; + VoidCallback completionHandler; + VoidCallback pauseHandler; + VoidCallback continueHandler; + VoidCallback cancelHandler; + ProgressHandler progressHandler; + ErrorHandler errorHandler; + + FlutterTts() { + _channel.setMethodCallHandler(platformCallHandler); + } + + /// [Future] which sets speak's future to return on completion of the utterance + Future awaitSpeakCompletion(bool awaitCompletion) async => + _channel.invokeMethod('awaitSpeakCompletion', awaitCompletion); + + /// [Future] which invokes the platform specific method for speaking + Future speak(String text) async => + _channel.invokeMethod('speak', text); + + /// [Future] which invokes the platform specific method for pause + /// ***iOS supported only*** + Future pause() async => _channel.invokeMethod('pause'); + + /// [Future] which invokes the platform specific method for synthesizeToFile + /// ***Android and iOS supported only*** + Future synthesizeToFile(String text, String fileName) async => + _channel.invokeMethod('synthesizeToFile', { + "text": text, + "fileName": fileName, + }); + + /// [Future] which invokes the platform specific method for setLanguage + Future setLanguage(String language) async => + _channel.invokeMethod('setLanguage', language); + + /// [Future] which invokes the platform specific method for setSpeechRate + /// Allowed values are in the range from 0.0 (slowest) to 1.0 (fastest) + Future setSpeechRate(double rate) async => + _channel.invokeMethod('setSpeechRate', rate); + + /// [Future] which invokes the platform specific method for setVolume + /// Allowed values are in the range from 0.0 (silent) to 1.0 (loudest) + Future setVolume(double volume) async => + _channel.invokeMethod('setVolume', volume); + + /// [Future] which invokes the platform specific method for shared instance + /// ***iOS supported only*** + Future setSharedInstance(bool sharedSession) async => + _channel.invokeMethod('setSharedInstance', sharedSession); + + /// [Future] which invokes the platform specific method for setting audio category + /// ***Ios supported only*** + Future setIosAudioCategory(IosTextToSpeechAudioCategory category, + List options) async { + const categoryToString = { + IosTextToSpeechAudioCategory.ambientSolo: iosAudioCategoryAmbientSolo, + IosTextToSpeechAudioCategory.ambient: iosAudioCategoryAmbient, + IosTextToSpeechAudioCategory.playback: iosAudioCategoryPlayback + }; + const optionsToString = { + IosTextToSpeechAudioCategoryOptions.mixWithOthers: + 'iosAudioCategoryOptionsMixWithOthers', + IosTextToSpeechAudioCategoryOptions.duckOthers: + 'iosAudioCategoryOptionsDuckOthers', + IosTextToSpeechAudioCategoryOptions.interruptSpokenAudioAndMixWithOthers: + 'iosAudioCategoryOptionsInterruptSpokenAudioAndMixWithOthers', + IosTextToSpeechAudioCategoryOptions.allowBluetooth: + 'iosAudioCategoryOptionsAllowBluetooth', + IosTextToSpeechAudioCategoryOptions.allowBluetoothA2DP: + 'iosAudioCategoryOptionsAllowBluetoothA2DP', + IosTextToSpeechAudioCategoryOptions.allowAirPlay: + 'iosAudioCategoryOptionsAllowAirPlay', + IosTextToSpeechAudioCategoryOptions.defaultToSpeaker: + 'iosAudioCategoryOptionsDefaultToSpeaker', + }; + if (!Platform.isIOS) return; + try { + return _channel + .invokeMethod('setIosAudioCategory', { + iosAudioCategoryKey: categoryToString[category], + iosAudioCategoryOptionsKey: + options.map((o) => optionsToString[o]).toList(), + }); + } on PlatformException catch (e) { + print( + 'setIosAudioCategory error, category: $category, error: ${e.message}'); + } + } + + /// [Future] which invokes the platform specific method for setPitch + /// 1.0 is default and ranges from .5 to 2.0 + Future setPitch(double pitch) async => + _channel.invokeMethod('setPitch', pitch); + + /// [Future] which invokes the platform specific method for setVoice + /// ***Android, iOS, and macOS supported only*** + Future setVoice(Map voice) async => + _channel.invokeMethod('setVoice', voice); + + /// [Future] which invokes the platform specific method for stop + Future stop() async => _channel.invokeMethod('stop'); + + /// [Future] which invokes the platform specific method for getLanguages + /// Android issues with API 21 & 22 + /// Returns a list of available languages + Future get getLanguages async { + final languages = await _channel.invokeMethod('getLanguages'); + return languages; + } + + /// [Future] which invokes the platform specific method for getEngines + /// Returns a list of installed TTS engines + /// ***Android supported only*** + Future get getEngines async { + final engines = await _channel.invokeMethod('getEngines'); + return engines; + } + + /// [Future] which invokes the platform specific method for getVoices + /// Returns a `List` of `Maps` containing a voice name and locale + /// ***Android, iOS, and macOS supported only*** + Future get getVoices async { + final voices = await _channel.invokeMethod('getVoices'); + return voices; + } + + /// [Future] which invokes the platform specific method for isLanguageAvailable + /// Returns `true` or `false` + Future isLanguageAvailable(String language) async => + _channel.invokeMethod('isLanguageAvailable', language); + + Future get getSpeechRateValidRange async { + final validRange = await _channel.invokeMethod('getSpeechRateValidRange') + as Map; + final min = double.parse(validRange['min'].toString()); + final normal = double.parse(validRange['normal'].toString()); + final max = double.parse(validRange['max'].toString()); + final platformStr = validRange['platform'].toString(); + final platform = TextToSpeechPlatform.values + .firstWhere((e) => describeEnum(e) == platformStr); + + return SpeechRateValidRange(min, normal, max, platform); + } + + /// [Future] which invokes the platform specific method for setSilence + /// 0 means start the utterance immediately. If the value is greater than zero a silence period in milliseconds is set according to the parameter + /// ***Android supported only*** + Future setSilence(int timems) async => + _channel.invokeMethod('setSilence', timems ?? 0); + + void setStartHandler(VoidCallback callback) { + startHandler = callback; + } + + void setCompletionHandler(VoidCallback callback) { + completionHandler = callback; + } + + void setContinueHandler(VoidCallback callback) { + continueHandler = callback; + } + + void setPauseHandler(VoidCallback callback) { + pauseHandler = callback; + } + + void setCancelHandler(VoidCallback callback) { + cancelHandler = callback; + } + + void setProgressHandler(ProgressHandler callback) { + progressHandler = callback; + } + + void setErrorHandler(ErrorHandler handler) { + errorHandler = handler; + } + + /// Platform listeners + Future platformCallHandler(MethodCall call) async { + switch (call.method) { + case "speak.onStart": + if (startHandler != null) { + startHandler(); + } + break; + case "synth.onStart": + if (startHandler != null) { + startHandler(); + } + break; + case "speak.onComplete": + if (completionHandler != null) { + completionHandler(); + } + break; + case "synth.onComplete": + if (completionHandler != null) { + completionHandler(); + } + break; + case "speak.onPause": + if (pauseHandler != null) { + pauseHandler(); + } + break; + case "speak.onContinue": + if (continueHandler != null) { + continueHandler(); + } + break; + case "speak.onCancel": + if (cancelHandler != null) { + cancelHandler(); + } + break; + case "speak.onError": + if (errorHandler != null) { + errorHandler(call.arguments); + } + break; + case 'speak.onProgress': + if (progressHandler != null) { + final args = call.arguments as Map; + progressHandler( + args['text'].toString(), + int.parse(args['start'].toString()), + int.parse(args['end'].toString()), + args['word'].toString(), + ); + } + break; + case "synth.onError": + if (errorHandler != null) { + errorHandler(call.arguments); + } + break; + default: + print('Unknowm method ${call.method}'); + } + } +} diff --git a/flutter_tts-voice_enhancement/lib/flutter_tts_web.dart b/flutter_tts-voice_enhancement/lib/flutter_tts_web.dart new file mode 100644 index 00000000..182e9dfa --- /dev/null +++ b/flutter_tts-voice_enhancement/lib/flutter_tts_web.dart @@ -0,0 +1,184 @@ +import 'dart:async'; +import 'dart:html' as html; +import 'dart:js'; + +import 'package:flutter/services.dart'; +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; + +enum TtsState { playing, stopped, paused, continued } + +class FlutterTtsPlugin { + static const String PLATFORM_CHANNEL = "flutter_tts"; + static MethodChannel channel; + bool awaitSpeakCompletion = false; + + TtsState ttsState = TtsState.stopped; + + get isPlaying => ttsState == TtsState.playing; + + get isStopped => ttsState == TtsState.stopped; + + get isPaused => ttsState == TtsState.paused; + + get isContinued => ttsState == TtsState.continued; + + static void registerWith(Registrar registrar) { + channel = MethodChannel( + PLATFORM_CHANNEL, const StandardMethodCodec(), registrar.messenger); + final instance = FlutterTtsPlugin(); + channel.setMethodCallHandler(instance.handleMethodCall); + } + + html.SpeechSynthesis synth; + html.SpeechSynthesisUtterance utterance; + List voices; + List languages; + + FlutterTtsPlugin() { + utterance = html.SpeechSynthesisUtterance(); + synth = html.window.speechSynthesis; + + _listeners(); + } + + void _listeners() { + utterance.onStart.listen((e) { + ttsState = TtsState.playing; + channel.invokeMethod("speak.onStart", null); + }); + utterance.onEnd.listen((e) { + ttsState = TtsState.stopped; + channel.invokeMethod("speak.onComplete", null); + if (awaitSpeakCompletion) { + return 1; + } + }); + utterance.onPause.listen((e) { + ttsState = TtsState.paused; + channel.invokeMethod("speak.onPause", null); + }); + utterance.onResume.listen((e) { + ttsState = TtsState.continued; + channel.invokeMethod("speak.onContinue", null); + }); + utterance.onError.listen((e) { + channel.invokeMethod("speak.onError", e); + if (awaitSpeakCompletion) { + return 0; + } + }); + } + + Future handleMethodCall(MethodCall call) async { + switch (call.method) { + case 'speak': + final text = call.arguments as String; + _speak(text); + if (!awaitSpeakCompletion) { + return 1; + } + break; + case 'awaitSpeakCompletion': + awaitSpeakCompletion = call.arguments as bool; + return 1; + break; + case 'stop': + _stop(); + return 1; + break; + case 'pause': + _pause(); + return 1; + break; + case 'setLanguage': + final language = call.arguments as String; + _setLanguage(language); + return 1; + break; + case 'getLanguages': + return _getLanguages(); + break; + case 'setSpeechRate': + final rate = call.arguments as num; + _setRate(rate); + return 1; + break; + case 'setVolume': + final volume = call.arguments as num; + _setVolume(volume); + return 1; + break; + case 'setPitch': + final pitch = call.arguments as num; + _setPitch(pitch); + return 1; + break; + case 'isLanguageAvailable': + final lang = call.arguments as String; + return _isLanguageAvailable(lang); + break; + default: + throw PlatformException( + code: 'Unimplemented', + details: "The flutter_tts plugin for web doesn't implement " + "the method '${call.method}'"); + } + } + + void _speak(String text) { + if (ttsState == TtsState.stopped || ttsState == TtsState.paused) { + utterance.text = text; + if (ttsState == TtsState.paused) { + synth.resume(); + } else { + synth.speak(utterance); + } + } + } + + void _stop() { + if (ttsState != TtsState.stopped) { + synth.cancel(); + } + } + + void _pause() { + if (ttsState == TtsState.playing || ttsState == TtsState.continued) { + synth.pause(); + } + } + + void _setRate(num rate) => utterance.rate = rate * 2.0; + void _setVolume(num volume) => utterance.volume = volume; + void _setPitch(num pitch) => utterance.pitch = pitch; + void _setLanguage(String language) => utterance.lang = language; + + bool _isLanguageAvailable(String language) { + if (voices?.isEmpty ?? true) _setVoices(); + if (languages?.isEmpty ?? true) _setLanguages(); + for (var lang in languages) { + if (lang.toLowerCase() == language.toLowerCase()) return true; + } + return false; + } + + List _getLanguages() { + if (voices?.isEmpty ?? true) _setVoices(); + if (languages?.isEmpty ?? true) _setLanguages(); + return languages; + } + + void _setVoices() { + voices = + context['speechSynthesis'].callMethod('getVoices') as JsArray; + } + + void _setLanguages() { + var langs = Set(); + for (var v in voices) { + langs.add(v['lang'] as String); + } + + languages = langs.toList(); + } +} diff --git a/flutter_tts-voice_enhancement/macos/Classes/FlutterTtsPlugin.swift b/flutter_tts-voice_enhancement/macos/Classes/FlutterTtsPlugin.swift new file mode 100644 index 00000000..ec4bffa1 --- /dev/null +++ b/flutter_tts-voice_enhancement/macos/Classes/FlutterTtsPlugin.swift @@ -0,0 +1,315 @@ +import FlutterMacOS +import Foundation +import AVFoundation + +public class FlutterTtsPlugin: NSObject, FlutterPlugin, AVSpeechSynthesizerDelegate { + final var iosAudioCategoryKey = "iosAudioCategoryKey" + final var iosAudioCategoryOptionsKey = "iosAudioCategoryOptionsKey" + + let synthesizer = AVSpeechSynthesizer() + var language: String = AVSpeechSynthesisVoice.currentLanguageCode() + var rate: Float = AVSpeechUtteranceDefaultSpeechRate + var languages = Set() + var volume: Float = 1.0 + var pitch: Float = 1.0 + var voice: AVSpeechSynthesisVoice? + var awaitSpeakCompletion: Bool = false + var speakResult: FlutterResult! + + var channel = FlutterMethodChannel() + init(channel: FlutterMethodChannel) { + super.init() + self.channel = channel + synthesizer.delegate = self + setLanguages() + } + + private func setLanguages() { + for voice in AVSpeechSynthesisVoice.speechVoices(){ + self.languages.insert(voice.language) + } + } + + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "flutter_tts", binaryMessenger: registrar.messenger) + let instance = FlutterTtsPlugin(channel: channel) + registrar.addMethodCallDelegate(instance, channel: channel) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + switch call.method { + case "speak": + let text: String = call.arguments as! String + self.speak(text: text, result: result) + break + case "awaitSpeakCompletion": + self.awaitSpeakCompletion = call.arguments as! Bool + result(1) + break + case "synthesizeToFile": + guard let args = call.arguments as? [String: Any] else { + result("iOS could not recognize flutter arguments in method: (sendParams)") + return + } + let text = args["text"] as! String + let fileName = args["fileName"] as! String + self.synthesizeToFile(text: text, fileName: fileName, result: result) + break + case "pause": + self.pause(result: result) + break + case "setLanguage": + let language: String = call.arguments as! String + self.setLanguage(language: language, result: result) + break + case "setSpeechRate": + let rate: Double = call.arguments as! Double + self.setRate(rate: Float(rate)) + result(1) + break + case "setVolume": + let volume: Double = call.arguments as! Double + self.setVolume(volume: Float(volume), result: result) + break + case "setPitch": + let pitch: Double = call.arguments as! Double + self.setPitch(pitch: Float(pitch), result: result) + break + case "stop": + self.stop() + result(1) + break + case "getLanguages": + self.getLanguages(result: result) + break + case "getSpeechRateValidRange": + self.getSpeechRateValidRange(result: result) + break + case "isLanguageAvailable": + let language: String = call.arguments as! String + self.isLanguageAvailable(language: language, result: result) + break + case "getVoices": + self.getVoices(result: result) + break + case "setVoice": + guard let args = call.arguments as? [String: String] else { + result("iOS could not recognize flutter arguments in method: (sendParams)") + return + } + self.setVoice(voice: args, result: result) + break + default: + result(FlutterMethodNotImplemented) + } + } + + private func speak(text: String, result: @escaping FlutterResult) { + if (self.synthesizer.isPaused) { + if (self.synthesizer.continueSpeaking()) { + if self.awaitSpeakCompletion { + self.speakResult = result + } else { + result(1) + } + } else { + result(0) + } + } else { + let utterance = AVSpeechUtterance(string: text) + if self.voice != nil { + utterance.voice = self.voice! + } else { + utterance.voice = AVSpeechSynthesisVoice(language: self.language) + } + utterance.rate = self.rate + utterance.volume = self.volume + utterance.pitchMultiplier = self.pitch + + self.synthesizer.speak(utterance) + if self.awaitSpeakCompletion { + self.speakResult = result + } else { + result(1) + } + } + } + + private func synthesizeToFile(text: String, fileName: String, result: FlutterResult) { + var output: AVAudioFile? + var failed = false + let utterance = AVSpeechUtterance(string: text) + + if #available(iOS 13.0, *) { + self.synthesizer.write(utterance) { (buffer: AVAudioBuffer) in + guard let pcmBuffer = buffer as? AVAudioPCMBuffer else { + NSLog("unknow buffer type: \(buffer)") + failed = true + return + } + print(pcmBuffer.format) + if pcmBuffer.frameLength == 0 { + // finished + } else { + // append buffer to file + let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent(fileName) + NSLog("Saving utterance to file: \(fileURL.absoluteString)") + + if output == nil { + do { + output = try AVAudioFile( + forWriting: fileURL, + settings: pcmBuffer.format.settings, + commonFormat: .pcmFormatInt16, + interleaved: false) + } catch { + NSLog(error.localizedDescription) + failed = true + return + } + } + + try! output!.write(from: pcmBuffer) + } + } + } else { + result("Unsupported iOS version") + } + if failed { + result(0) + } + result(1) + } + + private func pause(result: FlutterResult) { + if (self.synthesizer.pauseSpeaking(at: AVSpeechBoundary.word)) { + result(1) + } else { + result(0) + } + } + + private func setLanguage(language: String, result: FlutterResult) { + if !(self.languages.contains(where: {$0.range(of: language, options: [.caseInsensitive, .anchored]) != nil})) { + result(0) + } else { + self.language = language + self.voice = nil + result(1) + } + } + + private func setRate(rate: Float) { + self.rate = rate + } + + private func setVolume(volume: Float, result: FlutterResult) { + if (volume >= 0.0 && volume <= 1.0) { + self.volume = volume + result(1) + } else { + result(0) + } + } + + private func setPitch(pitch: Float, result: FlutterResult) { + if (volume >= 0.5 && volume <= 2.0) { + self.pitch = pitch + result(1) + } else { + result(0) + } + } + + private func stop() { + self.synthesizer.stopSpeaking(at: AVSpeechBoundary.immediate) + } + + private func getLanguages(result: FlutterResult) { + result(Array(self.languages)) + } + + private func getSpeechRateValidRange(result: FlutterResult) { + let validSpeechRateRange: [String:String] = [ + "min": String(AVSpeechUtteranceMinimumSpeechRate), + "normal": String(AVSpeechUtteranceDefaultSpeechRate), + "max": String(AVSpeechUtteranceMaximumSpeechRate), + "platform": "ios" + ] + result(validSpeechRateRange) + } + + private func isLanguageAvailable(language: String, result: FlutterResult) { + var isAvailable: Bool = false + if (self.languages.contains(where: {$0.range(of: language, options: [.caseInsensitive, .anchored]) != nil})) { + isAvailable = true + } + result(isAvailable); + } + + private func getVoices(result: FlutterResult) { + if #available(iOS 9.0, *) { + let voices = NSMutableArray() + var voiceDict: [String: String] = [:] + for voice in AVSpeechSynthesisVoice.speechVoices() { + voiceDict["name"] = voice.name + voiceDict["locale"] = voice.language + voices.add(voiceDict) + } + result(voices) + } else { + // Since voice selection is not supported below iOS 9, make voice getter and setter + // have the same bahavior as language selection. + getLanguages(result: result) + } + } + + private func setVoice(voice: [String:String], result: FlutterResult) { + if #available(iOS 9.0, *) { + if let voice = AVSpeechSynthesisVoice.speechVoices().first(where: { $0.name == voice["name"]! && $0.language == voice["locale"]! }) { + self.voice = voice + self.language = voice.language + result(1) + return + } + result(0) + } else { + setLanguage(language: voice["name"]!, result: result) + } + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didFinish utterance: AVSpeechUtterance) { + if self.awaitSpeakCompletion { + self.speakResult(1) + } + self.channel.invokeMethod("speak.onComplete", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didStart utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onStart", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didPause utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onPause", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didContinue utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onContinue", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, didCancel utterance: AVSpeechUtterance) { + self.channel.invokeMethod("speak.onCancel", arguments: nil) + } + + public func speechSynthesizer(_ synthesizer: AVSpeechSynthesizer, willSpeakRangeOfSpeechString characterRange: NSRange, utterance: AVSpeechUtterance) { + let nsWord = utterance.speechString as NSString + let data: [String:String] = [ + "text": utterance.speechString, + "start": String(characterRange.location), + "end": String(characterRange.location + characterRange.length), + "word": nsWord.substring(with: characterRange) + ] + self.channel.invokeMethod("speak.onProgress", arguments: data) + } + +} diff --git a/flutter_tts-voice_enhancement/macos/flutter_tts.podspec b/flutter_tts-voice_enhancement/macos/flutter_tts.podspec new file mode 100644 index 00000000..2838eb07 --- /dev/null +++ b/flutter_tts-voice_enhancement/macos/flutter_tts.podspec @@ -0,0 +1,22 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# +Pod::Spec.new do |s| + s.name = 'flutter_tts' + s.version = '0.0.1' + s.summary = 'macOS implementation of the flutter_tts plugin.' + s.description = <<-DESC + A flutter text to speech plugin + DESC + s.homepage = 'https://github.com/dlutton/flutter_tts' + s.license = { :file => '../LICENSE' } + s.author = { 'Daniel Lutton' => 'eyedea32@gmail.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'FlutterMacOS' + + s.platform = :osx, '10.15' + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.swift_version = '5.0' + + end \ No newline at end of file diff --git a/flutter_tts-voice_enhancement/pubspec.yaml b/flutter_tts-voice_enhancement/pubspec.yaml new file mode 100644 index 00000000..06e93f33 --- /dev/null +++ b/flutter_tts-voice_enhancement/pubspec.yaml @@ -0,0 +1,28 @@ +name: flutter_tts +description: A flutter plugin for Text to Speech. This plugin is supported on iOS, Android, Web, & macOS. +version: 1.3.0 +homepage: https://github.com/dlutton/flutter_tts + +dependencies: + flutter: + sdk: flutter + flutter_web_plugins: + sdk: flutter + +flutter: + plugin: + platforms: + android: + package: com.tundralabs.fluttertts + pluginClass: FlutterTtsPlugin + ios: + pluginClass: FlutterTtsPlugin + macos: + pluginClass: FlutterTtsPlugin + web: + pluginClass: FlutterTtsPlugin + fileName: flutter_tts_web.dart + +environment: + sdk: ">=2.1.0 <3.0.0" + flutter: ">=1.12.13+hotfix.5 <2.0.0" diff --git a/lib/core/model/ImagesInfo.dart b/lib/core/model/ImagesInfo.dart new file mode 100644 index 00000000..5ab48fb3 --- /dev/null +++ b/lib/core/model/ImagesInfo.dart @@ -0,0 +1,6 @@ +class ImagesInfo { + final String imageAr; + final String imageEn; + + ImagesInfo({this.imageAr, this.imageEn}); +}