CatCoding

让 Obsidian 朗读你的文字

2022-07-28

让写作更好的一个简单粗暴的办法是成为自己的读者,不断重读自己的文字,不断地去修改。

这不止是让文字变得更易读,也是一个和自己对话的过程,Paul Graham 在Putting Ideas into Words中写道:

The real test is reading what you’ve written. You have to pretend to be a neutral reader who knows nothing of what’s in your head, only what you wrote. When he reads what you wrote, does it seem correct? Does it seem complete? If you make an effort, you can read your writing as if you were a complete stranger, and when you do the news is usually bad. It takes me many cycles before I can get an essay past the stranger.

我习惯使用微信读书的 AI 语音来听书,后来我发现微信读书还能订阅公众号,所以尝鲜用 AI 语音来朗读自己写的文章,感觉很神奇,像是请了一个旁人来朗读。

我们通常写了文章之后会自己在心里默读,但一个真实的声音读出来会更容易发现问题:

  • You will find your voice.
  • You will find mistakes and unnecessary words and sentences.
  • You will make your writing easy for reading.

所以,我前段时间写了个 Obsidian 插件来实现朗读功能,代码在这里obsidian-speech

写完之后我想提交到官方插件市场,这时才发现已经有人做了个同样功能的插件,然后就不想提交了。但我还是喜欢自己的实现,因为里面有些小优化。

优化一,在阅读的过程中自动判断出英文段落,因为用中文语音去朗读英文会显得不够协调。

优化二,高亮当前朗读的段落,这样就能快速定位。

但 Obsidian 浏览器里的 AI 语音质量明显没有微信读书里的自然,支持的语音种类也少,微信读书应该是做了不少优化。

这个小插件还有不少可以继续细化的地方,比如自动跳过内嵌的代码部分,如果你感兴趣一起来完善吧。

公号同步更新,欢迎关注👻