mirror of
https://github.com/RPCS3/soundtouch.git
synced 2024-11-10 04:42:50 +01:00
Fixed 8bit file processing
This commit is contained in:
parent
a63d88dc78
commit
122b08b2ca
@ -394,11 +394,11 @@ int WavInFile::read(float *buffer, int maxElems)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
char *temp2 = temp;
|
||||
unsigned char *temp2 = (unsigned char*)temp;
|
||||
double conv = 1.0 / 128.0;
|
||||
for (int i = 0; i < numElems; i ++)
|
||||
{
|
||||
buffer[i] = (float)(temp2[i] * conv);
|
||||
buffer[i] = (float)(temp2[i] * conv - 1.0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -886,10 +886,10 @@ void WavOutFile::write(const float *buffer, int numElems)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
char *temp2 = (char *)temp;
|
||||
unsigned char *temp2 = (unsigned char *)temp;
|
||||
for (int i = 0; i < numElems; i ++)
|
||||
{
|
||||
temp2[i] = (char)saturate(buffer[i] * 128.0f, -128.0f, 127.0f);
|
||||
temp2[i] = (unsigned char)saturate(buffer[i] * 128.0f + 128.0f, 0.0f, 255.0f);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user