public static WavHeader createWavHeader(AudioFormat format, int samples) {
        WavHeader w = new WavHeader("RIFF", 40, "WAVE", new FmtChunk((short) 1, (short) format.getChannels(), format.getSampleRate(),
                format.getSampleRate() * format.getChannels() * (format.getSampleSizeInBits() >> 3),
                (short) (format.getChannels() * (format.getSampleSizeInBits() >> 3)),
                (short) format.getSampleSizeInBits()), 44, calcDataSize(format.getChannels(),
                format.getSampleSizeInBits() >> 3, samples));
        return w;
    }
public static WavHeader createWavHeader(AudioFormat format, int samples) {
        WavHeader w = new WavHeader("RIFF", 40, "WAVE", new FmtChunk((short) 1, (short) format.getChannels(), format.getSampleRate(),
                format.getSampleRate() * format.getChannels() * (format.getSampleSizeInBits() >> 3),
                (short) (format.getChannels() * (format.getSampleSizeInBits() >> 3)),
                (short) format.getSampleSizeInBits()), 44, calcDataSize(format.getChannels(),
                format.getSampleSizeInBits() >> 3, samples));
        return w;
    }
public static WavHeader createWavHeader ( AudioFormat format , int samples ) { WavHeader w = new WavHeader ( "RIFF" , 40 , "WAVE" , new FmtChunk ( ( short ) 1 , ( short ) format . getChannels ( ) , format . getSampleRate ( ) , format . getSampleRate ( ) * format . getChannels ( ) * ( format . getSampleSizeInBits ( ) >> 3 ) , ( short ) ( format . getChannels ( ) * ( format . getSampleSizeInBits ( ) >> 3 ) ) , ( short ) format . getSampleSizeInBits ( ) ) , 44 , calcDataSize ( format . getChannels ( ) , format . getSampleSizeInBits ( ) >> 3 , samples ) ) ; return w ; }
Creates wav header for the specified audio format

@param format
@param samples
Creates wav header for the specified audio format