Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wave offset broken for Python3 port #10

Open
MerlijnWajer opened this issue Jul 13, 2019 · 1 comment · May be fixed by #11
Open

Wave offset broken for Python3 port #10

MerlijnWajer opened this issue Jul 13, 2019 · 1 comment · May be fixed by #11

Comments

@MerlijnWajer
Copy link

@JoeLametta - I needed this patch for the offset writing to work. Please verify with --offset-correction=6 (or another number, of course)

Maybe we'd need a test for it, too. :p

From: Merlijn Wajer <[email protected]>
Date: Sun, 14 Jul 2019 01:44:01 +0200
Subject: [PATCH] wavoffsetwriter: port to python3

---
 mktoc/wav.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mktoc/wav.py b/mktoc/wav.py
index b345536..d27617d 100644
--- a/mktoc/wav.py
+++ b/mktoc/wav.py
@@ -341,12 +341,12 @@ class WavOffsetWriter(object):
          self._write_frames(wav_out, data ,bytes_p_samp)
          wav_in.close()
       else:    # insert silence if no previous file
-         self._write_frames(wav_out ,'\x00'*offset_bytes, bytes_p_samp)
+         self._write_frames(wav_out ,b'\x00'*offset_bytes, bytes_p_samp)
       # add original file data to output stream
       wav_in = wave.open( fn )
       samples = wav_in.getnframes() - self._offset
       while samples:
-         data = wav_in.readframes( min(samples,self._COPY_SIZE) )
+         data = wav_in.readframes( int(min(samples,self._COPY_SIZE)) )
          samples -= len(data) / bytes_p_samp
          self._write_frames(wav_out, data, bytes_p_samp)
       wav_in.close()
-- 
2.17.1

@MerlijnWajer
Copy link
Author

Bump. cc @JoeLametta

@JoeLametta JoeLametta linked a pull request Nov 5, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant