I have an AIFF file with incorrect marker data.
How do I replace the markers section of the metadata with the correct text using terminal commands on macOS?
$ afinfo sample.aif
File: sample.aif
File type ID: AIFF
Num Tracks: 1
----
Data format: 1 ch, 44100 Hz, lpcm (0x0000000E) 24-bit big-endian signed integer
no channel layout.
estimated duration: 3.801927 sec
audio bytes: 502995
audio packets: 167665
bit rate: 1058400 bits per second
packet size upper bound: 3
maximum packet size: 3
audio data file offset: 4096
optimized
source bit depth: I24
1 markers; SMPTE time type 0 (none)
marker 1, "": frame 75576 SMPTE time 0:00:00:00/0 type 0 (....) channel 0
----
I need to replace the marker section at the bottom of that output with this:
4 markers; SMPTE time type 0 (none)
marker 1, "Start": frame 0 SMPTE time 0:00:00:00/0 type 0 (....) channel 0
marker 2, "End": frame 157819 SMPTE time 0:00:00:00/0 type 0 (....) channel 0
marker 3, "LoopStart": frame 75576 SMPTE time 0:00:00:00/0 type 0 (....) channel 0
marker 4, "LoopEnd": frame 103868 SMPTE time 0:00:00:00/0 type 0 (....) channel 0
----
ChatGPT gave me an answer for using afconvert
with the -M
option to add markers from a text file but it turns out afconvert
doesn’t actually have an -M
option.