Set audioBitDepth instead of converting

This commit is contained in:
clobber
2013-08-05 12:33:34 -05:00
parent 49b8e0f11d
commit 5263b41ea3
+13 -8
View File
@@ -196,6 +196,11 @@ static void display_ResetPalette32( ) {
return 48000;
}
- (NSUInteger)audioBitDepth
{
return 8;
}
#pragma mark Input
// ----------------------------------------------------------------------------
// SetInput
@@ -303,15 +308,15 @@ static void sound_Store() {
sample[index] = sample[index] / 2;
}
//}
[[current ringBufferAtIndex:0] write:sample maxLength:length];
// Convert 8u to 16s
for(int i = 0; i != length; i ++)
{
int16_t sample16 = (sample[i] << 8) - 32768;
int16_t frame[2] = {sample16, sample16};
[[current ringBufferAtIndex:0] write:frame maxLength:2];
}
// for(int i = 0; i != length; i ++)
// {
// int16_t sample16 = (sample[i] << 8) - 32768;
// int16_t frame[2] = {sample16, sample16};
//
// [[current ringBufferAtIndex:0] write:frame maxLength:2];
// }
}
@end