網路上的window.speechSynthesis教學主要都只有說切換指定語言
像是這樣就能切換成中文語音:
const synth = window.speechSynthesis;
const speak = (msg) => {| #!/bin/bash | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
| exit 1 | |
| } | |
| # Check if at least one argument (input file) is provided | |
| if [ $# -lt 1 ]; then |
| <template> | |
| <VueMarkdownEditor | |
| v-model="newModelValue" | |
| :disabled-menus="[]" | |
| :include-level="[1, 2, 3, 4, 5, 6]" | |
| @upload-image="handleUploadImage" | |
| @change="change" | |
| :height="height + 'px'" | |
| :placeholder="placeholder" | |
| > |
| package main | |
| import ( | |
| "net/http" | |
| "os" | |
| "bytes" | |
| "path" | |
| "path/filepath" | |
| "mime/multipart" | |
| "io" |
You can check here for getting the latest version. Change the wget url to download newer versions.
| // helpers.php | |
| if (!function_exists('get_current_router_bind')) { | |
| function get_current_router_bind_key() { | |
| dd(key(array_reverse(last(last(debug_backtrace(0)[2]))))); | |
| } | |
| } | |
| // UserController | |
| // update(Request $request, User get_current_router_bind_key()) | |
| public function update(Request $request, User $user) |
| function json($status, $data = null, $message = 'success') | |
| { | |
| if (is_null($data)) { | |
| $data = ['status' => $status, 'message' => $message]; | |
| } elseif (is_string($data)) { | |
| $data = ['status' => $status, 'message' => $data]; | |
| } else { | |
| $data = ['status' => $status, 'message' => $message, 'data' => $data]; | |
| } | |
| return json_encode($data); |
| ## 代码 | |
| // 在 php 7 中,可以使用 ?? 运算符 | |
| // example: | |
| // return $var ?? ''; | |
| function first_no_null(&$var, $default = '') | |
| { | |
| return !empty($var) ? $var : $default; | |
| } |
| /** | |
| * 生成签名 | |
| * | |
| * @param array $data | |
| * @return string | |
| */ | |
| function gen_sign(array $data) | |
| { | |
| $arr = array(); | |
| $arr['body'] = $data['body']; |
| function ksort(obj){ | |
| var keys = Object.keys(obj).sort() | |
| , sortedObj = {}; | |
| for(var i in keys) { | |
| sortedObj[keys[i]] = obj[keys[i]]; | |
| } | |
| return sortedObj; | |
| } |