]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
AWARE.py: New file with definitions for Aware Inc.'s compression
authorSjoerd Mullender <sjoerd@acm.org>
Fri, 5 Feb 1993 13:43:44 +0000 (13:43 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Fri, 5 Feb 1993 13:43:44 +0000 (13:43 +0000)
algorithms in cl module.
aifc.py: fixed a small bug.

Lib/aifc.py
Lib/irix5/AWARE.py [new file with mode: 0755]
Lib/plat-irix5/AWARE.py [new file with mode: 0755]

index 63849a1b0e133a636602c7798dccd07672fa067d..4e919d44f93adfdda0cef7b08f40ba1d6e4150b8 100644 (file)
@@ -506,7 +506,8 @@ class Aifc_read():
                        return ''
                data = self._ssnd_chunk.read(nframes * self._framesize)
                if self._decomp and data:
-                       self._decomp.SetParam(CL.FRAME_BUFFER_SIZE, len(data) * 2)
+                       dummy = self._decomp.SetParam(CL.FRAME_BUFFER_SIZE, \
+                                 len(data) * 2)
                        data = self._decomp.Decompress(len(data) / self._nchannels, data)
                self._soundpos = self._soundpos + len(data) / (self._nchannels * self._sampwidth)
                return data
@@ -638,7 +639,7 @@ class Aifc_write():
        def setnchannels(self, nchannels):
                if self._nframeswritten:
                        raise Error, 'cannot change parameters after starting to write'
-               dummy = _convert(nchannels, _nchannelslist)
+               dummy = _convert2(nchannels, _nchannelslist)
                self._nchannels = nchannels
 
        def getnchannels(self):
@@ -756,8 +757,9 @@ class Aifc_write():
                        self._write_header(len(data))
                nframes = len(data) / (self._sampwidth * self._nchannels)
                if self._comp:
-                       self._comp.SetParam(CL.FRAME_BUFFER_SIZE, len(data))
-                       self._comp.SetParam(CL.COMPRESSED_BUFFER_SIZE, \
+                       dummy = self._comp.SetParam(CL.FRAME_BUFFER_SIZE, \
+                                 len(data))
+                       dummy = self._comp.SetParam(CL.COMPRESSED_BUFFER_SIZE,\
                                  len(data))
                        data = self._comp.Compress(nframes, data)
                self._file.write(data)
diff --git a/Lib/irix5/AWARE.py b/Lib/irix5/AWARE.py
new file mode 100755 (executable)
index 0000000..30be50b
--- /dev/null
@@ -0,0 +1,54 @@
+# 
+# Copyright (c) 1992 Aware, Inc. All rights reserved.
+# 
+# Copyright Unpublished, Aware Inc.  All Rights Reserved.
+# This software contains proprietary and confidential
+# information of Aware, Inc.  Use, disclosure or
+# reproduction is prohibited without the prior express
+# written consent of Aware, Inc.
+# 
+#
+
+#
+# awareAudio.h - Aware Compression Library Parameter Header
+#
+#   01/21/92   Original Version by Brian Knittel and Jonathon Devine
+#
+
+import CL
+
+# Aware Audio Specific Parameters - For both MPEG Audio and Multirate
+CL.CHANNEL_POLICY = CL.NUMBER_OF_PARAMS + 0
+CL.NOISE_MARGIN = CL.NUMBER_OF_PARAMS + 1
+CL.BITRATE_POLICY = CL.NUMBER_OF_PARAMS + 2
+
+# Additional parameters for MPEG Audio
+CL.BITRATE_TARGET = CL.NUMBER_OF_PARAMS + 3
+CL.LAYER = CL.NUMBER_OF_PARAMS + 4
+
+# read/write for compression configuration
+# read for state during compression/decompression 
+
+#
+# Channel Policy
+#
+AWCMP_STEREO = 1
+AWCMP_JOINT_STEREO = 2
+AWCMP_INDEPENDENT = 3
+
+# 
+# read/write for compression configuration,
+# read for state during compression
+#
+#
+# Bit-rate Policy
+#
+AWCMP_FIXED_RATE = 1
+AWCMP_CONST_QUAL = 2
+AWCMP_LOSSLESS = 4
+
+#
+# Layer values
+#
+AWCMP_MPEG_LAYER_I = 1
+AWCMP_MPEG_LAYER_II = 2
diff --git a/Lib/plat-irix5/AWARE.py b/Lib/plat-irix5/AWARE.py
new file mode 100755 (executable)
index 0000000..30be50b
--- /dev/null
@@ -0,0 +1,54 @@
+# 
+# Copyright (c) 1992 Aware, Inc. All rights reserved.
+# 
+# Copyright Unpublished, Aware Inc.  All Rights Reserved.
+# This software contains proprietary and confidential
+# information of Aware, Inc.  Use, disclosure or
+# reproduction is prohibited without the prior express
+# written consent of Aware, Inc.
+# 
+#
+
+#
+# awareAudio.h - Aware Compression Library Parameter Header
+#
+#   01/21/92   Original Version by Brian Knittel and Jonathon Devine
+#
+
+import CL
+
+# Aware Audio Specific Parameters - For both MPEG Audio and Multirate
+CL.CHANNEL_POLICY = CL.NUMBER_OF_PARAMS + 0
+CL.NOISE_MARGIN = CL.NUMBER_OF_PARAMS + 1
+CL.BITRATE_POLICY = CL.NUMBER_OF_PARAMS + 2
+
+# Additional parameters for MPEG Audio
+CL.BITRATE_TARGET = CL.NUMBER_OF_PARAMS + 3
+CL.LAYER = CL.NUMBER_OF_PARAMS + 4
+
+# read/write for compression configuration
+# read for state during compression/decompression 
+
+#
+# Channel Policy
+#
+AWCMP_STEREO = 1
+AWCMP_JOINT_STEREO = 2
+AWCMP_INDEPENDENT = 3
+
+# 
+# read/write for compression configuration,
+# read for state during compression
+#
+#
+# Bit-rate Policy
+#
+AWCMP_FIXED_RATE = 1
+AWCMP_CONST_QUAL = 2
+AWCMP_LOSSLESS = 4
+
+#
+# Layer values
+#
+AWCMP_MPEG_LAYER_I = 1
+AWCMP_MPEG_LAYER_II = 2