Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
14ba7c93
You need to sign in or sign up before continuing.
Commit
14ba7c93
authored
Jun 21, 2017
by
Soumith Chintala
Committed by
GitHub
Jun 21, 2017
Browse files
Merge pull request #6 from SeanNaren/compat-fix
Fix load str for 2.7 compatibility
parents
f80d6e37
3ed8a594
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchaudio/__init__.py
torchaudio/__init__.py
+1
-1
No files found.
torchaudio/__init__.py
View file @
14ba7c93
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment