hanyska / flutter_audio_recorder2

MIT License
3 stars 26 forks source link

Wrong .wav header generated in iOS #3

Closed shaoyijia closed 3 years ago

shaoyijia commented 3 years ago

I'm using this package to record .wav audio files on both Android and iOS. I found that the .wav file generated by iOS app has wrong header block. For example, in the iOS app, I recorded a .wav audio with mono channel and the sampling rate is set to be 44100hz. The 44bytes header block of the file is (I read it using 'rb' in Python)

b'RIFF\xc6m\x01\x00WAVEJUNK\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

However, the correct header block should be

b'RIFF\xd2`\x01\x00WAVEfmt \x10\x00\x00\x00\x01\x00\x01\x00D\xac\x00\x00\x88X\x01\x00\x02\x00\x10\x00data\xae`\x01\x00'

Through your changeLog, I think you have already fixed the problem in Android. Can you kindly fix it in iOS?

shaoyijia commented 3 years ago

Sorry, I just found that this problem is because iOS wave format have a different type of header block which cannot match the .wav header generated in Android.