Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7019ae6a
Commit
7019ae6a
authored
Jul 23, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test_wave.py pass.
I have no illusion that this fixes all issues with this module.
parent
735c9eaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Lib/test/test_wave.py
Lib/test/test_wave.py
+1
-1
Lib/wave.py
Lib/wave.py
+5
-5
No files found.
Lib/test/test_wave.py
View file @
7019ae6a
...
...
@@ -16,7 +16,7 @@ f.setnchannels(nchannels)
f
.
setsampwidth
(
sampwidth
)
f
.
setframerate
(
framerate
)
f
.
setnframes
(
nframes
)
output
=
'
\
0
'
*
nframes
*
nchannels
*
sampwidth
output
=
b
'
\
0
'
*
nframes
*
nchannels
*
sampwidth
f
.
writeframes
(
output
)
f
.
close
()
...
...
Lib/wave.py
View file @
7019ae6a
...
...
@@ -126,9 +126,9 @@ class Wave_read:
self
.
_convert
=
None
self
.
_soundpos
=
0
self
.
_file
=
Chunk
(
file
,
bigendian
=
0
)
if
self
.
_file
.
getname
()
!=
'RIFF'
:
if
self
.
_file
.
getname
()
!=
b
'RIFF'
:
raise
Error
,
'file does not start with RIFF id'
if
self
.
_file
.
read
(
4
)
!=
'WAVE'
:
if
self
.
_file
.
read
(
4
)
!=
b
'WAVE'
:
raise
Error
,
'not a WAVE file'
self
.
_fmt_chunk_read
=
0
self
.
_data_chunk
=
None
...
...
@@ -139,10 +139,10 @@ class Wave_read:
except
EOFError
:
break
chunkname
=
chunk
.
getname
()
if
chunkname
==
'fmt '
:
if
chunkname
==
b
'fmt '
:
self
.
_read_fmt_chunk
(
chunk
)
self
.
_fmt_chunk_read
=
1
elif
chunkname
==
'data'
:
elif
chunkname
==
b
'data'
:
if
not
self
.
_fmt_chunk_read
:
raise
Error
,
'data chunk before fmt chunk'
self
.
_data_chunk
=
chunk
...
...
@@ -230,7 +230,7 @@ class Wave_read:
self
.
_data_chunk
.
seek
(
pos
,
0
)
self
.
_data_seek_needed
=
0
if
nframes
==
0
:
return
''
return
b
''
if
self
.
_sampwidth
>
1
and
big_endian
:
# unfortunately the fromfile() method does not take
# something that only looks like a file object, so
...
...
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