Mercurial > code > home > repos > light9
changeset 1893:64eeba960168
type fixes
Ignore-this: 4d6140dec7479e7708e8cdd582ccfd38
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Thu, 30 May 2019 08:30:27 +0000 |
parents | 7d5fe19f77a1 |
children | b697752b35f9 |
files | bin/musicPad light9/collector/collector_client.py |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/musicPad Thu May 30 08:29:42 2019 +0000 +++ b/bin/musicPad Thu May 30 08:30:27 2019 +0000 @@ -15,7 +15,7 @@ playlist = Playlist.fromShow(showconfig.getGraph(), showconfig.showUri()) for p in playlist.allSongPaths(): log.info("read %s", p) - inputWave = wave.open(p, 'r') + inputWave = wave.open(p, 'rb') outputDir = os.path.join(os.path.dirname(p), "pad") try: @@ -23,14 +23,14 @@ except OSError: pass # exists outputPath = os.path.join(outputDir, os.path.basename(p)) - outputWave = wave.open(outputPath, 'w') + outputWave = wave.open(outputPath, 'wb') outputWave.setparams(inputWave.getparams()) bytesPerSecond = (inputWave.getnchannels() * inputWave.getsampwidth() * inputWave.getframerate()) - outputWave.writeframesraw("\x00" * (bytesPerSecond * introPad)) + outputWave.writeframesraw(b"\x00" * (bytesPerSecond * introPad)) outputWave.writeframesraw(inputWave.readframes(inputWave.getnframes())) - outputWave.writeframesraw("\x00" * (bytesPerSecond * postPad)) + outputWave.writeframesraw(b"\x00" * (bytesPerSecond * postPad)) outputWave.close() log.info("wrote %s", outputPath)
--- a/light9/collector/collector_client.py Thu May 30 08:29:42 2019 +0000 +++ b/light9/collector/collector_client.py Thu May 30 08:30:27 2019 +0000 @@ -39,7 +39,7 @@ return defer.succeed(0) -def sendToCollector(client, session, settings, useZmq=False): +def sendToCollector(client, session, settings: DeviceSettings, useZmq=False): """deferred to the time in seconds it took to get a response from collector""" sendTime = time.time() msg = toCollectorJson(client, session, settings).encode('utf8')