PyOgg icon indicating copy to clipboard operation
PyOgg copied to clipboard

opus_file.bytes_per_sample missing

Open kdulep opened this issue 3 years ago • 0 comments

import wave
import pyogg

AUDIO_FILE = 'voice.ogg'
AUDIO_WAV = 'voice.wav'

opus_file = pyogg.OpusFile(AUDIO_FILE)
print(opus_file.bytes_per_sample)

wave_out = wave.open(AUDIO_WAV, "wb")
wave_out.setnchannels(opus_file.channels)
wave_out.setsampwidth(opus_file.bytes_per_sample)
wave_out.setframerate(opus_file.frequency)
wave_out.writeframes(opus_file.buffer)

AttributeError: 'OpusFile' object has no attribute 'bytes_per_sample'

kdulep avatar Nov 08 '22 14:11 kdulep