diff options
| author | Tim Redfern <tim@getdrop.com> | 2022-11-16 11:41:47 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2022-11-16 11:41:47 +0000 |
| commit | cef7d23c526ff32ae2f2fd5a7b38b163672fc3a7 (patch) | |
| tree | 1fd942c05d821a765fb8c31fc3961ec16d091e13 | |
| parent | 92db935dfa043d1e6e2f65b6fe157329c5ced521 (diff) | |
comments
| -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 eeb8d21..f856ba1 100644 --- a/audioin/src/ofApp.h +++ b/audioin/src/ofApp.h @@ -24,9 +24,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); } |
