Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add XM format option #3

Closed
sapphire-bt opened this issue Apr 25, 2022 · 2 comments
Closed

Add XM format option #3

sapphire-bt opened this issue Apr 25, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sapphire-bt
Copy link
Collaborator

As suggested in #1, using XM format may lead to better compression due to the format's use of delta-encoding for samples.

@sapphire-bt sapphire-bt added the enhancement New feature or request label Apr 25, 2022
@sapphire-bt sapphire-bt self-assigned this Apr 25, 2022
@sapphire-bt
Copy link
Collaborator Author

TL;DR: it's probably not worth implementing a .xm file option. See the tables below for some file size comparisons I've done.

File Sizes

MP3 File Duration Size (.wav)* Size (.it) Size (.xm) Size (.it.uz) Size (.xm.uz)
Trance music 06:27 16,764 KB 16,667 KB 16,668 KB 8,331 KB 7,962 KB
Pop music 03:36 9,646 KB 9,305 KB 9,306 KB 4,845 KB 4,739 KB
Rock music 03:56 10,522 KB 10,167 KB 10,167 KB 7,829 KB 7,650 KB
Classical music 02:10 2,837 KB 2,811 KB 2,811 KB 653 KB 651 KB

*8-bit/22 kHz.

Compression Difference

MP3 File Size (.it.uz) Size (.xm.uz) Difference (KB)
Trance music 8,331 KB 7,962 KB -369 KB -4.43%
Pop music 4,845 KB 4,739 KB -106 KB -2.19%
Rock music 7,829 KB 7,650 KB -179 KB -2.28%
Classical music 653 KB 651 KB -2 KB -0.32%

Clearly .xm does compress slightly better than .it, but in my opinion it's not worth the effort of implementing another format just to save a few kilobytes, so I am closing this issue for now.

If anyone feels like adding .xm then pull requests are welcome.

Thanks for the suggestion @peterekepeter.

@peterekepeter
Copy link

Wow, thanks for investigating this! Very cool! Some bytes do get shaved off, but yeah the amount of effort might not be worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants