Tag Archives: play

Playing sound on the Mac Desktop in Objective C.

By | March 11, 2011

There are different ways for playing sound on the Mac in Objective C. Let’s look at some of the methods.. 1. Play by filename. NSSound *mySound = [NSSound soundNamed:@”sound”]; if you have no file named “sound” in your application’s main bundle, then it will return nil. 2. Play by pathName sound = [[NSSound alloc] initWithContentsOfFile:@”/Volumes/Audio/sound.aiff”… Read More »

ToolTip Sound in Adobe AIR/FLEX…

By | March 10, 2011

Sometimes we may need to have a sound when we hover over something, i.e when a tooltip appears. Actually this can be done easily by adding an eventListener to the corresponding control. Take a look at the example. This line is the important line. myLabel.addEventListener(ToolTipEvent.TOOL_TIP_SHOW, myListener); The function myListener gets called when we hover over… Read More »

Play all songs from your raw directory in ANDROID continuously.

By | February 10, 2011

In ANDROID all resource has a unique resource ID which we get by passing the song name to the function below playSong(). The function getAllResourceIDs() will convert this String which is the name of the song to the unique resource ID which can then be used to play the song. setOnCompletionListener() will be executed when… Read More »