Skip to content

Commit f0fdbc9

Browse files
committed
Remove debugging gunk
1 parent aab800d commit f0fdbc9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pymp3decoder/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
from . import pymp3_c
22
import struct
3-
print(pymp3_c.__dict__)
4-
# # print all attributes
5-
# print(dir(pymp3_c))
63

74

85
def get_pad(bn):
@@ -151,12 +148,13 @@ def decode(self, mp3_data, remaining):
151148
frame_idx = 0
152149
frame_num = 0
153150

154-
#fmt = "Frame {:d} at idx {:d} - header: {:s}"
155-
#info = "Err protection {}, padded {}"
151+
# fmt = "Frame {:d} at idx {:d} - header: {:s}"
152+
# info = "Err protection {}, padded {}"
156153

157154
# keep going till we run out of frames
158155
while frame_idx < len(mp3_buffer) - 4:
159-
frame_header = struct.unpack("BBBB", mp3_buffer[frame_idx:frame_idx+4])
156+
frame_header = struct.unpack(
157+
"BBBB", mp3_buffer[frame_idx:frame_idx+4])
160158

161159
if frame_header[0] != 255:
162160
break
@@ -176,7 +174,8 @@ def decode(self, mp3_data, remaining):
176174
sample_rate = self.sample_rate_table[sample_bytes]
177175

178176
# calculate frame size
179-
frame_size = int(144*(1000*self.bitrate_table[bitrate_bits])/sample_rate)
177+
frame_size = int(
178+
144*(1000*self.bitrate_table[bitrate_bits])/sample_rate)
180179

181180
if padded:
182181
frame_size += 1
@@ -222,9 +221,11 @@ def decode(self, mp3_data, remaining):
222221

223222
total_samples_read += samples_read
224223
except ValueError as e:
225-
raise RuntimeError("Caught exception '{}' - likely cause is that the PCM buffer was not big enough to hold all the decoded data for this frame".format(e))
224+
raise RuntimeError(
225+
"Caught exception '{}' - likely cause is that the PCM buffer was not big enough to hold all the decoded data for this frame".format(e))
226226

227-
pymp3_c.interlace_array(self.pcm_l, self.pcm_r, self.joined, total_samples_read)
227+
pymp3_c.interlace_array(self.pcm_l, self.pcm_r,
228+
self.joined, total_samples_read)
228229

229230
# first multiply by 2 because it's a bytearray and we are returning data
230231
# in shorts, which are 2 bytes. then, multiply by 2 again because we

0 commit comments

Comments
 (0)