Media
Anki 将笔记中使用的声音和图像存储在集合旁边的文件夹中(collection.media)。有关文件夹位置的详细信息,请参阅文件位置部分。当你在 Anki 中添加媒体资源时,无论是使用编辑器中的回形针图标还是将其粘贴到字段中,Anki 都会将其从原始位置复制到媒体文件夹中。这样可以方便地备份集合的媒体资源或将其移动到另一台计算机。
Anki stores the sounds and images used in your notes in a folder next to the collection. For more on the folder location, please see the file locations section. When you add media within Anki, either by using the paperclip icon in the editor or by pasting it into a field, Anki will copy it from its original location into the media folder. This makes it easy to back up your collection’s media or move it to another computer.
如果媒体文件名包含空格或其他特殊字符(如百分号),则文件名在 HTML 编辑器中的显示方式将与文件名在磁盘上的显示方式不同。例如,一个名为 hello100%.jpg
的文件将在 HTML 编辑器中显示为 hello%2010%25.jpg
。在内部,Anki 仍然使用原始文件名,因此,如果你想搜索文件或使用“查找和替换”修改文件名,则需要使用磁盘上显示的名称,而不是 HTML 编辑器中显示的名称。导出到文本文件是查看原本模样的另一种方式。
If your media filenames contain spaces or other special characters such as percentage signs, the way the filenames appear in the HTML editor will differ from the way the filenames appear on disk. For example, a file called hello 100%.jpg will appear as hello%20100%25.jpg in the HTML editor. Internally, Anki still uses the original filenames, so if you would like to search for the file or modify the filename with Find&Replace, you will need to use the name as it appears on disk, not as it appears in the HTML editor. Exporting to a text file is another way to see the underlying representation.
检查媒体
Checking Media
你可以使用“工具”>“检查媒体”菜单选项扫描笔记和媒体资源文件夹。它将生成媒体资源文件夹中未被任何笔记使用的文件以及笔记中引用媒体资源但媒体资源文件夹中缺少的媒体资源的报告。它还允许你:
You can use the Tools>Check Media menu option to scan your notes and media folder. It will generate a report of files in the media folder that are not used by any notes, and media referenced in notes but missing from your media folder. It also allows you:
- 删除未使用的媒体文件。
To delete unused media files.
- 标记引用丢失媒体文件的笔记。
To tag notes that refer to missing media files.
- 清空你的垃圾文件夹。
To empty your trash folder.
- 将删除的文件还原回你的媒体文件夹。
To restore the deleted files back to your media folder.
此工具不扫描问答模板,这就是为什么你不能将媒体资源引用放置到模板中的字段。如果每张卡上都需要一个静态图像或声音,请用前导_
(例如,_dog.jpg
)命名,以告诉 Anki 在检查媒体资源时忽略它。如果你使用“未使用的媒体检查”删除媒体资源,Anki 会将其移动到操作系统的垃圾文件夹中,这样,如果你意外删除了不应该删除的媒体资源,你就可以恢复。
This tool does not scan question or answer templates, which is why you can’t place media references to fields in the template. If you need a static image or sound on every card, name it with a leading
_
(e.g.,_dog.jpg
) to tell Anki to ignore it when checking for media. If you delete media using the unused media check, Anki will move it into your operating system’s trash folder, so you can recover if you accidentally delete media that shouldn’t have been deleted.
手动添加媒体
Manually Adding Media
当你通过 Anki 的界面添加媒体文件时,Anki 会注意确保文件名的编码方式应适用于不同的设备,删除在某些操作系统上不起作用的字符,并截断很长的文件名。
When you add media via Anki's interface, Anki takes care of ensuring the filenames are encoded in a way that should work across different devices, removing characters that won't work on certain operating systems, and truncating very long filenames.
如果手动将文件添加到媒体文件夹,则应在之后使用“工具”>“检查媒体”,以确保文件名编码正确。如果跳过此步骤,同步时将跳过任何不兼容的文件名。
If you manually add files to your media folder, you should use Tools>Check Media afterwards, to ensure the filenames are encoded correctly. If you skip this step, any filenames that are not compatible will be skipped when syncing.
支持格式
Supported Formats
Anki 使用一个名为 mpv 的程序(mplayer 作为后备)来支持声音和视频。支持各种各样的文件格式,但并非所有这些格式都适用于 AnkiWeb 和移动客户端。MP3 音频和 MP4 视频似乎是最普遍支持的。
Anki uses a program called mpv (and mplayer as a fallback) in order to support sounds and videos. A wide variety of file formats are supported, but not all of these formats will work on AnkiWeb and the mobile clients. MP3 audio and MP4 video seems to be the most universally supported.