diff options
Diffstat (limited to 'audioin/src')
| -rw-r--r-- | audioin/src/ofApp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/audioin/src/ofApp.h b/audioin/src/ofApp.h index 05fc36a..2386ef8 100644 --- a/audioin/src/ofApp.h +++ b/audioin/src/ofApp.h @@ -32,9 +32,10 @@ public: } } void add(float * input, int num){ + //this assumes that num < size memcpy(&data[writePoint],input,min(num,size-writePoint)*sizeof(float)); if (size-writePoint<num){ //we have to wrap - //copy the remaining chunk to the start + //copy the remaining chunk to the start and set the new writePoint memcpy(data,&input[size-writePoint],(num-(size-writePoint))*sizeof(float)); writePoint=num-(size-writePoint); } |
