Rejekts commited on
Commit
ba31b06
1 Parent(s): 8d09829

Update infer/lib/audio.py

Browse files
Files changed (1) hide show
  1. 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, 'r')
8
  if format == "m4a": format = "mp4"
9
- out = av.open(o, 'w', format=format)
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, 'r')
25
- out = av.open(o, 'w', format=format)
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