slmdev / sac

state-of-the-art lossless audio compression
44 stars 4 forks source link

Decoding audio file from cross-platform does not work, but except one platform. #2

Closed MartinEesmaa closed 1 year ago

MartinEesmaa commented 1 year ago

Hi @slmdev! I have a problem decoding audio of cross-platform, but except one platform.

I compiled SAC executable for Windows & Linux build:

g++ main.cpp cmdline.cpp ./common/*.cpp ./file/*.cpp ./libsac/*.cpp ./model/*.cpp ./pred/*.cpp -static

I encoded SAC audio from WAV audio using my Windows build and when I try to decode from SAC encoded audio of Windows platform to my Linux platform, decode is fine and the playback is corrupted. Only one platform of encoded audio can play with compared same one platform like Windows.

Decoding and playback from encoded SAC audio of Windows build to WAV audio using Windows platform, the decode & playback was fine. I can claim this is an encoder and or decoder bug. Compiler bug?

Here's the problem screenshot for more understand:

problemaboutsac

Let me know if you could reply to me.

Thank you! :)

MartinEesmaa commented 1 year ago

It solved my problem by using additional commands: -O2 -flto=8 to play perfect playback well between Windows and Linux. EDIT: Using optimizations may affect audio different MD5 for other optimized programs.