mackron / dr_libs

Audio decoding libraries for C/C++, each in a single source file.
Other
1.24k stars 205 forks source link

drwav writes .wav file fail to play on android/ios devices #188

Closed rancpine closed 3 years ago

rancpine commented 3 years ago

I'm using drmp3 to decode mp3 to pcm frames, then output the frames to .wav using drwav_write_pcm_frames(). I can play the result .wav file on my computer, but I can't play it on my android & ios devices using system player (sdk).

I can play the wav file using 3rd-party player app on android&ios, though.

The system player(sdk) can play other normal wav files download from network.

Is there any trick?

rancpine commented 3 years ago

I happend to have 2 .wav files. One with a 78-byte header which contains :"list infoisft lavf58.29.100", it can play well on android/ios The other one with a 44-byte header, can't play correctly. The data without headers are the same(which I compared with dumping hex value).

Shall I add metadata manually?

rancpine commented 3 years ago

It turned out that I forgot to call drwav_uninit() ;P thank you for high quality dr_libs, Cheers