Home | History | Annotate | Download | only in Lib

Lines Matching refs:_sampwidth

106     _sampwidth -- the number of bytes per audio sample
199 return self._sampwidth
236 if self._sampwidth in (2, 4) and sys.byteorder == 'big':
242 data = array.array(_array_fmts[self._sampwidth])
243 assert data.itemsize == self._sampwidth
245 if nitems * self._sampwidth > chunk.chunksize - chunk.size_read:
246 nitems = (chunk.chunksize - chunk.size_read) // self._sampwidth
249 chunk.size_read = chunk.size_read + nitems * self._sampwidth
252 chunk.size_read = chunk.size_read + nitems * self._sampwidth
257 if self._sampwidth == 3 and sys.byteorder == 'big':
261 self._soundpos = self._soundpos + len(data) // (self._nchannels * self._sampwidth)
272 self._sampwidth = (sampwidth + 7) // 8
275 self._framesize = self._nchannels * self._sampwidth
292 _sampwidth -- the number of bytes per audio sample
321 self._sampwidth = 0
352 self._sampwidth = sampwidth
355 if not self._sampwidth:
357 return self._sampwidth
404 if not self._nchannels or not self._sampwidth or not self._framerate:
406 return self._nchannels, self._sampwidth, self._framerate, \
423 nframes = len(data) // (self._sampwidth * self._nchannels)
426 if self._sampwidth in (2, 4) and sys.byteorder == 'big':
428 a = array.array(_array_fmts[self._sampwidth])
431 assert data.itemsize == self._sampwidth
434 self._datawritten = self._datawritten + len(data) * self._sampwidth
436 if self._sampwidth == 3 and sys.byteorder == 'big':
469 if not self._sampwidth:
479 self._nframes = initlength / (self._nchannels * self._sampwidth)
480 self._datalength = self._nframes * self._nchannels * self._sampwidth
485 self._nchannels * self._framerate * self._sampwidth,
486 self._nchannels * self._sampwidth,
487 self._sampwidth * 8, 'data'))