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
4ae423de
Commit
4ae423de
authored
Oct 12, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #19131: The aifc module now correctly reads and writes sampwidth of
compressed streams.
parents
34808e22
4b532596
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
Lib/aifc.py
Lib/aifc.py
+5
-4
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/aifc.py
View file @
4ae423de
...
...
@@ -468,15 +468,13 @@ class Aifc_read:
if
self
.
_comptype
!=
b'NONE'
:
if
self
.
_comptype
==
b'G722'
:
self
.
_convert
=
self
.
_adpcm2lin
self
.
_framesize
=
self
.
_framesize
//
4
elif
self
.
_comptype
in
(
b'ulaw'
,
b'ULAW'
):
self
.
_convert
=
self
.
_ulaw2lin
self
.
_framesize
=
self
.
_framesize
//
2
elif
self
.
_comptype
in
(
b'alaw'
,
b'ALAW'
):
self
.
_convert
=
self
.
_alaw2lin
self
.
_framesize
=
self
.
_framesize
//
2
else
:
raise
Error
(
'unsupported compression type'
)
self
.
_sampwidth
=
2
else
:
self
.
_comptype
=
b'NONE'
self
.
_compname
=
b'not compressed'
...
...
@@ -804,7 +802,10 @@ class Aifc_write:
_write_short
(
self
.
_file
,
self
.
_nchannels
)
self
.
_nframes_pos
=
self
.
_file
.
tell
()
_write_ulong
(
self
.
_file
,
self
.
_nframes
)
_write_short
(
self
.
_file
,
self
.
_sampwidth
*
8
)
if
self
.
_comptype
in
(
b'ULAW'
,
b'ulaw'
,
b'ALAW'
,
b'alaw'
,
b'G722'
):
_write_short
(
self
.
_file
,
8
)
else
:
_write_short
(
self
.
_file
,
self
.
_sampwidth
*
8
)
_write_float
(
self
.
_file
,
self
.
_framerate
)
if
self
.
_aifc
:
self
.
_file
.
write
(
self
.
_comptype
)
...
...
Misc/NEWS
View file @
4ae423de
...
...
@@ -36,6 +36,9 @@ Core and Builtins
Library
-------
- Issue #19131: The aifc module now correctly reads and writes sampwidth of
compressed streams.
- Issue #19209: Remove import of copyreg from the os module to speed up
interpreter startup. stat_result and statvfs_result are now hard-coded to
reside in the os module.
...
...
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