[Audio Formats] Fix handling unsigned formats
This only affects the FFmpeg input, currently. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
7044a9a852
commit
3e01312265
|
@ -55,12 +55,12 @@ AudioStreamBasicDescription propertiesToASBD(NSDictionary *properties)
|
|||
asbd.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
|
||||
asbd.mFormatFlags |= kLinearPCMFormatFlagIsAlignedHigh;
|
||||
}
|
||||
|
||||
if (isFloat == NO && [[properties objectForKey:@"Unsigned"] boolValue] == NO) {
|
||||
|
||||
if(isFloat == NO && [[properties objectForKey:@"unSigned"] boolValue] == NO) {
|
||||
asbd.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
|
||||
}
|
||||
|
||||
if (isFloat) {
|
||||
|
||||
if (isFloat) {
|
||||
asbd.mFormatFlags |= kLinearPCMFormatFlagIsFloat | kAudioFormatFlagIsPacked;
|
||||
}
|
||||
|
||||
|
|
|
@ -925,7 +925,7 @@ static uint8_t reverse_bits[0x100];
|
|||
return @{ @"channels": [NSNumber numberWithInt:channels],
|
||||
@"channelConfig": [NSNumber numberWithUnsignedInt:channelConfig],
|
||||
@"bitsPerSample": [NSNumber numberWithInt:bitsPerSample],
|
||||
@"Unsigned": [NSNumber numberWithBool:(bitsPerSample == 8)],
|
||||
@"unSigned": [NSNumber numberWithBool:(bitsPerSample == 8)],
|
||||
@"sampleRate": [NSNumber numberWithFloat:frequency],
|
||||
@"floatingPoint": [NSNumber numberWithBool:floatingPoint],
|
||||
@"totalFrames": [NSNumber numberWithDouble:totalFrames],
|
||||
|
|
Loading…
Reference in New Issue