# wx.setInnerAudioOption(Object object)
Start from base library version 2.3.0. Please remaining backward compatible.
with Promise style call: Supported
Mini Program plugin: Support, need to Mini Program base library version no less than 2.10.0
Set up InnerAudioContext The playback option of. Set to take effect globally for the current Mini Program.
# parameter
# Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
mixWithOther | boolean | true | no | To mix with other audio, set to true After that, the music in other apps or WeChat will not be terminated. |
obeyMuteSwitch | boolean | true | no | (Only iOS Is the mute switch followed and set to false After that, the sound can be played even in silent mode |
speakerOn | boolean | true | no | true Stand for playing on speaker, false Represents handset playback, default is true。 |
# Note
- To ensure the overall WeChat experience, speaker on for true The client ignores the mixWithOthers Parameter to enforce mutex with other audio
- It is not supported to switch to the speaker while playing the audio. If you need to switch, you can first pause the audio and record the time point of the current pause, and then switch to play the audio again from the original time point.
- at present wx.setInnerAudioOption Interface incompatibility wx.createWebAudioContext Interface, not compatible wx.createInnerAudioContext open useWebAudioImplement Will be supported in subsequent versions | | success | function | | no | Interface calls the successful callback function | | fail | function | | no | Interface calls failed callback functions | | complete | function | | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |