ruby-audio 1.1.0 → 1.1.1
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/Rakefile +1 -1
- data/ext/ra_sound.c +8 -4
- metadata +1 -1
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'spec/rake/spectask'
|
|
6
6
|
|
7
7
|
spec = Gem::Specification.new do |s|
|
8
8
|
s.name = 'ruby-audio'
|
9
|
-
s.version = '1.1.
|
9
|
+
s.version = '1.1.1'
|
10
10
|
s.summary = 'ruby-audio wraps around libsndfile to provide simplified sound reading and writing support to ruby programs'
|
11
11
|
s.authors = ['Stephen Augenstein']
|
12
12
|
s.email = 'perl.programmer@gmail.com'
|
data/ext/ra_sound.c
CHANGED
@@ -131,6 +131,7 @@ static void ra_sound_read_short(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frames
|
|
131
131
|
static short temp[1024];
|
132
132
|
int temp_len = 1024;
|
133
133
|
short *data = (short*)buf->data;
|
134
|
+
short mix_sum;
|
134
135
|
|
135
136
|
// Get info struct
|
136
137
|
SF_INFO *info;
|
@@ -143,7 +144,7 @@ static void ra_sound_read_short(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frames
|
|
143
144
|
read = sf_readf_short(snd->snd, data, frames);
|
144
145
|
} else if(buf->channels == 1) { // Downmix to mono
|
145
146
|
sf_count_t max = temp_len / info->channels;
|
146
|
-
int channels
|
147
|
+
int channels;
|
147
148
|
|
148
149
|
while(read < frames) {
|
149
150
|
// Calculate # of frames to read
|
@@ -189,6 +190,7 @@ static void ra_sound_read_int(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frames)
|
|
189
190
|
static int temp[1024];
|
190
191
|
int temp_len = 1024;
|
191
192
|
int *data = (int*)buf->data;
|
193
|
+
int mix_sum;
|
192
194
|
|
193
195
|
// Get info struct
|
194
196
|
SF_INFO *info;
|
@@ -201,7 +203,7 @@ static void ra_sound_read_int(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frames)
|
|
201
203
|
read = sf_readf_int(snd->snd, data, frames);
|
202
204
|
} else if(buf->channels == 1) { // Downmix to mono
|
203
205
|
sf_count_t max = temp_len / info->channels;
|
204
|
-
int channels
|
206
|
+
int channels;
|
205
207
|
|
206
208
|
while(read < frames) {
|
207
209
|
// Calculate # of frames to read
|
@@ -247,6 +249,7 @@ static void ra_sound_read_float(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frames
|
|
247
249
|
static float temp[1024];
|
248
250
|
int temp_len = 1024;
|
249
251
|
float *data = (float*)buf->data;
|
252
|
+
float mix_sum;
|
250
253
|
|
251
254
|
// Get info struct
|
252
255
|
SF_INFO *info;
|
@@ -259,7 +262,7 @@ static void ra_sound_read_float(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frames
|
|
259
262
|
read = sf_readf_float(snd->snd, data, frames);
|
260
263
|
} else if(buf->channels == 1) { // Downmix to mono
|
261
264
|
sf_count_t max = temp_len / info->channels;
|
262
|
-
int channels
|
265
|
+
int channels;
|
263
266
|
|
264
267
|
while(read < frames) {
|
265
268
|
// Calculate # of frames to read
|
@@ -305,6 +308,7 @@ static void ra_sound_read_double(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frame
|
|
305
308
|
static double temp[1024];
|
306
309
|
int temp_len = 1024;
|
307
310
|
double *data = (double*)buf->data;
|
311
|
+
double mix_sum;
|
308
312
|
|
309
313
|
// Get info struct
|
310
314
|
SF_INFO *info;
|
@@ -317,7 +321,7 @@ static void ra_sound_read_double(RA_SOUND *snd, RA_BUFFER *buf, sf_count_t frame
|
|
317
321
|
read = sf_readf_double(snd->snd, data, frames);
|
318
322
|
} else if(buf->channels == 1) { // Downmix to mono
|
319
323
|
sf_count_t max = temp_len / info->channels;
|
320
|
-
int channels
|
324
|
+
int channels;
|
321
325
|
|
322
326
|
while(read < frames) {
|
323
327
|
// Calculate # of frames to read
|