diff --git a/README.md b/README.md index 8c3880a..efecf87 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,27 @@ | 模型 | 说明 | |------|------| +|8k_zh|中文电话通用| +|8k_en|英文电话通用| |16k_zh| 中文通用| |16k_zh-PY|中英粤| +|16k_zh_medical|中文医疗| |16k_en|英语| |16k_yue|粤语| +|16k_ja|日语| +|16k_ko|韩语| +|16k_vi|越南语| +|16k_ms|马来语| +|16k_id|印度尼西亚语| +|16k_fil|菲律宾语| +|16k_th|泰语| +|16k_pt|葡萄牙语| +|16k_tr|土耳其语| +|16k_ar|阿拉伯语| +|16k_es|西班牙语| +|16k_hi|印地语| +|16k_fr|法语| +|16k_de|德语| |16k_zh_dialect|多方言,支持23种方言(上海话、四川话、武汉话、贵阳话、昆明话、西安话、郑州话、太原话、兰州话、银川话、西宁话、南京话、合肥话、南昌话、长沙话、苏州话、杭州话、济南话、天津话、石家庄话、黑龙江话、吉林话、辽宁话)| - 更多模型详细说明,请参考[腾讯云文档](https://cloud.tencent.com/document/product/1093/35646) diff --git a/custom_components/tencentcloud_asr/stt.py b/custom_components/tencentcloud_asr/stt.py index fd28ff3..fb7b49c 100644 --- a/custom_components/tencentcloud_asr/stt.py +++ b/custom_components/tencentcloud_asr/stt.py @@ -52,6 +52,9 @@ class ASRSTT(stt.SpeechToTextEntity): @property def supported_sample_rates(self) -> list[stt.AudioSampleRates]: + model: str = self.hass.data.get(ModelKey, DefaultModel) + if model.startswith("8k_"): + return [stt.AudioSampleRates.SAMPLERATE_8000] return [stt.AudioSampleRates.SAMPLERATE_16000] @property diff --git a/custom_components/tencentcloud_asr/tencentcloud_api.py b/custom_components/tencentcloud_asr/tencentcloud_api.py index 288e80b..a842f28 100644 --- a/custom_components/tencentcloud_asr/tencentcloud_api.py +++ b/custom_components/tencentcloud_asr/tencentcloud_api.py @@ -11,10 +11,27 @@ _LOGGER = logging.getLogger(__name__) SentenceRecognitionSourceTypePost = 1 SentenceRecognitionSourceTypeURL = 0 ModuleSupportLanguage = { + "8k_zh": ["zh-cn"], + "8k_en": ["en"], "16k_zh": ["zh-cn"], "16k_zh-PY": ["zh-cn", "en", "zh-hk"], + "16k_zh_medical": ["zh-cn"], "16k_en": ["en"], "16k_yue": ["zh-hk"], + "16k_ja": ["ja"], + "16k_ko": ["ko"], + "16k_vi": ["vi"], + "16k_ms": ["ms"], + "16k_id": ["id"], + "16k_fil": ["fil"], + "16k_th": ["th"], + "16k_pt": ["pt"], + "16k_tr": ["tr"], + "16k_ar": ["ar"], + "16k_es": ["es"], + "16k_hi": ["hi"], + "16k_fr": ["fr"], + "16k_de": ["de"], "16k_zh_dialect": ["zh"], } DefaultModel = "16k_zh" diff --git a/custom_components/tencentcloud_asr/translations/en.json b/custom_components/tencentcloud_asr/translations/en.json index cddc9af..39243c5 100644 --- a/custom_components/tencentcloud_asr/translations/en.json +++ b/custom_components/tencentcloud_asr/translations/en.json @@ -25,10 +25,27 @@ "selector": { "model_descriptions": { "options": { - "16k_zh": "16k_zh Chinese", + "8k_zh": "8k_zh - Chinese telephone audio", + "8k_en": "8k_en - English telephone audio", + "16k_zh": "16k_zh - Chinese", "16k_zh-PY": "16k_zh-PY - Chinese, English, and Cantonese", + "16k_zh_medical": "16k_zh_medical - Medical Chinese", "16k_en": "16k_en - English", "16k_yue": "16k_yue - Cantonese", + "16k_ja": "16k_ja - Japanese", + "16k_ko": "16k_ko - Korean", + "16k_vi": "16k_vi - Vietnamese", + "16k_ms": "16k_ms - Malay", + "16k_id": "16k_id - Indonesian", + "16k_fil": "16k_fil - Filipino", + "16k_th": "16k_th - Thai", + "16k_pt": "16k_pt - Portuguese", + "16k_tr": "16k_tr - Turkish", + "16k_ar": "16k_ar - Arabic", + "16k_es": "16k_es - Spanish", + "16k_hi": "16k_hi - Hindi", + "16k_fr": "16k_fr - French", + "16k_de": "16k_de - German", "16k_zh_dialect": "16k_zh_dialect - Chinese dialects" } } diff --git a/custom_components/tencentcloud_asr/translations/zh-Hans.json b/custom_components/tencentcloud_asr/translations/zh-Hans.json index 1e86d46..b4aa048 100644 --- a/custom_components/tencentcloud_asr/translations/zh-Hans.json +++ b/custom_components/tencentcloud_asr/translations/zh-Hans.json @@ -25,10 +25,27 @@ "selector": { "model_descriptions": { "options": { + "8k_zh": "8k_zh - 中文电话通用", + "8k_en": "8k_en - 英文电话通用", "16k_zh": "16k_zh - 中文通用", "16k_zh-PY": "16k_zh-PY - 中英粤", + "16k_zh_medical": "16k_zh_medical - 中文医疗", "16k_en": "16k_en - 英语", "16k_yue": "16k_yue - 粤语", + "16k_ja": "16k_ja - 日语", + "16k_ko": "16k_ko - 韩语", + "16k_vi": "16k_vi - 越南语", + "16k_ms": "16k_ms - 马来语", + "16k_id": "16k_id - 印度尼西亚语", + "16k_fil": "16k_fil - 菲律宾语", + "16k_th": "16k_th - 泰语", + "16k_pt": "16k_pt - 葡萄牙语", + "16k_tr": "16k_tr - 土耳其语", + "16k_ar": "16k_ar - 阿拉伯语", + "16k_es": "16k_es - 西班牙语", + "16k_hi": "16k_hi - 印地语", + "16k_fr": "16k_fr - 法语", + "16k_de": "16k_de - 德语", "16k_zh_dialect": "16k_zh_dialect - 中文多方言" } }