mirror of
https://github.com/google/liblc3.git
synced 2026-06-01 17:37:01 +00:00
test: Fix python encoder/decoder standalone tools
This commit is contained in:
@@ -170,9 +170,6 @@ if __name__ == "__main__":
|
||||
if len(data) != 2:
|
||||
break
|
||||
|
||||
if nframes >= 1000:
|
||||
break
|
||||
|
||||
(frame_nbytes,) = struct.unpack('=H', data)
|
||||
|
||||
print('Decoding frame %d' % nframes, end='\r')
|
||||
|
||||
@@ -159,6 +159,8 @@ if __name__ == "__main__":
|
||||
(sr_hz, pcm) = wavfile.read(args.wav_file.name)
|
||||
if sr_hz not in (8000, 16000, 24000, 320000, 48000):
|
||||
raise ValueError('Unsupported input samplerate: %d' % sr_hz)
|
||||
if pcm.ndim != 1:
|
||||
raise ValueError('Only single channel wav file supported')
|
||||
|
||||
### Setup ###
|
||||
|
||||
|
||||
@@ -312,6 +312,7 @@ class SpectrumAnalysis(SpectrumQuantization):
|
||||
|
||||
b.write_uint((self.lastnz >> 1) - 1, nbits_lastnz)
|
||||
b.write_uint(self.lsb_mode, 1)
|
||||
b.write_uint(self.g_idx, 8)
|
||||
|
||||
def encode(self, bits):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user