Skip to content

Instantly share code, notes, and snippets.

@BettyJJ
BettyJJ / App.js
Created January 23, 2024 08:37
Example of Asure Speech service TTS in React
// copy to your component to use it
import * as sdk from "microsoft-cognitiveservices-speech-sdk";
function textToSpeech() {
const speechKey = process.env.SPEECH_KEY;
const speechRegion = process.env.SPEECH_REGION;
const speechConfig = sdk.SpeechConfig.fromSubscription(speechKey, speechRegion);
const audioConfig = sdk.AudioConfig.fromDefaultSpeakerOutput();
Name: Microsoft Server Speech Text to Speech Voice (af-ZA, AdriNeural)
ShortName: af-ZA-AdriNeural
Gender: Female
Locale: af-ZA
VoiceTag: {'ContentCategories': ['General'], 'VoicePersonalities': ['Friendly', 'Positive']}
Name: Microsoft Server Speech Text to Speech Voice (af-ZA, WillemNeural)
ShortName: af-ZA-WillemNeural
Gender: Male
Locale: af-ZA
@BettyJJ
BettyJJ / strange.dict.yaml
Last active March 19, 2021 00:47
Rime 排序疑似 bug 的例子
# Rime dictionary
# encoding: utf-8
#
# 展示候选字排序疑似 bug 的例子
# 选取了读 tai 的字,给每个字拼音后面加上了辅助码(有的字有多种可能的辅助码)
# 现在输入 tai,候选字排序正常,但只要把“台”字的辅助码改一下,比如改成 sx,排序就变了,会有一个奇怪的生僻字出现在第一页
---
name: strange
version: "20210319"