Spaces:
Running
Running
Update infer/lib/audio.py
Browse files- infer/lib/audio.py +4 -4
infer/lib/audio.py
CHANGED
@@ -4,9 +4,9 @@ import av
|
|
4 |
from io import BytesIO
|
5 |
|
6 |
def wav2(i, o, format):
|
7 |
-
inp = av.open(i, '
|
8 |
if format == "m4a": format = "mp4"
|
9 |
-
out = av.open(o, '
|
10 |
if format == "ogg": format = "libvorbis"
|
11 |
if format == "mp4": format = "aac"
|
12 |
|
@@ -21,8 +21,8 @@ def wav2(i, o, format):
|
|
21 |
inp.close()
|
22 |
|
23 |
def audio2(i, o, format, sr):
|
24 |
-
inp = av.open(i, '
|
25 |
-
out = av.open(o, '
|
26 |
if format == "ogg": format = "libvorbis"
|
27 |
if format == "f32le": format = "pcm_f32le"
|
28 |
|
|
|
4 |
from io import BytesIO
|
5 |
|
6 |
def wav2(i, o, format):
|
7 |
+
inp = av.open(i, 'rb')
|
8 |
if format == "m4a": format = "mp4"
|
9 |
+
out = av.open(o, 'wb', format=format)
|
10 |
if format == "ogg": format = "libvorbis"
|
11 |
if format == "mp4": format = "aac"
|
12 |
|
|
|
21 |
inp.close()
|
22 |
|
23 |
def audio2(i, o, format, sr):
|
24 |
+
inp = av.open(i, 'rb')
|
25 |
+
out = av.open(o, 'wb', format=format)
|
26 |
if format == "ogg": format = "libvorbis"
|
27 |
if format == "f32le": format = "pcm_f32le"
|
28 |
|