(self)
Close WAV-file.
Close WAV-file.
Close WAV - file .
def close(self):
        """Close WAV-file."""
        TapeBitStream.close(self)
        # write file length fields
        self.wav.seek(0, 2)
        end_pos = self.wav.tell()
        self.wav.seek(self.riff_pos, 0)
        self.wav.write(struct.pack('<4sL', b'RIFF', end_pos-self.riff_pos-8))
        self.wav.seek(self.data_pos, 0)
        self.wav.write(struct.pack('<4sL', b'data', end_pos-self.start))
        self.wav.close()
def close ( self ) : TapeBitStream . close ( self ) # write file length fields self . wav . seek ( 0 , 2 ) end_pos = self . wav . tell ( ) self . wav . seek ( self . riff_pos , 0 ) self . wav . write ( struct . pack ( '<4sL' , b'RIFF' , end_pos - self . riff_pos - 8 ) ) self . wav . seek ( self . data_pos , 0 ) self . wav . write ( struct . pack ( '<4sL' , b'data' , end_pos - self . start ) ) self . wav . close ( )