So how about some real music? A fair question would be: Why on Earth would you need scripting if you have the iTunes browser, which is such an excellent interactive tool? Apparently there are some reasons for scripting iTunes. Take a look at Doug's Applescripts for iTunes. There are 419 scripts, organized in 17 or so categories: Managing Tracks, Managing Track Info, Managing Artwork, Managing Playlists, Controlling iTunes, Exporting Info, Managing Files, Networking, Internet, iPod .. - to name the few.
Application iTunes is obviously scriptable. It is also well designed, well described, and most of its functionality is model-based, rather than view-based, which means that it is easy to use. But iTunes is not the only game in town. If you need something five times smaller than iTunes, and which also runs on background you might consider Play Sound by Microcosm Software. The author of Play Sound claims that
Play Sound is a simple, no-fuss sound player for Mac OS X. It supports QuickTime sound files (for example, AIFF or MP3 files), Classic Mac OS System 7 sound files (files with a file type of 'sfil' that contain 'snd ' resources), or any 'snd ' resources embedded into any file. You can play an unlimited number of sounds concurrently or one at a time. You can loop sounds, repeat sounds, play specified portions of sounds, control the volume of sounds played, pause and continue sound play, and press the Escape or Command-Period keys to abort sound play.

This excerpt from possibly much larger library of music wrappers demonstrates how to control music from Scheme-OSA: how to play a single sound file, how to play a list of sound files, how to choose a bunch of files interactively and then play them, and how to stop playing them.
Sorry that I cannot demonstrate it in real time from this blog, but believe me - it works!
No comments:
Post a Comment