aboutsummaryrefslogtreecommitdiffstats
path: root/audio/py-fastaudio/files/patch-fastaudio.pyx
blob: 8f097b13b3f017e66d4cc0d493adde37f1c3484d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- fastaudio.pyx.orig  2004-06-15 20:37:39.000000000 +0900
+++ fastaudio.pyx   2009-06-06 18:54:52.000000000 +0900
@@ -92,7 +92,7 @@
 #@+node:portaudio.h
 # portaudio-specifics
 
-cdef extern from "../pa_common/portaudio.h":
+cdef extern from "%%LOCALBASE%%/include/portaudio.h":
     ctypedef int PaError
 
     cdef enum PA_ERRORS:
@@ -586,8 +586,8 @@
         cdata.framesPerBuf = framesPerBuf
         cdata.bytesPerFrame = channels * _sampleFormatSizes[format]
         cdata.bytesPerBuf = framesPerBuf * cdata.bytesPerFrame 
-        cdata.txFifo = fifoNew(cdata.bytesPerBuf, maxbufs, 't')
-        cdata.rxFifo = fifoNew(cdata.bytesPerBuf, maxbufs, 'r')
+        cdata.txFifo = fifoNew(cdata.bytesPerBuf, maxbufs, <int> 't')
+        cdata.rxFifo = fifoNew(cdata.bytesPerBuf, maxbufs, <int> 'r')
         printf("__new__: txFifo=%lx rxFifo=%lx\n", cdata.txFifo, cdata.rxFifo)
         cdata.hits = 0
         cdata.running = 1
@@ -1113,28 +1113,28 @@
             # write to output buffer, converting to output format
             if cChansOut == 1:
                 if outFormat == paInt8:
-                    outPtr_8[idxOut] = (frameLeft + frameRight) / (2 * 0x1000000)
+                    outPtr_8[idxOut] = <char> (frameLeft + frameRight) / (2 * 0x1000000)
                 elif outFormat == paUInt8:
-                    outPtr_u8[idxOut] = (frameLeft + frameRight) / (2 * 0x1000000)
+                    outPtr_u8[idxOut] = <unsigned char> (frameLeft + frameRight) / (2 * 0x1000000)
                 elif outFormat == paInt16:
-                    outPtr_16[idxOut] = (frameLeft + frameRight) / (2 * 0x10000)
+                    outPtr_16[idxOut] = <short> (frameLeft + frameRight) / (2 * 0x10000)
                 elif outFormat == paInt32:
-                    outPtr_32[idxOut] = (frameLeft + frameRight) / 2
+                    outPtr_32[idxOut] = <long> (frameLeft + frameRight) / 2
                 elif outFormat == paFloat32:
                     outPtr_f32[idxOut] = (frameLeft + frameRight) / 2
             else:
                 if outFormat == paInt8:
-                    outPtr_8[idxOut * 2] = frameLeft / 0x1000000
-                    outPtr_8[idxOut * 2 + 1] = frameRight / 0x1000000
+                    outPtr_8[idxOut * 2] = <char> frameLeft / 0x1000000
+                    outPtr_8[idxOut * 2 + 1] = <char> frameRight / 0x1000000
                 elif outFormat == paUInt8:
-                    outPtr_u8[idxOut * 2] = frameLeft / 0x1000000
-                    outPtr_u8[idxOut * 2 + 1] = frameRight / 0x1000000
+                    outPtr_u8[idxOut * 2] = <unsigned char> frameLeft / 0x1000000
+                    outPtr_u8[idxOut * 2 + 1] = <unsigned char> frameRight / 0x1000000
                 elif outFormat == paInt16:
-                    outPtr_16[idxOut * 2] = frameLeft / 0x10000
-                    outPtr_16[idxOut * 2 + 1] = frameRight / 0x10000
+                    outPtr_16[idxOut * 2] = <short> frameLeft / 0x10000
+                    outPtr_16[idxOut * 2 + 1] = <short> frameRight / 0x10000
                 elif outFormat == paInt32:
-                    outPtr_32[idxOut * 2] = frameLeft
-                    outPtr_32[idxOut * 2 + 1] = frameRight
+                    outPtr_32[idxOut * 2] = <long> frameLeft
+                    outPtr_32[idxOut * 2 + 1] = <long> frameRight
                 elif outFormat == paFloat32:
                     outPtr_f32[idxOut * 2] = frameLeft
                     outPtr_f32[idxOut * 2 + 1] = frameRight