AbedElazizShe / LightCompressor

A powerful and easy-to-use video compression library for android uses MediaCodec API.
Apache License 2.0
539 stars 116 forks source link

audio speed up #121

Closed fuzhengyin closed 2 years ago

fuzhengyin commented 2 years ago

https://github.com/AbedElazizShe/LightCompressor/blob/8d8a35d9733b78724cd4466608075ca01742a78e/lightcompressor/src/main/java/com/abedelazizshe/lightcompressorlibrary/video/Track.kt#L312

Why hard code this parameter? It cause "audio speed up"(I don't know how to describe it).

in 0.9.9

audioSampleEntry.sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE).toLong()

AbedElazizShe commented 2 years ago

Hi @fuzhengyin, thank you for pointing this out. I must have missed it while testing as I tried different values to understand effects. I changed it to the way you proposed.

Thank you.