class_docstr: Variables used in this class:
  
  These variables are available to the user though appropriate
  methods of this class:
  _file -- the open file with methods read(), close(), and seek()
            set through the __init__() method
  _nchannels -- the number of audio channels
            available through the getnchannels() method
  _nframes -- the number of audio frames
            available through the getnframes() method
  _sampwidth -- the number of bytes per audio sample
            available through the getsampwidth() method
  _framerate -- the sampling frequency
            available through the getframerate() method
  _comptype -- the AIFF-C compression type ('NONE' if AIFF)
            available through the getcomptype() method
  _compname -- the human-readable AIFF-C compression type
            available through the getcomptype() method
  _soundpos -- the position in the audio stream
            available through the tell() method, set through the
            setpos() method
  
  These variables are used internally only:
  _fmt_chunk_read -- 1 iff the FMT chunk has been read
  _data_seek_needed -- 1 iff positioned correctly in audio
            file for readframes()
  _data_chunk -- instantiation of a chunk class for the DATA chunk
  _framesize -- size of one frame in the file
class_docstr_tok: ["Variables","used","in","this","class",":","These","variables","are","available","to","the","user","though","appropriate","methods","of","this","class",":","_file","--","the","open","file","with","methods","read","(",")",",","close","(",")",",","and","seek","(",")","set","through","the","__init__","(",")","method","_nchannels","--","the","number","of","audio","channels","available","through","the","getnchannels","(",")","method","_nframes","--","the","number","of","audio","frames","available","through","the","getnframes","(",")","method","_sampwidth","--","the","number","of","bytes","per","audio","sample","available","through","the","getsampwidth","(",")","method","_framerate","--","the","sampling","frequency","available","through","the","getframerate","(",")","method","_comptype","--","the","AIFF-C","compression","type","(","'NONE","'","if","AIFF",")","available","through","the","getcomptype","(",")","method","_compname","--","the","human-readable","AIFF-C","compression","type","available","through","the","getcomptype","(",")","method","_soundpos","--","the","position","in","the","audio","stream","available","through","the","tell","(",")","method",",","set","through","the","setpos","(",")","method","These","variables","are","used","internally","only",":","_fmt_chunk_read","--","1","iff","the","FMT","chunk","has","been","read","_data_seek_needed","--","1","iff","positioned","correctly","in","audio","file","for","readframes","(",")","_data_chunk","--","instantiation","of","a","chunk","class","for","the","DATA","chunk","_framesize","--","size","of","one","frame","in","the","file"]
code: def readframes(self, nframes):
      if self._data_seek_needed:
          self._data_chunk.seek(0, 0)
          pos = self._soundpos * self._framesize
          if pos:
              self._data_chunk.seek(pos, 0)
          self._data_seek_needed = 0
      if nframes == 0:
          return b""
      data = self._data_chunk.read(nframes * self._framesize)
      if self._sampwidth != 1 and sys.byteorder == "big":
          data = _byteswap(data, self._sampwidth)
      if self._convert and data:
          data = self._convert(data)
      self._soundpos = self._soundpos + len(data) // (
          self._nchannels * self._sampwidth
      )
      return data
  
imports: from collections import namedtuple
  import builtins
  import struct
  import sys
label_desc: Use image node_id 20 for calling the Wave_read obj's underlying member method code with example usage: obj.readframes(nframes) and returns: data, bytes