audite 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/audite.gemspec +1 -1
- data/bin/audite +1 -0
- data/ext/portaudio/extconf.rb +2 -0
- data/ext/portaudio/portaudio.c +15 -1
- metadata +1 -1
data/audite.gemspec
CHANGED
data/bin/audite
CHANGED
data/ext/portaudio/extconf.rb
CHANGED
data/ext/portaudio/portaudio.c
CHANGED
@@ -28,13 +28,20 @@ void free_portaudio(void *ptr)
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
|
31
|
-
|
31
|
+
#ifdef HAVE_TYPE_PASTREAMCALLBACKTIMEINFO
|
32
32
|
static int paCallback(const void *inputBuffer,
|
33
33
|
void *outputBuffer,
|
34
34
|
unsigned long framesPerBuffer,
|
35
35
|
const PaStreamCallbackTimeInfo* timeInfo,
|
36
36
|
PaStreamCallbackFlags statusFlags,
|
37
37
|
void *userData )
|
38
|
+
#else
|
39
|
+
static int paCallback(void *inputBuffer,
|
40
|
+
void *outputBuffer,
|
41
|
+
unsigned long framesPerBuffer,
|
42
|
+
PaTimestamp outTime,
|
43
|
+
void *userData )
|
44
|
+
#endif
|
38
45
|
{
|
39
46
|
Portaudio *portaudio = (Portaudio *) userData;
|
40
47
|
float *out = (float*) outputBuffer;
|
@@ -70,6 +77,9 @@ VALUE rb_portaudio_new(VALUE klass)
|
|
70
77
|
paFloat32, /* 32 bit floating point output */
|
71
78
|
44100, /* 44100 sample rate*/
|
72
79
|
4096, /* frames per buffer */
|
80
|
+
#ifndef HAVE_TYPE_PASTREAMCALLBACKTIMEINFO
|
81
|
+
1, /* number of buffer */
|
82
|
+
#endif
|
73
83
|
paCallback, /* this is your callback function */
|
74
84
|
(void*) portaudio);
|
75
85
|
|
@@ -104,7 +114,11 @@ VALUE rb_portaudio_write(VALUE self, VALUE buffer)
|
|
104
114
|
portaudio->buffer[i] = NUM2DBL(rb_ary_entry(buffer, i));
|
105
115
|
}
|
106
116
|
|
117
|
+
#ifdef RUBY_UBF_IO
|
107
118
|
rb_thread_blocking_region(portaudio_wait, portaudio, RUBY_UBF_IO, NULL);
|
119
|
+
#else
|
120
|
+
portaudio_wait(portaudio);
|
121
|
+
#endif
|
108
122
|
|
109
123
|
return self;
|
110
124
|
}
|