Skip to content

Commit

Permalink
Merge branch 'master' into thestk-master
Browse files Browse the repository at this point in the history
  • Loading branch information
lkotsonis authored Nov 20, 2024
2 parents ca43e19 + ef9fe25 commit 2a7c8f0
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions RtAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11463,22 +11463,20 @@ void RtApi ::convertBuffer(char *outBuffer, char *inBuffer, ConvertInfo &info) {
}
} else if (info.inFormat == RTAUDIO_FLOAT32) {
Float32 *in = (Float32 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
long long value = in[info.inOffset[j]] * 2147483648LL;
out[info.outOffset[j]] =
std::max(-2147483648LL, std::min(value, 2147483647LL));
out[info.outOffset[j]] = std::max(-2147483648LL, std::min(value, 2147483647LL));
}
in += info.inJump;
out += info.outJump;
}
} else if (info.inFormat == RTAUDIO_FLOAT64) {
Float64 *in = (Float64 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
long long value = in[info.inOffset[j]] * 2147483648LL;
out[info.outOffset[j]] =
std::max(-2147483648LL, std::min(value, 2147483647LL));
out[info.outOffset[j]] = std::max(-2147483648LL, std::min(value, 2147483647LL));
}
in += info.inJump;
out += info.outJump;
Expand Down Expand Up @@ -11528,8 +11526,8 @@ void RtApi ::convertBuffer(char *outBuffer, char *inBuffer, ConvertInfo &info) {
}
} else if (info.inFormat == RTAUDIO_FLOAT32) {
Float32 *in = (Float32 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
Int32 value = in[info.inOffset[j]] * 8388608;
out[info.outOffset[j]] = std::max(-8388608, std::min(value, 8388607));
}
Expand All @@ -11538,8 +11536,8 @@ void RtApi ::convertBuffer(char *outBuffer, char *inBuffer, ConvertInfo &info) {
}
} else if (info.inFormat == RTAUDIO_FLOAT64) {
Float64 *in = (Float64 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
Int32 value = in[info.inOffset[j]] * 8388608;
out[info.outOffset[j]] = std::max(-8388608, std::min(value, 8388607));
}
Expand Down Expand Up @@ -11590,8 +11588,8 @@ void RtApi ::convertBuffer(char *outBuffer, char *inBuffer, ConvertInfo &info) {
}
} else if (info.inFormat == RTAUDIO_FLOAT32) {
Float32 *in = (Float32 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
Int32 value = in[info.inOffset[j]] * 32768;
out[info.outOffset[j]] = std::max(-32768, std::min(value, 32767));
}
Expand All @@ -11602,6 +11600,8 @@ void RtApi ::convertBuffer(char *outBuffer, char *inBuffer, ConvertInfo &info) {
Float64 *in = (Float64 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
Int32 value = in[info.inOffset[j]] * 32768;
out[info.outOffset[j]] = std::max(-32768, std::min(value, 32767));
}
Expand Down Expand Up @@ -11654,8 +11654,8 @@ void RtApi ::convertBuffer(char *outBuffer, char *inBuffer, ConvertInfo &info) {
}
} else if (info.inFormat == RTAUDIO_FLOAT32) {
Float32 *in = (Float32 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
Int32 value = in[info.inOffset[j]] * 128;
out[info.outOffset[j]] = std::max(-128, std::min(value, 127));
}
Expand All @@ -11664,8 +11664,8 @@ void RtApi ::convertBuffer(char *outBuffer, char *inBuffer, ConvertInfo &info) {
}
} else if (info.inFormat == RTAUDIO_FLOAT64) {
Float64 *in = (Float64 *)inBuffer;
for (unsigned int i = 0; i < stream_.bufferSize; i++) {
for (j = 0; j < info.channels; j++) {
for (unsigned int i=0; i<stream_.bufferSize; i++) {
for (j=0; j<info.channels; j++) {
Int32 value = in[info.inOffset[j]] * 128;
out[info.outOffset[j]] = std::max(-128, std::min(value, 127));
}
Expand Down

0 comments on commit 2a7c8f0

Please sign in to comment.