| 67 | ## Open WAVE file (store object into global WAVE object) |
| 68 | # @param name name of WAVE file to open |
| 69 | def openWAVE(name): |
| 70 | global WAVE |
| 71 | logger.info("Open WAVE file (write mode): {}".format(name)) |
| 72 | WAVE = wave.open(name, 'wb') |
| 73 | WAVE.setnchannels(CHANNELS) |
| 74 | WAVE.setsampwidth((SAMPLE_BITS + 7) // 8) |
| 75 | WAVE.setframerate(SAMPLE_RATE) |
| 76 | logger.info(" Number of channels: {}".format(CHANNELS)) |
| 77 | logger.info(" Sample bits: {}".format(SAMPLE_BITS)) |
| 78 | logger.info(" Sample rate: {}".format(SAMPLE_RATE)) |
| 79 | |
| 80 | ## Write WAVE frames (global WAVE object) |
| 81 | # @param frames frames to write |