Last active
November 21, 2017 18:51
-
-
Save varren/0262f7f23df50592038bf3f26dc61fe9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I/System.out: AudioSystem stream -1 STREAM_DEFAULT | |
D/com.example.MainActivity: After 1st: 8 | |
D/com.example.MainActivity: After 2nd: 1 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 0 STREAM_VOICE_CALL | |
D/com.example.MainActivity: After 1st: 325 | |
D/com.example.MainActivity: After 2nd: 1 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 1 STREAM_SYSTEM | |
D/com.example.MainActivity: After 1st: 17 | |
D/com.example.MainActivity: After 2nd: 2 | |
D/com.example.MainActivity: After 3rd: 3 | |
I/System.out: AudioSystem stream 2 STREAM_RING | |
D/com.example.MainActivity: After 1st: 28 | |
D/com.example.MainActivity: After 2nd: 2 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 3 STREAM_MUSIC | |
D/com.example.MainActivity: After 1st: 19 | |
D/com.example.MainActivity: After 2nd: 1 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 4 STREAM_ALARM | |
D/com.example.MainActivity: After 1st: 28 | |
D/com.example.MainActivity: After 2nd: 1 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 5 STREAM_NOTIFICATION | |
D/com.example.MainActivity: After 1st: 16 | |
D/com.example.MainActivity: After 2nd: 1 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 6 STREAM_BLUETOOTH_SCO | |
D/com.example.MainActivity: After 1st: 332 | |
D/com.example.MainActivity: After 2nd: 2 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 7 STREAM_SYSTEM_ENFORCED | |
D/com.example.MainActivity: After 1st: 324 | |
D/com.example.MainActivity: After 2nd: 1 | |
D/com.example.MainActivity: After 3rd: 1 | |
I/System.out: AudioSystem stream 8 STREAM_DTMF | |
D/com.example.MainActivity: After 1st: 26 | |
D/com.example.MainActivity: After 2nd: 2 | |
D/com.example.MainActivity: After 3rd: 4 | |
I/System.out: AudioSystem stream 9 STREAM_TTS | |
D/com.example.MainActivity: After 1st: 12 | |
D/com.example.MainActivity: After 2nd: 4 | |
D/com.example.MainActivity: After 3rd: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void test (){ | |
for (int i = -1; i <10; i++) { | |
System.out.println("AudioSystem stream " + i); | |
mDTMFPlayer = new ToneGenerator(i, TONE_RELATIVE_VOLUME); | |
long startTime = System.currentTimeMillis(); | |
mDTMFPlayer.startTone(ToneGenerator.TONE_DTMF_0, 160); | |
Log.d(TAG, "After 1st: " + (System.currentTimeMillis() - startTime)); | |
try { | |
Thread.sleep(160); | |
} catch (InterruptedException e) { | |
} | |
mDTMFPlayer.stopTone(); | |
startTime = System.currentTimeMillis(); | |
mDTMFPlayer.startTone(ToneGenerator.TONE_DTMF_0, 160); | |
Log.d(TAG, "After 2nd: " + (System.currentTimeMillis() - startTime)); | |
try { | |
Thread.sleep(160); | |
} catch (InterruptedException e) { | |
} | |
mDTMFPlayer.stopTone(); | |
startTime = System.currentTimeMillis(); | |
mDTMFPlayer.startTone(ToneGenerator.TONE_DTMF_0, 160); | |
Log.d(TAG, "After 3rd: " + (System.currentTimeMillis() - startTime)); | |
try { | |
Thread.sleep(160); | |
} catch (InterruptedException e) { | |
} | |
mDTMFPlayer.stopTone(); | |
mDTMFPlayer.release(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment