This error occurred: Avaudiosessionerrorcodebadparam
Let's see if your question is not audible at the time you switch the handset speakerphone.
No, we can go on searching.
Here's the problem.
You can replace the one that is in the loop with this: Avaudiosessioncategoryplayandrecord
It's this after the opening.
The explanations are as follows:
Avaudiosessioncategoryambient or Kaudiosessioncategory_ambientsound
for non-voice-based applications, apps that use this category will be muted with the mute key and the screen turned off. It does not stop other apps from playing sound, and can play sounds with other apps such as Ipod,safari. Note: The category cannot play sound in the background
avaudiosessioncategorysoloambient or Kaudiosessioncategory_soloambientsound
similar to the avaudiosessioncategoryambient, the difference is that it stops other apps from playing sounds. This category is the default category. The category cannot play sound in the background
Avaudiosessioncategoryplayback or Kaudiosessioncategory_mediaplayback
for voice-based applications, apps that use this category do not mute with the mute key and the screen off. Sound can be played in the background
Avaudiosessioncategoryrecord or Kaudiosessioncategory_recordaudio
for apps that need to be recorded, after setting the category, other system sounds except call tones, alarms or calendar reminders will not be played. This category only provides a simple recording function.
Avaudiosessioncategoryplayandrecord or Kaudiosessioncategory_playandrecord
for applications that need to play both sound and recording, voice chat applications (such as) should use this category. This category provides recording and playback functions. If your app needs an iphone handset, the category is your only option, and the default exit for sound in that category is the handset (in the absence of an external device).
Note: Not an app can only use a category, the program should be based on the actual need to switch the different category, for example, when recording, it needs to be set to Avaudiosessioncategoryrecord, when the recording ends, You should change the category to Avaudiosessioncategoryambient as required by the program. One of the avaudiosessioncategorysoloambient or Avaudiosessioncategoryplayback.
IOS OC Ring Letter Real-time voice switch handset hands-free audible voice error: Avaudiosessionerrorcodebadparam