APL: Round bits per sample to an even byte

Round this variable up.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2023-07-21 00:14:31 -07:00
parent 503ca803e9
commit 7f0fe33f9d
No known key found for this signature in database

View file

@ -63,7 +63,7 @@
int channels = [[properties objectForKey:@"channels"] intValue];
// float sampleRate = [[properties objectForKey:@"sampleRate"] floatValue];
bytesPerFrame = (bitsPerSample / 8) * channels;
bytesPerFrame = ((bitsPerSample + 7) / 8) * channels;
if([apl endBlock] > [apl startBlock])
trackEnd = [apl endBlock]; //([apl endBlock] / sampleRate) * 1000.0;