Lines Matching defs:track
87 AudioTrack track = null;
89 track = new AudioTrack(
102 if (track != null) {
103 localRes = (track.getState() == _expected_stateForMode);
104 track.release();
262 AudioTrack track = null;
268 track = new AudioTrack(STREAM_TYPES[i],
278 if (track != null) {
279 if (track.getState() != AudioTrack.STATE_INITIALIZED) {
285 track.release();
312 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
315 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
316 assertTrue(TEST_NAME, track.getPlaybackHeadPosition() == 0);
318 track.release();
334 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
338 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
339 track.write(data, 0, data.length);
340 track.write(data, 0, data.length);
341 track.play();
343 log(TEST_NAME, "position ="+ track.getPlaybackHeadPosition());
344 assertTrue(TEST_NAME, track.getPlaybackHeadPosition() > 0);
346 track.release();
362 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
366 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
367 track.write(data, 0, data.length);
368 track.write(data, 0, data.length);
369 track.play();
371 track.stop();
372 track.flush();
373 log(TEST_NAME, "position ="+ track.getPlaybackHeadPosition());
374 assertTrue(TEST_NAME, track
376 track.release();
392 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
396 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
397 track.write(data, 0, data.length);
398 track.write(data, 0, data.length);
399 track.play();
401 track.stop();
403 int pos = track.getPlaybackHeadPosition();
407 track.release();
423 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
427 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
428 track.write(data, 0, data.length);
429 track.write(data, 0, data.length);
430 track.play();
432 track.pause();
433 int pos = track.getPlaybackHeadPosition();
437 track.release();
458 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
462 track.write(data, 0, data.length);
463 track.write(data, 0, data.length);
464 track.play();
466 assertTrue(TEST_NAME, track.setStereoVolume(maxVol, maxVol) == AudioTrack.SUCCESS);
468 track.release();
484 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
488 track.write(data, 0, data.length);
489 track.write(data, 0, data.length);
490 track.play();
492 assertTrue(TEST_NAME, track.setStereoVolume(minVol, minVol) == AudioTrack.SUCCESS);
494 track.release();
510 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
514 track.write(data, 0, data.length);
515 track.write(data, 0, data.length);
516 track.play();
518 assertTrue(TEST_NAME, track.setStereoVolume(midVol, midVol) == AudioTrack.SUCCESS);
520 track.release();
536 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
540 track.write(data, 0, data.length);
541 track.write(data, 0, data.length);
542 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
543 track.play();
544 assertTrue(TEST_NAME, track.setPlaybackRate((int)(TEST_SR/2)) == AudioTrack.SUCCESS);
546 track.release();
562 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
565 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
566 assertTrue(TEST_NAME, track.setPlaybackRate(0) == AudioTrack.ERROR_BAD_VALUE);
568 track.release();
584 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
589 track.write(data, 0, data.length);
590 track.write(data, 0, data.length);
591 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
592 track.play();
593 assertTrue(TEST_NAME, track.setPlaybackRate(2*outputSR) == AudioTrack.SUCCESS);
595 track.release();
611 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
615 track.write(data, 0, data.length);
616 track.write(data, 0, data.length);
617 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
618 track.play();
619 track.setPlaybackRate((int)(TEST_SR/2));
620 assertTrue(TEST_NAME, track.getPlaybackRate() == (int)(TEST_SR/2));
622 track.release();
625 //Test case 8: setPlaybackRate() invalid operation if track not initialized
638 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
641 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_NO_STATIC_DATA);
643 track.setPlaybackRate(TEST_SR/2) == AudioTrack.ERROR_INVALID_OPERATION);
645 track.release();
652 //Test case 1: setPlaybackHeadPosition() on playing track
665 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
669 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
670 track.write(data, 0, data.length);
671 track.write(data, 0, data.length);
672 track.play();
674 track.setPlaybackHeadPosition(10) == AudioTrack.ERROR_INVALID_OPERATION);
676 track.release();
679 //Test case 2: setPlaybackHeadPosition() on stopped track
692 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
696 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
697 track.write(data, 0, data.length);
698 track.write(data, 0, data.length);
699 track.play();
700 track.stop();
701 assumeTrue(TEST_NAME, track.getPlayState() == AudioTrack.PLAYSTATE_STOPPED);
702 assertTrue(TEST_NAME, track.setPlaybackHeadPosition(10) == AudioTrack.SUCCESS);
704 track.release();
707 //Test case 3: setPlaybackHeadPosition() on paused track
720 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
724 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
725 track.write(data, 0, data.length);
726 track.write(data, 0, data.length);
727 track.play();
728 track.pause();
729 assumeTrue(TEST_NAME, track.getPlayState() == AudioTrack.PLAYSTATE_PAUSED);
730 assertTrue(TEST_NAME, track.setPlaybackHeadPosition(10) == AudioTrack.SUCCESS);
732 track.release();
748 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
752 // count (given the audio track properties), and add 77.
755 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
756 track.write(data, 0, data.length);
757 track.write(data, 0, data.length);
758 track.play();
759 track.stop();
760 assumeTrue(TEST_NAME, track.getPlayState() == AudioTrack.PLAYSTATE_STOPPED);
761 assertTrue(TEST_NAME, track.setPlaybackHeadPosition(frameIndexTooFar) == AudioTrack.ERROR_BAD_VALUE);
763 track.release();
780 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
784 track.write(data, 0, data.length);
785 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
786 assertTrue(TEST_NAME, track.setLoopPoints(2, 50, 2) == AudioTrack.ERROR_INVALID_OPERATION);
788 track.release();
804 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
808 track.write(data, 0, data.length);
809 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
810 assertTrue(TEST_NAME, track.setLoopPoints(50, 0, 2) == AudioTrack.ERROR_BAD_VALUE);
812 track.release();
828 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
832 track.write(data, 0, data.length);
833 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
834 assertTrue(TEST_NAME, track.setLoopPoints(0, 50, 2) == AudioTrack.SUCCESS);
836 track.release();
852 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
857 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_NO_STATIC_DATA);
858 track.write(data, 0, data.length);
859 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
861 track.setLoopPoints(10, dataSizeInFrames+20, 2) == AudioTrack.ERROR_BAD_VALUE);
863 track.release();
865 //Test case 8: setLoopPoints() fails with start beyond what can be written for the track
878 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
883 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_NO_STATIC_DATA);
884 track.write(data, 0, data.length);
885 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
887 track.setLoopPoints(dataSizeInFrames+20, dataSizeInFrames+50, 2)
890 track.release();
893 //Test case 9: setLoopPoints() fails with end beyond what can be written for the track
906 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
911 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_NO_STATIC_DATA);
912 track.write(data, 0, data.length);
913 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
915 track.setLoopPoints(dataSizeInFrames-10, dataSizeInFrames+50, 2)
918 track.release();
939 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
943 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
945 track.write(data, 10, data.length) == AudioTrack.ERROR_BAD_VALUE);
947 track.release();
963 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
967 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
969 track.write(data, 10, data.length) == AudioTrack.ERROR_BAD_VALUE);
971 track.release();
987 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
991 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
993 track.write(data, 0, data.length + 10) == AudioTrack.ERROR_BAD_VALUE);
995 track.release();
1011 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1015 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1017 track.write(data, 0, data.length + 10) == AudioTrack.ERROR_BAD_VALUE);
1019 track.release();
1035 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1039 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1041 track.write(data, -10, data.length - 10) == AudioTrack.ERROR_BAD_VALUE);
1043 track.release();
1059 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1063 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1065 track.write(data, -10, data.length - 10) == AudioTrack.ERROR_BAD_VALUE);
1067 track.release();
1083 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1087 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1089 track.write(data, 0, -10) == AudioTrack.ERROR_BAD_VALUE);
1091 track.release();
1107 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1111 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1113 track.write(data, 0, -10) == AudioTrack.ERROR_BAD_VALUE);
1115 track.release();
1131 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1135 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1137 track.write(data, 0, data.length) == data.length);
1139 track.release();
1155 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1159 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1161 track.write(data, 0, data.length) == data.length);
1163 track.release();
1179 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1183 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1185 track.write(data, 0, data.length) == data.length);
1187 track.release();
1203 AudioTrack track = new AudioTrack(TEST_STREAM_TYPE, TEST_SR, TEST_CONF, TEST_FORMAT,
1207 assumeTrue(TEST_NAME, track.getState() == AudioTrack.STATE_INITIALIZED);
1209 track.write(data, 0, data.length) == data.length);
1211 track.release();