Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
readd float32 sample clamp
  • Loading branch information
Eknous-P committed Jan 11, 2025
1 parent 48f6076 commit 9bfdc3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/engine/fileOpsSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ std::vector<DivSample*> DivEngine::sampleFromFile(const char* path) {
loadP(reader,ret,stripPath);
}

if((int)ret.size()>0) {
if ((int)ret.size()>0) {
int counter=0;

for(DivSample* s: ret) {
for (DivSample* s: ret) {
s->name=fmt::sprintf("%s sample %d", stripPath, counter);
counter++;
}
Expand Down Expand Up @@ -382,6 +382,8 @@ std::vector<DivSample*> DivEngine::sampleFromFile(const char* path) {
if (isNotMono) {
averaged/=sampleChans;
averaged*=32767.0;
if (averaged<-32768.0) averaged=-32768.0;
if (averaged>32767.0) averaged=32767.0;
samples[sampleChans]->data16[index]=averaged;
} else {
samples[0]->data16[index]=perCh;
Expand Down

0 comments on commit 9bfdc3f

Please sign in to comment.