public static EncodedElement getStreamInfo ( StreamConfiguration sc , int minFrameSize , int maxFrameSize , long samplesInStream , byte [ ] md5Hash ) { int bytes = getByteSize ( ) ; EncodedElement ele = new EncodedElement ( bytes , 0 ) ; int encodedBitsPerSample = sc . getBitsPerSample ( ) - 1 ; ele . addInt ( sc . getMinBlockSize ( ) , 16 ) ; ele . addInt ( sc . getMaxBlockSize ( ) , 16 ) ; ele . addInt ( minFrameSize , 24 ) ; ele . addInt ( maxFrameSize , 24 ) ; ele . addInt ( sc . getSampleRate ( ) , 20 ) ; ele . addInt ( sc . getChannelCount ( ) - 1 , 3 ) ; ele . addInt ( encodedBitsPerSample , 5 ) ; ele . addLong ( samplesInStream , 36 ) ; for ( int i = 0 ; i < 16 ; i ++ ) { ele . addInt ( md5Hash [ i ] , 8 ) ; } return ele ; }
Create a FLAC StreamInfo metadata block with the given parameters . Because of the data stored in a StreamInfo block this should generally be created only after all encoding is done .