Home> Web Front-end> uni-app> body text

How to solve the problem of sound playing error in uniapp

藏色散人
Release: 2023-01-13 00:44:37
Original
6214 people have browsed it

Solution to uniapp sound playback error: 1. Open the corresponding code file, and then directly execute the object play method to replace the original src path; 2. Update the development tool version.

How to solve the problem of sound playing error in uniapp

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, DELL G3 computer.

uni-app Voice file playback problem, innerAudioContext cannot be destroyed! ! !

##uni-app Voice createInnerAudioContext object cannot be destroyed and crashes! ! !

I found that the voice could not be played during packaging today, so I looked for the reason. I remembered that this problem had been dealt with, so I quickly found the problem. I used the wrong project and used the original one for packaging. This error It's really unforgivable.

I would like to record the error that the voice cannot be played today. Voice playback is created using the built-in uni.createInnerAudioContext();. When playing, an error is reported and crashes.

Post the code, this is how I wrote it. When the current method is called, paste the code directly. This is wrong. Don't copy it directly, brother.

Copy after login

When you see the two lines of code above, remember not to destroy it, just execute the object play method directly. This method uses an object, which will replace the original src path by default and can be played directly.

Another reason is that the version of the development tool is too old. My current version is 1.6.2. Mainly This version of the process has fewer problems.

The following code can be copied

Copy after login

Recommended: "

uniapp tutorial"

The above is the detailed content of How to solve the problem of sound playing error in uniapp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!