Code example for Context

Methods: getFilesDir

0
 
    	sr = SpeechRecognizer.createSpeechRecognizer(context);
    } 
 
    public void setTemporaryFile(String fileName) {
    	aacFile = context.getFilesDir().toString() + "/" + fileName;
    } 
 
    public String getTemporaryFile() {
    	return aacFile;
    } 
 
    public void setListener(RecognizerApiListener listener) {
    	this.mListener = listener;
    } 
 
    public static void play(Activity activity, String file, PlaybackExceptionHandler handler) {
        MediaPlayer mediaPlayer = new MediaPlayer();
 
        try { 
            mediaPlayer.setDataSource(file);