Commit f80d6e37 authored by David Pollack's avatar David Pollack Committed by Adam Paszke
Browse files

bytes function requires type

parent 2936245a
...@@ -23,7 +23,7 @@ def load(filename, out=None): ...@@ -23,7 +23,7 @@ def load(filename, out=None):
typename = type(out).__name__.replace('Tensor', '') typename = type(out).__name__.replace('Tensor', '')
func = getattr(th_sox, 'libthsox_{}_read_audio_file'.format(typename)) func = getattr(th_sox, 'libthsox_{}_read_audio_file'.format(typename))
sample_rate_p = ffi.new('int*') sample_rate_p = ffi.new('int*')
func(bytes(filename), out, sample_rate_p) func(bytes(filename, "ascii"), out, sample_rate_p)
sample_rate = sample_rate_p[0] sample_rate = sample_rate_p[0]
return out, sample_rate return out, sample_rate
...@@ -37,4 +37,4 @@ def save(filepath, src, sample_rate): ...@@ -37,4 +37,4 @@ def save(filepath, src, sample_rate):
typename = type(src).__name__.replace('Tensor', '') typename = type(src).__name__.replace('Tensor', '')
func = getattr(th_sox, 'libthsox_{}_write_audio_file'.format(typename)) func = getattr(th_sox, 'libthsox_{}_write_audio_file'.format(typename))
func(bytes(filepath), src, extension[1:], sample_rate) func(bytes(filepath, "ascii"), src, extension[1:], sample_rate)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment