Reputation: 919
I've successfully written the RTP-payload into an amr-file and it works fine, according to the answer written in this question.
https://stackoverflow.com/questions/61961965/convert-rtp-payload-payload-type-107-amr-wb-16khz-1channel-to-wav
Now I tried to write a multichannel file according to chapter 5.2 according to document RFC 4867, but I failed. No decoder accepts the file. I've got 2 channels (stereo).
I've already checked the correctness of the voice data in the file. And they seem correct. First I put the header according to chapter 5.2:
https://www.rfc-editor.org/rfc/rfc4867#section-5.2
The magic number I checked and it's correct. Then I add the chan-desc-field and it should be as far as I understood:
b'\x00\x00\x00\x02'
In the audiofile I read the same values. Is this correct? The audiodata is saved according to 5.3 (1st paragraph):
1.pack_chan1 1.pack_chan2, 2.pack_chan1 2.pack_chan2, etc
Now clicking on the amr-file (or awb), the decoder says, that an error has occurred. On the contrary, when I just write one channel in a file, according to chapter 5.1 and 5.3, everything works fine. It can be played with windows VLC-MEDIA PLAYER and Linux Ubuntu's Videos.
Where is my mistake?
Thanks and regards
Update: Chapter 3.5 of RFC4867, second paragraph says, that usually, codecs do not support encoding of multi-channel audio content into a single bitstream, they can be used to separately encode and decode each of the individual channels.
So what can I do to produce the stereo sound with the 2 channels?
Upvotes: 0
Views: 320