(self, data)
| 422 | return self._nframeswritten |
| 423 | |
| 424 | def writeframesraw(self, data): |
| 425 | if not isinstance(data, (bytes, bytearray)): |
| 426 | data = memoryview(data).cast('B') |
| 427 | self._ensure_header_written() |
| 428 | if self._comptype == 'ULAW': |
| 429 | with warnings.catch_warnings(): |
| 430 | warnings.simplefilter('ignore', category=DeprecationWarning) |
| 431 | import audioop |
| 432 | data = audioop.lin2ulaw(data, self._sampwidth) |
| 433 | nframes = len(data) // self._framesize |
| 434 | self._file.write(data) |
| 435 | self._nframeswritten = self._nframeswritten + nframes |
| 436 | self._datawritten = self._datawritten + len(data) |
| 437 | |
| 438 | def writeframes(self, data): |
| 439 | self.writeframesraw(data) |
no test coverage detected