MauW4r3 / anymemo

Automatically exported from code.google.com/p/anymemo
GNU General Public License v2.0
0 stars 1 forks source link

about audio directory #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
我有一个词库的example.txt(example.db)文件的QA部分是这样引用它�
��音频文件的:
Q: vulg: (gesture of the middle finger directed upwards)<BGSOUND 
SRC="file:///d:/media/slang/elements/1/4/29/10492.wav" LOOP=True>
A: Up yours!<BGSOUND SRC="file:///d:/media/slang/elements/1/4/29/10493.wav" 
LOOP=True>

Q: vulg: Who do you think you are?<BGSOUND 
SRC="file:///d:/media/slang/elements/4/3/17/37076.wav" LOOP=True>
A: Who the hell/fuck you think you are?<BGSOUND 
SRC="file:///d:/media/slang/elements/4/3/17/37077.wav" LOOP=True>

as you can see,
Q,A都会引用在同一个大目录/elements下的不同的子文件夹,如/1
,/2,甚至子文件夹下还有文件夹,最后才找到这个音频文件��
�

我试着在/voice下建立一个example.db的文件夹,然后把/elements下�
��内容全都放到exmaple.db目录下,但是it doesn't work。
能不能让anymemo支持这种音频文件放置的方式呢?

或者,应该怎样修改一下QA的路径信息呢?

Original issue reported on code.google.com by Joshuap...@gmail.com on 3 Apr 2012 at 4:57

GoogleCodeExporter commented 8 years ago
最简单的方法是批量改名。
改成
4-3-17-37077.wav

如果你会任何脚本,可以很方便写出来。
大概这样写:
for f in "./*/*/*.wav"; do new_name==$(echo $f|sed -rn 
's/([0-9]+)\/([0-9]+)\/([0-9]+)/\1-\2-\3/p'); mv "$f" "$new_name"

然后再对文本文件处理,用sed
sed -i 
"s/file:\/\/\/d:\/media\/slang\/elements\/([0-9]+)\/([0-9]+)\/([0-9])+\/([0-9]+.
wav)/\1-\2-\3/g" example.txt

大概就可以了。

Original comment by mrlhwlib...@gmail.com on 9 Apr 2012 at 3:06

GoogleCodeExporter commented 8 years ago

Original comment by mrlhwlib...@gmail.com on 9 Apr 2012 at 4:52

GoogleCodeExporter commented 8 years ago

Original comment by mrlhwlib...@gmail.com on 23 Apr 2012 at 3:41