Giter Club home page Giter Club logo

Comments (13)

KarHack avatar KarHack commented on June 8, 2024 2

@KarHack Will do that, next time. Thank you.
@dlutton Thanks a ton for the Library, I am Closing the Issue.

from flutter_tts.

IvanBean avatar IvanBean commented on June 8, 2024 1

@dlutton I copy main.dart from example too, not clone full project, sorry for misleading in my first comment.
@KarHack maybe we meet the same problem that device can't play sounds without AVAudioSessionCategoryPlayback, you can try to edit AppDelegare.swift in my comment above as a temporary workaround if it works for you.

from flutter_tts.

IvanBean avatar IvanBean commented on June 8, 2024 1

@dlutton sorry that I made a stupid mistake that tested on the silent mode you mentioned above, the library works in iOS.
I've created a PR #24 to enable playback in silent mode, thanks.

from flutter_tts.

dlutton avatar dlutton commented on June 8, 2024 1

@IvanBean I have merged the PR. I'll have to refactor it once I upgrade the code to swift 4.2 since there appears to be issues. I'm hoping the ios/swift team can correct it without having to apply a bandaid.

from flutter_tts.

dlutton avatar dlutton commented on June 8, 2024

@KarHack Are you testing on an emulator or real device? I have tested the example on an iphone XR 12.1 emulator and a real device (iphone XS max) running iOS 12.1.2 and it's working.

from flutter_tts.

IvanBean avatar IvanBean commented on June 8, 2024

Similar issue here, clone the example and testing on real device iPhone 7 running iOS 12.1.2. Many languages shows duplicate item: https://i.imgur.com/B69Cfgx.png, select the duplicated one leads to an error: https://i.imgur.com/1ejQp7v.png.

Other selectable language dosen't play sound when hit the button, tested on plugin version 0.1.2 and 0.2.0.

Android works well include the voices options which just added in 0.2.0.

Thanks for your effort, any reply will be appreciated.

Edit: sorry it's copy .dart from example, not clone full project.

from flutter_tts.

dlutton avatar dlutton commented on June 8, 2024

@KarHack @IvanBean can one of you test the latest 0.2.1 package I just published? Thank you

from flutter_tts.

KarHack avatar KarHack commented on June 8, 2024

I just cleaned and checked 0.2.1 package, on Iphone 6s running iOS 12.1.2. It is still not working.
Thanks for your quick reply and effort, really great project.

from flutter_tts.

IvanBean avatar IvanBean commented on June 8, 2024

Hi @dlutton

Thanks for the quick reply, the duplicate language is fixed now.

About the voice, after some investigating I found one solution is to modify AppDelegare.swift under my flutter project's ios/Runner directory, full code:

import UIKit
import Flutter
import AVFoundation  // Add this line.

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  ) -> Bool {
    // Add below.
    do {
        try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
        do {
            try AVAudioSession.sharedInstance().setActive(true)
        } catch {
            
        }
    } catch {
        
    }
    // Add above.
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

In this way the voice can play successfully, however, I'm an Android developer and new to Flutter so I don't know whether this is a correct approach. Thanks.

from flutter_tts.

dlutton avatar dlutton commented on June 8, 2024

Unfortunately i don't have a 6s phone to test it on @KarHack. I did test a 6s emulator and it's working. The voice is also working when I test on my physical device (iphone Xs). Are there any error logs you can provide from your device?

from flutter_tts.

dlutton avatar dlutton commented on June 8, 2024

and sorry for the dumb question, but did you make sure to turn off your silent mode (the physical switch)?

from flutter_tts.

KarHack avatar KarHack commented on June 8, 2024

I cloned the project, and its working on the Iphone 6s iOS 12.1.2.
Yes, I did make sure that the phone was out of silent mode (physical switch), but yes now it's working once I cloned the project.
Probably I missed something when copying from the example. Thanks a ton.
I am not an iOS developer, so what should I do if I have to implement this into an existing application?

from flutter_tts.

dlutton avatar dlutton commented on June 8, 2024

@IvanBean thanks for the PR. I'll test it out and merge if everything works.

from flutter_tts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.