fiddle2 entry

< previous [home] next >

Date: 2008-07-19 22:21:41 (Author: trav)
Link: http://travis.kroh.net/archives/005052.php

Recently, I wanted to play a short .aiff file as a little alarm every 15 minutes. On the Mac, however, there isn't a built-in analog to the play command that ships with most Linux distros. I did a quick search and came up mostly empty, except for a little app called PlayBufferedSoundFile written by Kurt Revis, an apple engineer, intended as a code example for using CoreAudio. Unfortunately, the API has changed such that the technique used in the code example is deprecated, and the code doesn't even compile anymore.

Fortunately, Kurt turned me on to a code example that's included with the new version of Xcode that does exactly this.

The dev tools come with sample code for a tool called "afplay" that can probably do what you want.
Open this in Xcode:
/Developer/Examples/CoreAudio/Services/AudioFileTools/AudioFileTools.xcodeproj
Build the "afplay" target and there you go.

"There you go" indeed. Thanks, Kurt.

 

[ home - archives - quoteboard - blogger decoder - wishlist ]

Creative Commons License This work is licensed under a Creative Commons License.