restructure the project and start using pytest
This commit is contained in:
18
multilang_translator/encode/encode_lc3.py
Normal file
18
multilang_translator/encode/encode_lc3.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import subprocess
|
||||
|
||||
|
||||
def encode_lc3(file):
|
||||
|
||||
file = file.replace('.wav', '')
|
||||
ret = subprocess.run(['elc3', '-b', '48000', f'{file}.wav', f'{file}.lc3'], check=True)
|
||||
|
||||
return ret.returncode, ret.stdout, ret.stderr
|
||||
|
||||
if __name__ == '__main__':
|
||||
import os
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
r, stdout, stderr = encode_lc3('welcome_resampled.wav')
|
||||
|
||||
print(r)
|
||||
print(stdout)
|
||||
print(stderr)
|
||||
Reference in New Issue
Block a user