[issue13681] Aifc read compressed frames fix

Oleg Plakhotnyuk report at bugs.python.org
Fri Dec 30 12:17:10 CET 2011


New submission from Oleg Plakhotnyuk <olegus8 at gmail.com>:

This patch resolves two issues:

1. ADPCM compressed audio files reading. Such files have frame size of 4 bits. Aifc lib cannot represent 4 bits frame size because it uses integer bytes count variable. I have replaced it with bits count.

2. ALAW/ULAW/ADPCM audio data decompression. According to documentation (http://docs.python.org/library/audioop.html), adpcm2lin, alaw2lin and ulaw2lin are using 'width' argument to represent output frames width. However, in audioop.c module there are checks that are raising exceptions if input frames length is not multiple of 'width'. I have replaced checking of 'len' to match 'size' with checking of 'len*size' to match 'size' in order to retain only basic length validity checks.

----------
components: Library (Lib), Tests
files: aifc_compression.patch
keywords: patch
messages: 150373
nosy: Oleg.Plakhotnyuk, ezio.melotti, r.david.murray
priority: normal
severity: normal
status: open
title: Aifc read compressed frames fix
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24112/aifc_compression.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13681>
_______________________________________


More information about the Python-bugs-list mailing list