关于css:Anki-mobie调用系统内置tts实现朗读-不需要插件ioswindows可用

6次阅读

共计 3161 个字符,预计需要花费 8 分钟才能阅读完成。

如何在苹果 anki 上调用零碎自带的 tts?
怎么让苹果的 anki(anki mobie)朗诵?

问题背景

anki 反对调用 tts 的,然而网络上无关常识流传的比拟少,缤纷火条同学作为一个热心肠,觉得很有任务给大家说到说道。本文次要以 ios 的 anki 为对象,不增加音频,间接朗诵!
成果也还不错,听起来比拟天然。

awesome 的 tts 尽管大家都在举荐,然而我实用后只能用有道实现我的目标,买个会员吧尽管说也不贵,然而感觉就不是很高兴,当初工夫缓和,不能折腾音频文件了,况且 ipad 录音后同步可能会呈现不出名的小问题,例如安卓设施莫名多了一个无奈删除的牌组(anki droid)(2021.8 月仍有)

集英俊与智慧于一身的缤纷火条,他经常会批改模版,而后经常应用 anki 的全同步,很消耗工夫,媒体文件大更是一个噩梦,于是他本着节俭空间的想法应用 ios 零碎自带的 tts 来解决问题

应用场景

例如
我下载了一份单词书,分为三个局部,
(广告位招租:)

* 单词
* 解释
* 助记

我让侧面读出 单词和助记忆
背面读出答案局部,实现带着我思考,缩小走神景象的产生,也能够歇歇眼睛,不用游走

该办法存在的有余

因为应用的办法是 {{tts zh_TW:question(字段的名称)}}
导致了,在安卓设施上不反对读出(官网不反对,截止到 21.9.8)
并且最让我不能忍耐的是,他会让我的页面呈现一个新的 反复的 字段

这必定不行,于是俺作为刚刚入门 css 的小白
思考了一下,一个好的方法就呈现了

给这个 tts 增加一个 css 管制,不让他显示

实现办法

在页面的第一行(侧面)

<div class=tts> {{tts zh_TW: 问题 iii}} {{tts zh_TW: 小标题}}</div>

css 增加上面的内容



.tts {     
font-size: 0px;
padding: 0em 0em 0em 0em;
text-indent: 0em;
border : 0px solid;
position : relative;
margin : 0px ;
# text-decoration: none;
}

.replay-button svg {
   width: 0px;
   height: 0px;
 }
 .replay-button svg circle {fill: blue;}
 .replay-button svg path {
   stroke: white;
   fill: green;
}

补充两句

——-
如果你想给你的小喇叭批改一下
你能够找到这些语句批改—-:


.replay-button svg {
   width: 0px;
   height: 0px;
 }
 .replay-button svg circle {fill: blue;}
 .replay-button svg path {
   stroke: white;
   fill: green;
}

至此,胜利实现朗诵性能,如果你须要他重读,只须要按下键盘的 R,就能够在 ios(ankimobie 下面重读)

20210912 补充:

如何更换一个语音包呢?

在你的非安卓设施能够在卡牌的侧面输出

{{tts-voices:}}

输出保留 预览,置信他会显示出很多的文字,咱们复制下来

随后复制一个

{{tts zh-CN voices=Apple_Li-mu:Front}}
{{tts zh-CN voices=Apple_田田:Front}}
{{tts zh-CN voices=Apple_语舒:Front}}
{{tts zh-HK voices=Apple_善怡:Front}}
{{tts zh-TW voices=Apple_美嘉:Front}}

例如我抉择:

{{tts zh-TW voices=Apple_美嘉(优化音质):Front}}

下面的 front 你能够批改成 你的字段的名称,例如:问题,答案等等

如何实现倍速播放呢?

你能够在冒号后面,加上 speed=0.7 达到加快语速的目标

于是你的 apple 设施能够失常播放了。

在安卓设施上发现 排版谬误咋办

如果你发现,妈呀,我的这个电脑 安卓播放的时候 咋这样啊,多了一个小喇叭不说,整个排版全乱了

我应用的办法是,在 css 外面建设一个空白,
而后用把小喇叭的大小设置为 0,而后把发音局部给放到 div 块外面


<div class=tts> {{tts en_US: 问题 iii}} 
{{tts zh-CN voices=Apple_Li-mu speed=1.25 : 小标题}}</div>

附件:
如果须要多语言朗诵,只读挖空等等内容,请浏览上面的


{{tts en_US:Front}}
On Windows, MacOS, and iOS, Anki will use the OS’s built in voices. On Linux, no voices are built in, but voices can be provided by add-ons, such as this one.
To see a list of all available languages/voices, place the following on your card template:
 {{tts-voices:}}
If there are multiple voices that support your chosen language, you can specify desired voices in a list, and Anki will choose the first available voice. For example:
 {{tts ja_JP voices=Apple_Otoya,Microsoft_Haruka:Field}}
This would use Otoya when on an Apple device, and Haruka when on a Windows PC. Specifying a different speed is possible in some TTS implementations:
 {{tts fr_FR speed=0.8:SomeField}}
Both speed and voices are optional, but the language must be included. On a Mac, you can customize the available voices:
Open the System Preferences screen.
Click on Accessibility.
Click on Speech.
Click on the system voice dropdown, and choose Customize.
Some voices sound better than others, so experiment to choose the one you prefer. Please note that the Siri voice can only be used by Apple apps. Once you’ve installed new voices, you’ll need to restart Anki for the new voices to become available.
On Windows, some voices like Cortana can not be selected, as Microsoft does not make those voices available to other applications.
On a cloze note type, you can make Anki read only the elided sections using the cloze-only filter, like so:
 {{tts en_US:cloze-only:Text}}
     The cloze-only filter is supported in Anki 2.1.29+ and AnkiMobile 2.0.65+.

如果,这片文章对你有帮忙,请给缤纷火条一点反对,
能够是关注他的微信公众号,给他一个关注,一个浏览
也能够去他的网易云音乐听听他的原创歌曲,找找看有没有你喜爱的
认准「缤纷火条」不迷路

正文完
 0