0

I wanna create something like that in Dart code, NOT in Java:

while tts engine reads the text, a background color follows it

While tts engine reads some text, a background color follows it helping the reader. It's much more than THAT another question you answered.

1 Answers1

-1

1.

                HashMap<String, String> params = new HashMap<String, String>();
                params.put( TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "stringId" );
                tts.speak( text, TextToSpeech.QUEUE_FLUSH, params );

2.

                if( Build.VERSION.SDK_INT >= 15 ){
                    tts.setOnUtteranceProgressListener( new UtteranceProgressListener(){
                        @Override
                        public void onStart( String s ){
                        }

                        @Override
                        public void onDone( String s ){
                        }

                        @Override
                        public void onError( String s ){
                        }
                    } );
                }else{
                    tts.setOnUtteranceCompletedListener( new TextToSpeech.OnUtteranceCompletedListener(){
                        @Override
                        public void onUtteranceCompleted( String s ){
                        }
                    } );
                }
Style-7
  • 985
  • 12
  • 27