Giter Club home page Giter Club logo

Comments (14)

jamesmontemagno avatar jamesmontemagno commented on August 17, 2024 1

@EmilAlipiev try 3.3.1 here in a few mins

from texttospeechplugin.

prashantvc avatar prashantvc commented on August 17, 2024

Could you add following details to the bug report?

Bug Information

Version Number of Plugin:
Device Tested On:
Simulator Tested On:
Version of VS:
Version of Xamarin:
Versions of other things you are using:

Steps to reproduce the Behavior

Expected Behavior

Actual Behavior

Code snippet

Screenshotst

from texttospeechplugin.

jamesmontemagno avatar jamesmontemagno commented on August 17, 2024

I have fixed UWP, however as documented the volume has no impact on Android as there is No API to do it.

from texttospeechplugin.

jamesmontemagno avatar jamesmontemagno commented on August 17, 2024

I actually got something working now for Android :)

from texttospeechplugin.

pollaris avatar pollaris commented on August 17, 2024

Can you help me correct this Android C# syntax? The following has the same problem on android. It plays at full volume even though the volume is set to zero:

        Bundle b = new Bundle();
        b.PutFloat(key: "KEY_PARAM_VOLUME", value: 0);       
        speaker = new TextToSpeech(Android.App.Application.Context, this);               
        speaker.Speak("hello", QueueMode.Flush, b, null);

from texttospeechplugin.

EmilAlipiev avatar EmilAlipiev commented on August 17, 2024

on Uwp desktop I am not getting any sound although it says IsSupported=true, is there something special need to be done. it was working before with old version of the package. i updated without code change and it works on android but uwp, no sound.
I simply do

await Plugin.TextToSpeech.CrossTextToSpeech.Current.Speak(textToSpeech, crossLocale: Helpers.Settings.CurrentLocale, cancelToken: ct);

from texttospeechplugin.

jamesmontemagno avatar jamesmontemagno commented on August 17, 2024

@EmilAlipiev good one. fixed it now in 3.2.1

from texttospeechplugin.

pollaris avatar pollaris commented on August 17, 2024

kudos ... the following is working on windows phone and android now:

   await CrossTextToSpeech.Current.Speak(text:s, volume: 0.2f);

from texttospeechplugin.

pollaris avatar pollaris commented on August 17, 2024

You are changing the master volume of the phone, and not restoring it to what it was prior to the call. I cannot use the plugin as it stands.

from texttospeechplugin.

jamesmontemagno avatar jamesmontemagno commented on August 17, 2024

I am setting the Music volume, not the phone volume: am.GetStreamMaxVolume(Stream.Music);

Would also appreciate if you wrote literally anything constructive here at all and not attempt to write in a way that puts down contributors.

What is your "work around" to setting audio and what is the proposed way that you would like for it to work. Android works very different then iOS/Windows as you can't set the volume of the specific stream.

from texttospeechplugin.

pollaris avatar pollaris commented on August 17, 2024

I was hoping your plugin would enable me to adjust the volume the way I do in Android Studio. Here is the code:

private TextToSpeech tts;

public void speakthetext2(String s) {
    final String msg = s;
    tts = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
        @Override
        public void onInit(int status) {
            if (status != TextToSpeech.ERROR) {
                Bundle b = new Bundle();
                b.putFloat(KEY_PARAM_VOLUME, 0.2f);
                tts.speak(msg, TextToSpeech.QUEUE_ADD, b, "1");
            } else {
                Toast.makeText(getApplicationContext(), "tts error!", Toast.LENGTH_LONG).show();
            }
        }
    });
}

I was hoping for a cross plaform plugin that would enable me to adjust the volume as above for the text message being spoken in my app.

from texttospeechplugin.

jamesmontemagno avatar jamesmontemagno commented on August 17, 2024

Got it, see that wasn't too hard to explain what you actually wanted it to do and how you were able to accomplish this in java.

So, I have adjust the functionality. If you pass in "null" or don't set the volume it will use the system defaults for whatever the OS decides, which is probably 100%. If you do pass it in then I will set the specific stream's audio on all OS's to use the volume that you pass in.

Since this is a tweak and I need to test a bit more I have a pre-release nuget that you can use: 3.3.0.X-beta

from texttospeechplugin.

EmilAlipiev avatar EmilAlipiev commented on August 17, 2024

@jamesmontemagno I am not sure if that is related to what @pollaris is telling but latest stable version restores my phones volume to highest volume when I use it as below without setting any volume parameter. earlier versions didnt have that behavior

await Plugin.TextToSpeech.CrossTextToSpeech.Current.Speak(textToSpeech, crossLocale: Helpers.Settings.CurrentLocale, cancelToken: ct);

from texttospeechplugin.

pollaris avatar pollaris commented on August 17, 2024

3.3.2 is working on android and windows phone now. Thanks for your help.

from texttospeechplugin.

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.