Android Java Text to Speech Viewing Extra String Information

后端 未结 1 1210
悲哀的现实
悲哀的现实 2021-01-27 01:35

I\'ve been running through many of the text to speech examples available for Android and I have an issue that I assume is really simple, but I cannot for the life of me work it

1条回答
  •  心在旅途
    2021-01-27 02:35

    For anyone who is ever stuck with the same thing, I used the code below, edited from the sample found here:

        ArrayList available = data
                    .getStringArrayListExtra("availableVoices");
            Log.v("languages count", String.valueOf(available.size()));
            Iterator iter = available.iterator();
            while (iter.hasNext()) {
                String lang = iter.next();
                Locale locale = new Locale(lang);
                Log.v(TAG, "language: " + lang);
                Log.v(TAG, "language locale: " + locale.toString());
    
                TextView LocaleResults = (TextView) getView().findViewById(
                        R.id.textViewConfig);
                LocaleResults.append("\nAvailable Engine Language: " + lang);
    
            }
    
            ArrayList unavailable = data
                    .getStringArrayListExtra("unavailableVoices");
            Log.v("languages count", String.valueOf(unavailable.size()));
            Iterator iteru = unavailable.iterator();
            while (iteru.hasNext()) {
                String ulang = iteru.next();
                Locale ulocale = new Locale(ulang);
                Log.v(TAG, "ulanguage: " + ulang);
                Log.v(TAG, "ulanguage locale: " + ulocale.toString());
    
                TextView LocaleResults = (TextView) getView().findViewById(
                        R.id.textViewConfig);
                LocaleResults.append("\nUnavailable Engine Language: " + ulang);
    
            }
    

    0 讨论(0)
提交回复
热议问题