Comments (7)
有个相对容易的做法,直接用espeak-ng作为音源,安装先espeak-ng
然后在.bashrc或.zshrc中添加以下函数:
wds() {
wd $*
espeak-ng "$*"
}
这样相当于对wd命令进行了装饰,如果需要发音,只需要用wds命令代替wd命令即可
from wudao-dict.
可以参考这个同学修改的wdd:
- 在usr下建立mp3目录
- 安装ffplay
#!/bin/bash
function playaudio(){
if [ -n $1 ];then
mp3=./usr/mp3/$1.mp3
if [ ! -f $mp3 ];then
file=`wget -qO- https://cn.bing.com/dict/search\?q\=$1 | grep -Eoi "(https://dictionary.blob.core.chinacloudapi.cn/media/audio/tom/.{0,50}mp3)" | grep -m 1 ".*"`
wget -O $mp3 $file > /dev/null 2>&1
fi
nohup ffplay -autoexit -nodisp -i -loglevel quiet $mp3 > /dev/null 2>&1
fi
}
playaudio $1 &
count=`ps -ef | grep "python3 WudaoServer.py" | grep -v "grep" | wc -l`
if [ $count == 0 ]; then
nohup python3 WudaoServer.py > ./usr/server.log 2>&1 &
git pull origin master > ./usr/pull.log 2>&1 &
fi
python3 WudaoCommand.py $*
from wudao-dict.
做个补充,usr文件夹指的是源代码中./wudao-dict/usr
;
ffplay
的安装方式是安装ffmpeg,sudo apt install ffmpeg
from wudao-dict.
command line dictionary(命令行词典)
找到一个可以发音的
from wudao-dict.
我也看到一些小伙伴的各种发音脚本,感谢大家提供的方案!发音需要额外装包,查询速度也会降低,所以主版本就不支持了,大家自己套个脚本就可以了~
from wudao-dict.
嗯嗯,一开始我想套入发音模块的,不过出现了好多bug,直到我看到wdd居然是Shell⊙ω⊙
from wudao-dict.
如果不喜欢wds,而是想继续使用wd作为命令。那么可以改为这样:
wd() {
/usr/bin/wd $*
espeak-ng "$*"
}
from wudao-dict.
Related Issues (20)
- Error: Traceback (most recent call last) HOT 3
- 是否可以增加近义词信息?
- BrokenPipeError: [Errno 32] Broken pipe HOT 1
- 作者还更嘛??? HOT 7
- 在屏幕低亮度的条件下,蓝色字体容易看不清 HOT 2
- 希望增加一个退出交互模式的命令 HOT 4
- 能否翻译长句? HOT 3
- console program name `wd` is used also by wandb
- Why not publish it to pypi? HOT 1
- [feature] Can it translate sentence? HOT 1
- 可否添加离线查找功能 HOT 1
- 安装遇到权限问题
- 请问有遇到ImportError: No module named 'typing'的问题名 HOT 2
- 能在win10下使用么? HOT 2
- 请问可以添加翻译句子的功能吗
- 能否支持 spaced repetition 的复习功能 ? HOT 1
- 经常会出现connection time out HOT 1
- windows上可以使用么? 在powershell里。 HOT 2
- 两个需求,不知道作者能否实现一下? HOT 1
- OSError: [Errno 22] Invalid argument
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wudao-dict.