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
f34e4de3
Commit
f34e4de3
authored
Nov 17, 2012
by
Jesus Cea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes #16461: Wave library should be able to deal with 4GB wav files, and sample rate of 44100 Hz.
parent
526b5536
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
Lib/wave.py
Lib/wave.py
+6
-6
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/wave.py
View file @
f34e4de3
...
...
@@ -261,9 +261,9 @@ class Wave_read:
#
def
_read_fmt_chunk
(
self
,
chunk
):
wFormatTag
,
self
.
_nchannels
,
self
.
_framerate
,
dwAvgBytesPerSec
,
wBlockAlign
=
struct
.
unpack
(
'<
hhllh
'
,
chunk
.
read
(
14
))
wFormatTag
,
self
.
_nchannels
,
self
.
_framerate
,
dwAvgBytesPerSec
,
wBlockAlign
=
struct
.
unpack
(
'<
HHLLH
'
,
chunk
.
read
(
14
))
if
wFormatTag
==
WAVE_FORMAT_PCM
:
sampwidth
=
struct
.
unpack
(
'<
h
'
,
chunk
.
read
(
2
))[
0
]
sampwidth
=
struct
.
unpack
(
'<
H
'
,
chunk
.
read
(
2
))[
0
]
self
.
_sampwidth
=
(
sampwidth
+
7
)
//
8
else
:
raise
Error
,
'unknown format: %r'
%
(
wFormatTag
,)
...
...
@@ -466,14 +466,14 @@ class Wave_write:
self
.
_nframes
=
initlength
/
(
self
.
_nchannels
*
self
.
_sampwidth
)
self
.
_datalength
=
self
.
_nframes
*
self
.
_nchannels
*
self
.
_sampwidth
self
.
_form_length_pos
=
self
.
_file
.
tell
()
self
.
_file
.
write
(
struct
.
pack
(
'<
l4s4slhhllhh
4s'
,
self
.
_file
.
write
(
struct
.
pack
(
'<
L4s4sLHHLLHH
4s'
,
36
+
self
.
_datalength
,
'WAVE'
,
'fmt '
,
16
,
WAVE_FORMAT_PCM
,
self
.
_nchannels
,
self
.
_framerate
,
self
.
_nchannels
*
self
.
_framerate
*
self
.
_sampwidth
,
self
.
_nchannels
*
self
.
_sampwidth
,
self
.
_sampwidth
*
8
,
'data'
))
self
.
_data_length_pos
=
self
.
_file
.
tell
()
self
.
_file
.
write
(
struct
.
pack
(
'<
l
'
,
self
.
_datalength
))
self
.
_file
.
write
(
struct
.
pack
(
'<
L
'
,
self
.
_datalength
))
self
.
_headerwritten
=
True
def
_patchheader
(
self
):
...
...
@@ -482,9 +482,9 @@ class Wave_write:
return
curpos
=
self
.
_file
.
tell
()
self
.
_file
.
seek
(
self
.
_form_length_pos
,
0
)
self
.
_file
.
write
(
struct
.
pack
(
'<
l
'
,
36
+
self
.
_datawritten
))
self
.
_file
.
write
(
struct
.
pack
(
'<
L
'
,
36
+
self
.
_datawritten
))
self
.
_file
.
seek
(
self
.
_data_length_pos
,
0
)
self
.
_file
.
write
(
struct
.
pack
(
'<
l
'
,
self
.
_datawritten
))
self
.
_file
.
write
(
struct
.
pack
(
'<
L
'
,
self
.
_datawritten
))
self
.
_file
.
seek
(
curpos
,
0
)
self
.
_datalength
=
self
.
_datawritten
...
...
Misc/NEWS
View file @
f34e4de3
...
...
@@ -188,6 +188,9 @@ Library
-
Issue
#
16220
:
wsgiref
now
always
calls
close
()
on
an
iterable
response
.
Patch
by
Brent
Tubbs
.
-
Issue
#
16461
:
Wave
library
should
be
able
to
deal
with
4
GB
wav
files
,
and
sample
rate
of
44100
Hz
.
-
Issue
#
16176
:
Properly
identify
Windows
8
via
platform
.
platform
()
-
Issue
#
15756
:
subprocess
.
poll
()
now
properly
handles
errno
.
ECHILD
to
...
...
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