Example usage for android.media ToneGenerator stopTone

List of usage examples for android.media ToneGenerator stopTone

Introduction

In this page you can find the example usage for android.media ToneGenerator stopTone.

Prototype

public native void stopTone();

Source Link

Document

This method stops the tone currently playing playback.

Usage

From source file:com.bangz.shotrecorder.RecordActivity.java

private void doStartRecord() {

    doDelayStart();//www  . j  a  v a  2  s .co m

    ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_MUSIC, 100);
    tg.startTone(ToneGenerator.TONE_CDMA_ABBR_ALERT, BEEP_DURATIONMS);
    SystemClock.sleep(BEEP_DURATIONMS - 20);
    tg.stopTone();
    tg.release();

    mState = STATE_RECORDING;
    Intent intent = new Intent(this, RecordService.class);

    intent.putExtra(RecordService.EXTRA_SAMPLERATE, mSampleRate);
    intent.putExtra(RecordService.EXTRA_CHANNLES, mChannels);
    intent.putExtra(RecordService.EXTRA_ENCODDING, mEncoding);

    intent.putExtra(RecordService.EXTRA_MODE, mMode.ordinal());
    intent.putExtra(RecordService.EXTRA_MAXSHOT, this.mMaxShots);
    intent.putExtra(RecordService.EXTRA_MAXPARTIME, (int) (mMaxParTime * 1000));
    intent.putExtra(RecordService.EXTRA_CAPTURESIZE, 128);
    intent.putExtra(RecordService.EXTRA_MAXRECORDTIME, 5 * 60);
    startService(intent);

    doBindService();

    textTIME.setText(R.string.READY);
}