afconvert -f caff -d 'aac' /Users/ruicong/Desktop/闹钟铃声/周深\ -\ 大鱼\ \(铃声afconvert -f caff -d 'aac' /Users/ruicong/Desktop/闹钟铃声/周深\ -\ 大鱼\ \(铃声\).mp3 /Users/ruicong/Desktop/未命名文件夹\ 3/周深\ -\ 大鱼\ \(铃声\).caf
转换成功无反应,但相应路径会自动生成.caf的音频文件
解析:
afconvert Apple 提供的一个音频格式转换工具,在下面介绍
-f caff -d 'aac' 转换参数,在下面介绍
/Users/user/Desktop/扫一扫铃声.mp3 待转换的mp3音频路径
/Users/user/Desktop/扫一扫铃声.caf 转换完成后生成的文件名和路径
下面我们来介绍afconvert命令
'3gpp' = 3GP Audio (.3gp)
data_formats: 'Qclp' 'aac ' 'aace' 'aacf' 'aacg' 'aach'
'aacl' 'aacp' 'samr'
'3gp2' = 3GPP-2 Audio (.3g2)
data_formats: 'Qclp' 'aac ' 'aace' 'aacf' 'aacg' 'aach'
'aacl' 'aacp' 'samr'
'adts' = AAC ADTS (.aac, .adts)
data_formats: 'aac ' 'aach' 'aacp'
'ac-3' = AC3 (.ac3)
data_formats: 'ac-3'
'AIFC' = AIFC (.aifc, .aiff, .aif)
data_formats: I8 BEI16 BEI24 BEI32 BEF32 BEF64 UI8 'ulaw'
'alaw' 'MAC3' 'MAC6' 'ima4' 'QDMC' 'QDM2'
'Qclp' 'agsm'
'AIFF' = AIFF (.aiff, .aif)
data_formats: I8 BEI16 BEI24 BEI32
'amrf' = AMR (.amr)
data_formats: 'samr' 'sawb'
'm4af' = Apple MPEG-4 Audio (.m4a, .m4r)
data_formats: 'aac ' 'aace' 'aacf' 'aacg' 'aach' 'aacl'
'aacp' 'ac-3' 'alac' 'ec-3' 'paac' 'pac3'
'pec3'
'm4bf' = Apple MPEG-4 AudioBooks (.m4b)
data_formats: 'aac ' 'aace' 'aacf' 'aacg' 'aach' 'aacl'
'aacp' 'paac'
'caff' = CAF (.caf)
data_formats: '.mp1' '.mp2' '.mp3' 'QDM2' 'QDMC' 'Qclp'
'Qclq' 'aac ' 'aace' 'aacf' 'aacg' 'aach'
'aacl' 'aacp' 'ac-3' 'alac' 'alaw' 'dvi8'
'ec-3' 'flac' 'ilbc' 'ima4' I8 BEI16 BEI24
BEI32 BEF32 BEF64 LEI16 LEI24 LEI32 LEF32
LEF64 'ms\x00\x02' 'ms\x00\x11' 'ms\x001'
'opus' 'paac' 'pac3' 'pec3' 'qaac' 'qac3'
'qach' 'qacp' 'qec3' 'samr' 'ulaw' 'zaac'
'zac3' 'zach' 'zacp' 'zec3'
'ec-3' = EC3 (.ec3)
data_formats: 'ec-3'
'flac' = FLAC (.flac)
data_formats: 'flac'
'MPG1' = MPEG Layer 1 (.mp1, .mpeg, .mpa)
data_formats: '.mp1'
'MPG2' = MPEG Layer 2 (.mp2, .mpeg, .mpa)
data_formats: '.mp2'
'MPG3' = MPEG Layer 3 (.mp3, .mpeg, .mpa)
data_formats: '.mp3'
'mp4f' = MPEG-4 Audio (.mp4)
data_formats: 'aac ' 'aace' 'aacf' 'aacg' 'aach' 'aacl'
'aacp' 'ac-3' 'ec-3'
'NeXT' = NeXT/Sun (.snd, .au)
data_formats: I8 BEI16 BEI24 BEI32 BEF32 BEF64 'ulaw'
'Sd2f' = Sound Designer II (.sd2)
data_formats: I8 BEI16 BEI24 BEI32
'WAVE' = WAVE (.wav)
data_formats: UI8 LEI16 LEI24 LEI32 LEF32 LEF64 'ulaw'
'alaw'
'RF64' = WAVE (.wav)
data_formats: UI8 LEI16 LEI24 LEI32 LEF32 LEF64 'ulaw'
'alaw'
如果你看不懂以上参数,没关系
我们只需要转换音频文件格式,其他的如比特率、音轨、采样速率等我们不需要关心,那么我们只要用到 -f 和 -d 两个参数即可。
-f 指的是 file format,也就是需要转换的目标格式;
-d 指的是 data format,是数据格式的意思,理解这些参数的含义需要一定的音乐知识背景
如:上面mp3转换为caf的代码参数
afconvert -f caff -d 'aac'
-d 'aac' 数据格式 aac为音频数据格式
-f caff需要转换的目标格式,查上面?的列表找mp3对应参数为caff
————————————————
原文链接:https://blog.csdn.net/JackJia2015/article/details/83376505
网友评论