Android Open Source - surveygcp T T S






From Project

Back to project page surveygcp.

License

The source code is released under:

GNU General Public License

If you think the Android project surveygcp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.droidplanner.gcp.helpers;
/*www .  j  a v  a 2s .  c  o  m*/
import java.util.Locale;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;

public class TTS implements OnInitListener {

  TextToSpeech tts;
  private SharedPreferences prefs;

  public TTS(Context context) {
    tts = new TextToSpeech(context, this);
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
  }

  @Override
  public void onInit(int status) {
    tts.setLanguage(Locale.US);
  }

  public void speak(String string) {
    if (tts != null) {
      if (shouldEnableTTS()) {
        tts.speak(string, TextToSpeech.QUEUE_FLUSH, null);
      }
    }
  }

  private boolean shouldEnableTTS() {
    return prefs.getBoolean("pref_enable_tts", false);
  }

}




Java Source Code List

android.UnusedStub.java
org.droidplanner.gcp.GCPApp.java
org.droidplanner.gcp.activitys.GCPActivity.java
org.droidplanner.gcp.activitys.SettingsActivity.java
org.droidplanner.gcp.dialogs.openfile.OpenFileDialog.java
org.droidplanner.gcp.dialogs.openfile.OpenGcpFileDialog.java
org.droidplanner.gcp.file.DirectoryPath.java
org.droidplanner.gcp.file.FileList.java
org.droidplanner.gcp.file.IO.GcpReader.java
org.droidplanner.gcp.fragments.GcpMapFragment.java
org.droidplanner.gcp.fragments.helpers.OfflineMapFragment.java
org.droidplanner.gcp.fragments.markers.GcpMarker.java
org.droidplanner.gcp.fragments.markers.MarkerManager.java
org.droidplanner.gcp.gcp.Gcp.java
org.droidplanner.gcp.helpers.LocalMapTileProvider.java
org.droidplanner.gcp.helpers.TTS.java