0

我有一个简短的 bash 脚本,旨在将充满 .mp3 文件的文件夹转换为 .m4r 铃声。我无法弄清楚为什么它会引发以下错误:

“错误:ExtAudioFileCreateWithURL 失败('fmt?')”

#!/bin/bash

cd "/path/to/directory/containing/mp3s"

for i in *.mp3; do
    baseFilename=$( basename ${i} .mp3 )
    afconvert -f m4af ${i} -o "/path/to/new/location/${baseFilename}.m4r"
done

exit 0
4

1 回答 1

0

问题是我没有指定输出数据格式。找到一个有用的页面,引导我找到答案:

http://support.moonpoint.com/os/os-x/audio/afconvert.php

    #!/bin/bash

cd "/path/to/directory/containing/mp3s"

for i in *.mp3; do
    baseFilename=$( basename "${i}" .mp3 )
    afconvert -f m4af "${i}" -d aac "/path/to/new/location/${baseFilename}.m4r"
done

exit 0
于 2021-09-07T10:14:43.630 回答