Search in sources :

Example 1 with CapturingAudioSink

use of com.google.android.exoplayer2.testutil.CapturingAudioSink in project ExoPlayer by google.

the class FlacPlaybackTest method playAndAssertAudioSinkInput.

private static void playAndAssertAudioSinkInput(String fileName) throws Exception {
    CapturingAudioSink audioSink = new CapturingAudioSink(new DefaultAudioSink.Builder().build());
    TestPlaybackRunnable testPlaybackRunnable = new TestPlaybackRunnable(Uri.parse("asset:///media/" + fileName), ApplicationProvider.getApplicationContext(), audioSink);
    Thread thread = new Thread(testPlaybackRunnable);
    thread.start();
    thread.join();
    if (testPlaybackRunnable.playbackException != null) {
        throw testPlaybackRunnable.playbackException;
    }
    DumpFileAsserts.assertOutput(ApplicationProvider.getApplicationContext(), audioSink, "audiosinkdumps/" + fileName + ".audiosink.dump");
}
Also used : CapturingAudioSink(com.google.android.exoplayer2.testutil.CapturingAudioSink)

Aggregations

CapturingAudioSink (com.google.android.exoplayer2.testutil.CapturingAudioSink)1