diff options
| author | Tim Redfern <tim@getdrop.com> | 2022-11-16 18:35:06 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2022-11-16 18:35:06 +0000 |
| commit | a393a5dd49636c54edf513d192d18c3e4768a034 (patch) | |
| tree | 6865d7eb18cb39ad8a631b77643467b9b486f14c | |
| parent | af643113fc7c309e02c5ddfce1712bad03707f82 (diff) | |
| parent | cef7d23c526ff32ae2f2fd5a7b38b163672fc3a7 (diff) | |
Merge branch 'master' of eclectronics.org@eclectronics.org:raverony
| -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); } |
