Commit 14ba7c93 authored by Soumith Chintala's avatar Soumith Chintala Committed by GitHub
Browse files

Merge pull request #6 from SeanNaren/compat-fix

Fix load str for 2.7 compatibility
parents f80d6e37 3ed8a594
......@@ -23,7 +23,7 @@ def load(filename, out=None):
typename = type(out).__name__.replace('Tensor', '')
func = getattr(th_sox, 'libthsox_{}_read_audio_file'.format(typename))
sample_rate_p = ffi.new('int*')
func(bytes(filename, "ascii"), out, sample_rate_p)
func(str(filename).encode("ascii"), out, sample_rate_p)
sample_rate = sample_rate_p[0]
return out, 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