Search in sources :

Example 1 with Ac3Extractor

use of com.google.android.exoplayer2.extractor.ts.Ac3Extractor in project ExoPlayer by google.

the class HlsMediaChunk method buildPackedAudioExtractor.

private Extractor buildPackedAudioExtractor(long startTimeUs) {
    Extractor extractor;
    if (lastPathSegment.endsWith(AAC_FILE_EXTENSION)) {
        extractor = new AdtsExtractor(startTimeUs);
    } else if (lastPathSegment.endsWith(AC3_FILE_EXTENSION) || lastPathSegment.endsWith(EC3_FILE_EXTENSION)) {
        extractor = new Ac3Extractor(startTimeUs);
    } else if (lastPathSegment.endsWith(MP3_FILE_EXTENSION)) {
        extractor = new Mp3Extractor(0, startTimeUs);
    } else {
        throw new IllegalArgumentException("Unkown extension for audio file: " + lastPathSegment);
    }
    extractor.init(extractorOutput);
    return extractor;
}
Also used : AdtsExtractor(com.google.android.exoplayer2.extractor.ts.AdtsExtractor) Mp3Extractor(com.google.android.exoplayer2.extractor.mp3.Mp3Extractor) FragmentedMp4Extractor(com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor) Extractor(com.google.android.exoplayer2.extractor.Extractor) TsExtractor(com.google.android.exoplayer2.extractor.ts.TsExtractor) Mp3Extractor(com.google.android.exoplayer2.extractor.mp3.Mp3Extractor) AdtsExtractor(com.google.android.exoplayer2.extractor.ts.AdtsExtractor) Ac3Extractor(com.google.android.exoplayer2.extractor.ts.Ac3Extractor) Ac3Extractor(com.google.android.exoplayer2.extractor.ts.Ac3Extractor)

Aggregations

Extractor (com.google.android.exoplayer2.extractor.Extractor)1 Mp3Extractor (com.google.android.exoplayer2.extractor.mp3.Mp3Extractor)1 FragmentedMp4Extractor (com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor)1 Ac3Extractor (com.google.android.exoplayer2.extractor.ts.Ac3Extractor)1 AdtsExtractor (com.google.android.exoplayer2.extractor.ts.AdtsExtractor)1 TsExtractor (com.google.android.exoplayer2.extractor.ts.TsExtractor)1