package leigh.audio.bpm;

import leigh.mecha.log.MechaLogger;
import leigh.mecha.log.MechaLoggerFactory;
import leigh.mecha.smpte.Timecode;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

/**
 * A tool for using beat analysis to determine beat events in an audio stream. The beat events are output as
 * SMPTE offsets.
 * <p>
 * The tool is to be used with 16-bit uncompressed mono WAV files.
 *
 * @author Alex Leigh
 */
public class BeatDetectTool {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(BeatDetectTool.class);

    public static void main(String[] args) throws IOException, WavFileException {
        ArrayList<Timecode> beats = MinimBeatDetector.detect(new File(args[0]));
        logger.info("Detected beats: {}", beats);
    }
}
