AmrExtractor implements Extractor { @Override public int read(ExtractorInput input, PositionHolder seekPosition) throws IOException, InterruptedException { if (input.getPosition() == 0) { if (!readAmrHeader(input)) { throw new ParserException("Could not find AMR header."); } } maybeOutputFormat(); int sampleReadResult = readSample(input); maybeOutputSeekMap(input.getLength(), sampleReadResult); return sampleReadResult; } AmrExtractor();  AmrExtractor(@Flags int flags); @Override boolean sniff(ExtractorInput input); @Override void init(ExtractorOutput extractorOutput); @Override int read(ExtractorInput input, PositionHolder seekPosition); @Override void seek(long position, long timeUs); @Override void release(); static final ExtractorsFactory FACTORY; static final int FLAG_ENABLE_CONSTANT_BITRATE_SEEKING; }
@Test public void testRead_nonAmrSignature_throwParserException() throws IOException, InterruptedException { AmrExtractor amrExtractor = setupAmrExtractorWithOutput(); FakeExtractorInput input = fakeExtractorInputWithData(Util.getUtf8Bytes("0#!AMR-WB\n")); try { amrExtractor.read(input, new PositionHolder()); fail(); } catch (ParserException e) { } }