Tencent Voice SDK records 4098, 4101

Cause: The Unity project wants to implement the function of sending voice. Record some problems encountered in accessing Tencent Voice SDK.

First of all, the Unity environment supports testing the entire recording process. If this is confirmed, you will not suspect that it is an environmental problem when you cannot find the problem, and then report the same error when packaging.

Here are some common mistakes

The first error, 4098, is an initialization error. Check whether the device is occupied, or whether the permissions are normal, and whether the initialization is normal.
It is more common in Unity. At this time, you need to check the following issues.
1: Whether initialization and authentication assignment have been performed before operating recording.
2: Whether the recording device is normal (the error 4098 will be reported if there is no microphone or the device is disabled)

The second error, 4101, when recording, recording file access error, make sure the file exists and the file path is legal

1: When this error occurs, check whether there is a path for storing files. If not, just create a folder corresponding to the path after initial initialization.
There are no relevant steps in the SDK documentation, but if there is no corresponding folder, an error 4101 will be reported.

The third problem is that there is no sound when playing files.

This problem is also very tricky, because if there is no general error in the playback file, it will return success. This causes you to see the callback for successful playback, but not hear the sound.
When this problem occurs, check whether the path you play the sound is correct. This is very important, because if you pass the wrong path, it will return a successful callback.
If it doesn’t work, if you ensure the existence of the recording file, you can upload the path test and play it separately.

The above are some troublesome places encountered when accessing. If the whole process can run smoothly in Unity, there should be no problem in other devices.

For other questions, please refer to the official documentation.
Tencent Voice SDK

Guess you like

Origin blog.csdn.net/qq_39860954/article/details/131918033