/** * Parses the sample header. */ private void parseHeader() { byte[] frameData = headerScratchBytes.data; if (format == null) { format = DtsUtil.parseDtsFormat(frameData, formatId, language, null); output.format(format); } sampleSize = DtsUtil.getDtsFrameSize(frameData); // In this class a sample is an access unit (frame in DTS), but the format's sample rate // specifies the number of PCM audio samples per second. sampleDurationUs = (int) (C.MICROS_PER_SECOND * DtsUtil.parseDtsAudioSampleCount(frameData) / format.sampleRate); }
/** * Parses the sample header. */ private void parseHeader() { byte[] frameData = headerScratchBytes.data; if (format == null) { format = DtsUtil.parseDtsFormat(frameData, null, language, null); output.format(format); } sampleSize = DtsUtil.getDtsFrameSize(frameData); // In this class a sample is an access unit (frame in DTS), but the format's sample rate // specifies the number of PCM audio samples per second. sampleDurationUs = (int) (C.MICROS_PER_SECOND * DtsUtil.parseDtsAudioSampleCount(frameData) / format.sampleRate); }