(self)
Write RIFF WAV header.
Write RIFF WAV header.
Write RIFF WAV header .
def _write_wav_header(self):
        """Write RIFF WAV header."""
        # "RIFF" chunk header
        self.riff_pos = self.wav.tell()
        # length is corrected at close
        self.wav.write(struct.pack('<4sL4s', b'RIFF', 36, b'WAVE'))
        # "fmt " subchunk
        self.wav.write(struct.pack(
            '<4sLHHLLHH',
            b'fmt ', 16, 1, self.nchannels, self.framerate,
            self.nchannels * self.framerate * self.sampwidth,
            self.nchannels * self.sampwidth,
            self.sampwidth * 8
        ))
        # "data" subchunk header
        self.data_pos = self.wav.tell()
        # length is corrected at close
        self.wav.write(struct.pack('<4sL', b'data', 0))
        self.start = self.wav.tell()
def _write_wav_header ( self ) : # "RIFF" chunk header self . riff_pos = self . wav . tell ( ) # length is corrected at close self . wav . write ( struct . pack ( '<4sL4s' , b'RIFF' , 36 , b'WAVE' ) ) # "fmt " subchunk self . wav . write ( struct . pack ( '<4sLHHLLHH' , b'fmt ' , 16 , 1 , self . nchannels , self . framerate , self . nchannels * self . framerate * self . sampwidth , self . nchannels * self . sampwidth , self . sampwidth * 8 ) ) # "data" subchunk header self . data_pos = self . wav . tell ( ) # length is corrected at close self . wav . write ( struct . pack ( '<4sL' , b'data' , 0 ) ) self . start = self . wav . tell ( )