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
98d0d593
Unverified
Commit
98d0d593
authored
Mar 02, 2021
by
Maja Bojarska
Committed by
GitHub
Mar 02, 2021
Browse files
Add AudioMetaData.__str__ override (#1339)
parent
2209da27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
torchaudio/backend/common.py
torchaudio/backend/common.py
+11
-0
No files found.
torchaudio/backend/common.py
View file @
98d0d593
...
...
@@ -38,3 +38,14 @@ class AudioMetaData:
self
.
num_channels
=
num_channels
self
.
bits_per_sample
=
bits_per_sample
self
.
encoding
=
encoding
def
__str__
(
self
):
return
(
f
"AudioMetaData("
f
"sample_rate=
{
self
.
sample_rate
}
, "
f
"num_frames=
{
self
.
num_frames
}
, "
f
"num_channels=
{
self
.
num_channels
}
, "
f
"bits_per_sample=
{
self
.
bits_per_sample
}
, "
f
"encoding=
{
self
.
encoding
}
"
f
")"
)
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