Added frames per packet export
This commit is contained in:
parent
bb7e91682e
commit
eec1c7d041
|
@ -21,6 +21,7 @@ alac_encoder alac_encoder_new(int sampleRate, int channels, int bitDepth, int fa
|
|||
encoder.input_packet_size = 0;
|
||||
encoder.output_max_packet_size = 0;
|
||||
encoder.magic_cookie_size = 0;
|
||||
encoder.frames_per_packet = 0;
|
||||
|
||||
AudioFormatDescription d;
|
||||
d.mFormatID = kALACFormatAppleLossless;
|
||||
|
@ -69,6 +70,7 @@ alac_encoder alac_encoder_new(int sampleRate, int channels, int bitDepth, int fa
|
|||
encoder.input_packet_size = channels * (bitDepth >> 3) * d.mFramesPerPacket;
|
||||
encoder.output_max_packet_size = encoder.input_packet_size + kALACMaxEscapeHeaderBytes;
|
||||
encoder.magic_cookie_size = e->GetMagicCookieSize(channels);
|
||||
encoder.frames_per_packet = d.mFramesPerPacket;
|
||||
|
||||
return encoder;
|
||||
}
|
||||
|
@ -150,4 +152,4 @@ int alac_encoder_write(alac_encoder* encoder, const unsigned char * input, int i
|
|||
void alac_encoder_delete(alac_encoder* encoder){
|
||||
delete reinterpret_cast<ALACEncoder*>(encoder->ptr);
|
||||
encoder->ptr = nullptr;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ typedef struct {
|
|||
int input_packet_size;
|
||||
int output_max_packet_size;
|
||||
int magic_cookie_size;
|
||||
int frames_per_packet;
|
||||
} alac_encoder;
|
||||
|
||||
alac_encoder alac_encoder_new(int sampleRate, int channels, int bitDepth, int fastMode);
|
||||
|
|
Loading…
Reference in a new issue