Mac 音频转格式

简单转换

afconvert -f caff -d aacf m_04.wav

-f 格式 转成caff
-d 数据格式aacf
m_04.wav 文件名

afconvert -hf

查看支持的格式

Audio file and data formats:
    '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'
                             'qec3' 'zec3'
    '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' 'ilbc' 'ima4' I8 BEI16 BEI24 BEI32
                             BEF32 BEF64 LEI16 LEI24 LEI32 LEF32 LEF64
                             'ms\x00\x02' 'ms\x00\x11' 'ms\x001' 'paac'
                             'pac3' 'pec3' 'qaac' 'qac3' 'qach' 'qacp'
                             'qec3' 'samr' 'ulaw' 'zaac' 'zac3' 'zach'
                             'zacp' 'zec3'
    'ec-3' = EC3 (.ec3)
               data_formats: 'ec-3'
    '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' 'qec3' 'zec3'
    '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'

指定码率

afconvert -f caff -d aac -b 32000 m_09.wav

批量转换

find . -name '*.wav' -exec afconvert -f caff -d aac -b 32000 {} \;

find . -name '*.wav' 查找当前文件夹格式为wav的文件
-exec Command 必须以; 结尾 {}表示找到的文件,; 对;转义

find . -name '*.caf' -exec rm -f {} \;

查找并删除刚转换生成的文件

你可能感兴趣的:(Mac 音频转格式)