M
M
manavalit2020-04-23 15:59:29
Python
manavalit, 2020-04-23 15:59:29

How to convert OGA to WAV using Python?

I need to convert an OGA (Telegram Audio) file to WAV format, but when I try to do it with the following code, I get an error.

import soundfile as sf

data, samplerate = sf.read('file.oga')
sf.write('new_file.wav', data, samplerate)


The following error pops up:
Traceback (most recent call last):
File "C:/Users/mansu/PycharmProjects/MoBot/lesson.py", line 4, in
data, samplerate = sf.read('file.oga')
File " C:\Users\mansu\PycharmProjects\MoBot\venv\lib\site-packages\soundfile.py", line 373, in read
subtype, endian, format, closefd) as f:
File "C:\Users\mansu\PycharmProjects \MoBot\venv\lib\site-packages\soundfile.py", line 740, in __init__
self._file = self._open(file, mode_int, closefd)
File "C:\Users\mansu\PycharmProjects\MoBot\venv\ lib\site-packages\soundfile.py", line 1265, in _open
"Error opening {0!r}: ".format(self.name))
File "C:\Users\mansu\PycharmProjects\MoBot\venv\lib\site-packages\soundfile.py", line 1455, in _error_check
raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8' , 'replace'))
RuntimeError: Error opening 'file.oga': File contains data in an unimplemented format.
How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zikrillo Abbosov, 2020-04-23
@azymson

What a question, I hope you know how to use pip here is the library
https://pypi.org/project/ftransc/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question