Get the App
SLTechnology News&Howtos  ›  Development  › 

How to start playing voice on Mini Program

Shulou Source: shulou.com Published: 2022-06-02 01:26:49 10月01日 Update

This article will introduce in detail "How to start playing voice in Mini programs," the content steps are clear and detailed, the details are handled properly, and the editor will update different knowledge points every day. I hope this article "How to start playing voice in Mini programs" can give you unexpected gains. Please follow the ideas of the editor slowly. The specific contents are as follows. Let's harvest new knowledge together.

Note: Since version 1.6.0, this interface is no longer maintained. It is recommended to use the more powerful wx.createInnerAudioContext interface

Start playing voice while only one voice file is being played. If the previous voice file is not played, the previous voice will be interrupted.

OBJECT Parameter Description:

Parameter type Required Description Minimum version filePathString is the file path of the voice file to be played durationNumber No Specify the recording duration, the recording will automatically stop after reaching the specified recording duration, unit: second, default value: 601.6.0successFunction No Interface call successful callback function failFunction No Interface call failed callback function completeFunction No Interface call ended callback function (call success, failure will be executed)

Example code:

wx.startRecord({ success: function(res) {var tempFilePath = res.tempFilePath wx.playVoice({ filePath: tempFilePath, complete: function(){ } }) }}) What are the advantages of Mini programs? Mini programs are less difficult to develop than developers, saving development and operation costs, allowing developers to quickly develop a Mini programs. In addition, Mini programs can be easily acquired and disseminated in WeChat, which can meet the basic life application, meet the conversion of offline shops of life service category and non-rigid low-frequency applications. For users, it can save time cost and mobile phone memory space, and has excellent use experience.

Thank you for reading here. Xiaobian hopes that you have the most profound experience from the practical level on the key issue of "how to start playing voice in Mini programs." The specific use situation still needs to be understood by you through practice. If you want to read more articles related to content, please pay attention to the industry information channel!

Tags: Voice program interface development file content function success parameter at the same time developer cost duration version practice application life different excellent convenient Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux OPPO Reno Shulou Tech Info NVidia Shulou Information