In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you how to use wx.getRecorderManager in Mini Program. The content is easy to understand and clear. I hope it can help you solve your doubts. Let the editor take you to study and learn how to use wx.getRecorderManager in Mini Program.
The basic library 1.6.0 is supported, and the lower version needs to be compatible.
Gets the globally unique recording manager recorderManager.
RecorderManager
List of methods for the recorderManager object:
Method parameters indicate that startoptions starts recording pause pauses recording resume continues recording stop stops recording onStartcallback recording starts event onPausecallback recording pauses event onStopcallback recording stops event, the file address onFrameRecordedcallback has finished recording files of specified frame size, and the recording shard result data will be called back. If frameSize is set, this event onErrorcallback recording error event and error message will be called back
Start (options) description:
The attribute type is required to indicate whether durationNumber specifies the duration of recording (in ms). If a valid duration is passed, the recording will be stopped automatically when the specified duration is reached, with a maximum value of 600000 (10 minutes). The default value is 60000 (1 minute) sampleRateNumber No sampling rate, valid value 8000/16000/44100numberOfChannelsNumber No recording channels, valid value 1/2encodeBitRateNumber No coding rate. Valid values see below table formatString No Audio format, valid value aac/mp3frameSizeNumber No specify frame size, Unit KB. After frameSize is passed, the content of the recorded file will be called back every time the content of the specified frame size is recorded. If it is not specified, it will not be called back. Only mp3 format is supported.
Among them, the sampling rate and bitrate have certain requirements, and the specific valid values are as follows:
Sampling rate 800016000 ~ 480001102516000 ~ 480001200024000 ~ 640001600024000 ~ 960002205032000 ~ 1280002400032000 ~ 1280003200048000 ~ 1920004410064000 ~ 3200004800064000 ~ 320000
The callback result of onStop (callback) indicates:
The property type describes the temporary path to the tempFilePathString recording file
The callback result of onFrameRecorded (callback) indicates:
The attribute type indicates whether the frameBufferArrayBuffer recording fragment result data isLastFrameBoolean is normal in the current frame and the last frame before the end of recording
The callback result of onError (callback) indicates:
Attribute type description errMsgString error message
Sample code:
Const recorderManager = wx.getRecorderManager () recorderManager.onStart (() = > {console.log ('recorder start')}) recorderManager.onResume (() = > {console.log (' recorder resume')}) recorderManager.onPause (() = > {console.log ('recorder pause')}) recorderManager.onStop ((res) = > {console.log (' recorder stop', res) const {tempFilePath} = res}) recorderManager.onFrameRecorded ((res) = > {const {frameBuffer} = res console.log ('frameBuffer.byteLength') FrameBuffer.byteLength)}) const options = {duration: 10000, sampleRate: 44100, numberOfChannels: 1, encodeBitRate: 192000, format: 'aac', frameSize: 50} recorderManager.start (options) what does Mini Program mean? Mini Program is an application that can be used without download or installation. By scanning the QR code or searching it for immediate use, it is easy to operate and easy to spread, and can achieve seven functions such as message notification, offline code scanning, official account association and so on. It is based on Wechat, similar to APP. You can use it whenever you want. After using it, you will leave without taking up memory.
The above is about "how to use wx.getRecorderManager in Mini Program". If this article is helpful and well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.