vue 使用weixin sdk 錄音功能

2021-08-26 12:16:59 字數 1765 閱讀 3936

獻上官方使用說明文件位址

乾貨現在開始

第一步肯定是先安裝這個sdk了

npm install weixin-js

-sdk

在使用的檔案裡面引入

import wx from

'weixin-js-sdk'

我隨便寫了乙個小dome **獻上

功能為 錄音 停止 上傳…

為了將錄音永久儲存,將錄音也傳到後端,後端轉成***檔案 返回位址

又加了乙個將所有錄音合成一段長音訊返回

class="hello">

class="record" @click="start">開始錄音button>

停止錄音button>

取消錄音button>

錄音時間

}p>

class="list">

剛錄完的語言

ref="player"

src=""

controls>

audio>

div>

合併所有錄音button>

ref="allrecord"

src=""

controls>

audio>

div>

div>

template>

import wx from 'weixin-js-sdk'

const _this = wx

export default

},created ()

}).then((res) => )

// config資訊驗證後才執行

_this.ready(() => )

_this.error((res) => )

}).catch((error) => )

},methods: , 1000)

that.vicoeend()

},cancel: function

() })

},// 停止錄音

stop () ,

fail: function

(error)

})},

// 取消錄音

cancel ()

})},

// 60秒監聽

vicoeend ()

})},

// 合併

merge ()

}).then((ser) => )

.catch((error) => )

},// play () )

// },

// // 暫停

// pauseplay () )

// },

// // 停止

// stopplay () )

// },

// 上傳語音

upvoice ()

}).then((data) => )

.catch((error) => )}})

}// downvoice ()

// })

// },

// 模擬上傳語音

// fake ()

// })

// .then((res) => )

// .catch((error) => )

// }

}}script>

style>

AS使用備忘錄

1 使用as打包apk時如何忽略翻譯問題 在build.gradle中做如下配置即可忽略檢測 lintoptions 2 使用as檢視sha1 在as控制台terminal 輸入如下指令即可 keytool v list keystore c users administrator desktop ...

SGAPI使用備忘錄

首先 sgapi必須要修改修改才會好用,才能隨心所欲地用。修改的地方 第一 必須明白這一點 當我們在web頁面頭部寫上時,在web程式執行時,該頁面呼叫的是客戶端本地的view安裝資料夾裡面的sgapi js庫,為了使用自己修改過的sgapi庫,必須將此段 改寫成引用伺服器端的sgapi庫 就是自己...

Softice使用備忘錄

softice預定義功能組合鍵的作用 f1 幫助 f2 暫存器顯示 關閉切換 f3 源程式 反彙編 切換 程式有源程式時可用 f4 softice介面 螢幕原始畫面顯示切換 f5 退出softice視窗 f6 進入 退出 視窗 f7 程式執行到游標所在處 f8 單步跟蹤 f9 在游標所在位置設斷點 ...