Code example for TextToSpeech

Methods: shutdown

0
 
    @Override 
    protected void onDetachedFromWindow() { 
        super.onDetachedFromWindow(); 
 
        mTts.shutdown();
    } 
 
    @Override 
    protected void onDraw(Canvas canvas) {
        Vector<String> lines = new Vector<String>();
        lines.add("Queued: " + mNewUtterances.size());
        lines.add("Speaking: " + (mCurrentUtterance != null));
        lines.add("Spoken: " + mOldUtterances.size());
 
        final Paint p = new Paint();
        final int kLargeTextSize = 20;
        final int kSmallTextSize = 16;
        final int kTextBufferSize = 4;
 
        // TODO(andrewharp): Don't hardcode this, figure out the text