19
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【OSX】afconvert【音声ファイル変換】

Last updated at Posted at 2017-04-10

OSXには音声ファイルを変換するafconvertというコマンドラインツールが標準装備されている。ファイルの情報を表示するafinfoと、音声ファイルを再生するafplayというコマンドもちょろっと紹介。

ヘルプとフォーマットを表示 

afconvert -hf

afconvert -hf
Audio file and data formats:
    '3gpp' = 3GP Audio (.3gp)
               data_formats: 'Qclp' 'aac ' 'aace' 'aacf' 'aach' 'aacl'
                             'aacp' 'samr'
    '3gp2' = 3GPP-2 Audio (.3g2)
               data_formats: 'Qclp' 'aac ' 'aace' 'aacf' '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' 'aach' 'aacl' 'aacp'
                             'ac-3' 'alac' 'ec-3' 'paac' 'pac3' 'qec3'
                             'zec3'
    'm4bf' = Apple MPEG-4 AudioBooks (.m4b)
               data_formats: 'aac ' 'aace' 'aacf' 'aach' 'aacl' 'aacp'
                             'paac'
    'caff' = CAF (.caf)
               data_formats: '.mp1' '.mp2' '.mp3' 'QDM2' 'QDMC' 'Qclp'
                             'Qclq' 'aac ' 'aace' 'aacf' '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' '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 [出力フォーマット] -d [入力のbitdepth] 入力ファイル 出力ファイル

Ex. ビッグエンディアン16ビットのファイル(bei16input.m4a)をaiff(output.aiff)に変換

afconvert -f AIFF -d BEI16 bei16input.m4a output.aiff

※ 解像度は afinfo で確認できる

afinfo bei16input.m4a

afplayでコマンドラインからの再生が可能

afplay output.aiff
19
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?