The content of this article is from the internet. I have referenced Weibo and Forum summaries.
When making a speech intercom, you will encounter the problem of recording speech format, because you need to consider the formats supported by your own development devices, but also the formats supported by the operating systems of other devices, and the difficulty of implementing various formats on their respective platforms.
Previously, the company made speech in this part. The solution was to record a local voice file and perform codec conversion on the server. Of course, each platform also chooses its most suitable encoding format.
Currently, the platform is mainly for iOS and Android platforms, and WP is not considered yet.
The main recording formats are MP3, AAC, ilbc, speex, and Amr. Each format has its own characteristics. The size of the ilbc, speex, and Amr Recording files is quite small, suitable for network transmission.
The solutions for recording formats are summarized as follows:
MP3: for iOS and Android recording, encoding and conversion are required. When using a third-party lame library, you can directly play the recordings.
Ilbc: IOS supports encoding and decoding, which is not supported in earlier Android versions. However, there are open-source third-party libraries that support recording encoding and playback decoding.
Speex: it is also an open-source third-party library. It claims that the file is small and can reduce noise. It must be encoded and decoded by the iOS and Android clients.
AMR: supported by Versions earlier than iOS 4.3, But not later versions. Android devices support this format. iOS devices can use the libopencore third-party library for conversion, after playing the video, it is decoded into the original PCM for playing. Android devices can be directly recorded and played
AAC: both systems should support the format, but it is said that Android devices do not support well. No tests are performed. The details are unknown.
The solution should be the most convenient for AAC, but it seems that there are not many discussions on the network, and the actual application may not be too wide. Others have their own merits. You can choose one based on your needs. For specific implementation, take the MP3 test to see how it works.
In the third-party library encoding/decoding process, there are two methods: You can directly record the data into a file before conversion, or you can also convert the original data while recording and saving the file. All of them need to be tested to see how it works.