Comments (18)
Thank you so much, it worked!
For Mac users the file localisation is ~/Library/Application Support/Anki2 folder. It is a hidden folder so you will need to option-click on the "go" menu in finder. Click on library and locate the Application Support folder. In there you will find the Anki2 folder.
from chinese-support-redux.
ok, i've found a solution to make audio working, it's because Google Tlanslate gTTS (library) is block when use CN URL, i just replace .cn by .com (or .fr) and it's work !
from chinese-support-redux.
Changing to .com worked for me. Note though that you need to remove the old (corrupt) files! And then of course regenerate the new ones.
The procedure is thus as follows (some tips below; read everything before doing it):
- Quit Anki.
- In the collection.media folder [1], copy the names of all files of 0 bytes (= the corrupt files) and save them somewhere. [2]
- Then, remove all files of 0 bytes.
- In tts.py [1], replace
cn
withcom
on line 56. - Restart Anki.
- Search for all notes referring to the old, corrupt files, and remove the reference to the old file. [2]
- Regenerate the files, using the menu item "Chinese > Bulk Fill > Sound" in Anki.
[1] You can find these folders at:
for macOS:
- the collection.media folder at /Users/USERNAME/Library/Application Support/Anki2/PROFILE_NAME/collection.media
- the tts.py file at /Users/USERNAME/Library/Application Support/Anki2/addons21/1128979221
for Windows:
- the collection.media folder at C:\Users\USER_NAME\AppData\Roaming\Anki2\PROFILE_NAME\collection.media\
- the tts.py file at C:\Users\USER_NAME\AppData\Roaming\Anki2\addons21\1128979221
[2] Here's a trick to do these steps easily using the command line on macOS.
Execute the following commands in the terminal:
cd "/Users/USERNAME/Library/Application Support/Anki2/PROFILE_NAME/collection.media"
find . -size 0 | sed 's/\.\///g' | tr '\n' '|' | sed -e 's/^/\\\[sound:\(/' -e 's/\|?$/\)\\\]/'
(The first command goes to the right folder. The second command searches the names all corrupt files, i.e. files with size 0 bytes, and then removes the ./
prefix, concatenates them into with |
, and adds a something in front and at the end.)
This should generate an output like
\[sound:(a.mp3|b.mp3|c.mp3)\]
Copy this.
For step 2, you can delete the files in the Finder by sorting by size and deleting the files with size 0 bytes.
For step 6, in Anki, go to the Browse window, and to the menu Notes > Find and Replace...
Paste the output from above in the "Find" box, and leave "Replace With" empty. Make sure to select "Treat as regular expression" and apply this replacement to all notes.
Note: on Linux, the same commands should work in the right folder.
I'd advise to make a back-up of your Anki profile before executing these commands :)
from chinese-support-redux.
I have the same issue.
- OS: WIndows 10
- Anki Version 2.1.49 (dc80804a), Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
- Chinese Support Redux v0142
from chinese-support-redux.
Switching from Baidu to Google, the MP3 is fine.
It seems the issue comes from Baidu's integration.
from chinese-support-redux.
Update on this issue.
As of now, neither Baidu or Google are working.
For Google, files are empty, for Baidu, the file is broken:
from chinese-support-redux.
hi
Me too I've recently this trouble !
How to do ?
from chinese-support-redux.
I have the same issue.
OS: MacOS monterey
Anki: Version 2.1.44 (b2b3275f)
from chinese-support-redux.
Thé trouble is due to an issue of gtts librairy used by the plugin
from chinese-support-redux.
Thank you frixo for the solution. Can you describe how to change the url from .cn to .com please?
I don’t know how to do it.
from chinese-support-redux.
you're on Mac, I'm on Windows. So the file localisation isn't the same. I suppose you will found a folder called Anki in your library (the library in your user folder (it's perhaps a hidden folder))
in Anki folder you've an AddOn Folder and then you will find the folder with the IF of ChineeseAddOn.
In this folder find the file names : tts.py, and go to line 56 , replace cn by com
it looks like that :
def get_google(self):
tts = gTTS(self.text, lang=self.lang, tld='com')
try:
On Windows the file is here : C:\Users\YOUR_USER_NAME\AppData\Roaming\Anki2\addons21\1128979221
from chinese-support-redux.
Still cannot get audio to play. I replaced my tts.py 'cn' to 'com' but still no luck. On MacOS Monterey 12.5.1. Neither Baidu or Google audio working.
When I go to ->Tools->Check Media
I get the following error:
Missing files: 1
Unused files: 0
The following files are referenced by cards, but were not found in the media folder:
Missing: 你好_google_zh-CN.mp3
But when I go to my /Users/proto455/Library/Application Support/Anki2/User 1/collection.media
I am able to find the file in question, however it will not play via VLC or any other application.
Sorry if fix is obvious, new here and really would love to get this working
from chinese-support-redux.
Hello !
Thank you for the help, I had the same problem but now it works thank to you. I use Google audio.
At first I changed the 'cn' to 'com' and it still didn't work. But then I changed it to 'fr' and now it works, thanks !
from chinese-support-redux.
from chinese-support-redux.
Hello - I was experiencing the same issue as the original poster after updating Anki to 2.1.54 Qt5 on Windows. For me, the advice on this thread allowed me to resolve the issue, but only when using Speech Engine "Google Mandarin (Taiwan)", not "Google Mandarin (PRC)" or "Baidu Translate". I just wanted to note that in case in helps anyone else.
Thank you all who helped find a work around for this issue!
from chinese-support-redux.
'cn'->'com' fix only works for new cards (as in new text). Initially I thought changing 'cn' to 'com' as above did not work because it didn't fix my broken cards. However it does work for NEW cards (which generate a new unique file name), but does NOT fix already broken ones. Even if you delete the text in your cards audio field, and have it re-generate the audio, the old corrupted file is still found will still be used - it doesn't actually generate a new audio file if it can find an old one.
So to fix old, already broken cards you must delete the old broken files. On windows they can be found here:
C:\Users<YOUR USER>\AppData\Roaming\Anki2<YOUR PROFILE>\collection.media\
(if, like me you had quite a few busted ones you can just sort by size and delete anything with a size of 0).
Once deleted the sounds can now be re-generated and this time they'll work.
from chinese-support-redux.
I recently moved to Taiwan and this is when I first noticed the problem, it wont work even if I delete all the 0 kbs files and change the cn to com, however I used a vpn to say I was in America and the files work now.
from chinese-support-redux.
I've followed the advice in this thread. Still cannot get the sound to work.
from chinese-support-redux.
Related Issues (20)
- Cantonese pinyin does not work HOT 3
- Option to reverse cards HOT 1
- Meaning field isn't populating HOT 5
- Crash every second time fields are automatically filled due to audio
- Ruby doesn't separate vowel followed by n- initial properly
- Silhouette field doesn't fill HOT 2
- (fully) Colorize and make ruby pinyin for phrases (long words) HOT 1
- Bopomofo loading not correct HOT 1
- Colouring doesn't work
- On Windows 11 Redux don't add the fields with a new Chinese word HOT 3
- Can't click 汉字 button
- About punctuation and symbols HOT 4
- addons21\1128979221\edit.py:86:model is deprecated: please use 'note_type'
- Not getting audio clips while trying to use Google Mandarin speech engine HOT 6
- Create Reverse Cards HOT 2
- Color field won't fill correctly in another note type HOT 2
- Support Pinyin tone numbers as well as accent marks HOT 2
- Clicking on 汉字 doesn't activate the pluggin HOT 2
- Mark this repository as archived and link to the new version: Chinese Support 3 HOT 1
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 chinese-support-redux.