Making a Repeat Player

I want to use Keyboard Maestro to repeat my audio vocabularies. I want to control the number of repetition of play. For example, I have a playlist of 200 words. I want each audio file to be played 3 times and then plays 3 times the next audio file and so on…

How can I make that?

Thanks

Here's an example macro of going about that. This macro assumes that you're using audio files directly, as opposed to something like iTunes; if this is incorrect, and/or you're not sure how to modify the macro to better suit your needs, feel free to ask any further questions you may have (though please be specific as to how the files are stored/managed and what app you would like to use to play them).

Play Audio Files Repeatedly.kmmacros (7.3 KB)

1 Like

An alternative to using an app like QuickTime player is the built-in afplay command, which is available to Shell Script actions.

You may also want to fine-tune any pauses, both between repetitions of the same word, and perhaps before a new word starts:

Finally if the phone rings, you may want to interrupt the whole thing, so a Stop Current Macro keystroke could be helpful.

Play all sound files in Folder using built-in afplay.kmmacros (21.1 KB)

2 Likes

Thanks for the great suggestions, @ComplexPoint! I rarely go traipsing into the shell, so I had no idea a command like afplay even existed. The only thing I can think of that would make your macro idea even better would be to add a notification showing the name of the currently playing audio file, since afplay obviously has no GUI or visual feedback, and that’s very easy to add. Thanks again; this is definitely the kind of macro I’ll use if I ever have a need for this kind of repeated playback of multiple files myself :smile:

1 Like

WOW, OMG! Thank you guys so much! I appreciate your time you guys spent making, explaining, and finally adding the macro files. So amazing, specially the second macro is so thoughtful. I wish I asked my question 3 years ago. :joy:

Thanks again gglick and ComplexPoint.
:slight_smile:

2 Likes
~ $ afplay -h

    Audio File Play
    Version: 2.0
    Copyright 2003-2013, Apple Inc. All Rights Reserved.
    Specify -h (-help) for command options

Usage:
       afplay [option...] audio_file

Options: (may appear before or after arguments)
  {-v | --volume} VOLUME
    set the volume for playback of the file
  {-h | --help}
    print help
  { --leaks}
    run leaks analysis
  {-t | --time} TIME
    play for TIME seconds
  {-r | --rate} RATE
    play at playback rate
  {-q | --rQuality} QUALITY
    set the quality used for rate-scaled playback (default is 0 - low quality, 1 - high quality)
  {-d | --debug}
    debug print output
1 Like

Awesome. Added to my scripting notes :+1: