WMAudio Overview

The WMAudio commands allow you to play and control audio clips. Besides being able to control the volume and speed of the audio, you can also seek to any position, play and pause the clip. WMAudio can also send event notifications so that you can monitor, and respond to, events such as the end of a audio, the "playhead" reaching a certain time index, or even when an audio clip contains an embedded script to be run.

To make use of these commands, it is necessary for the client machine to have Windows Media Player 6 (WMP6) or newer installed, and that the necessary codec also be installed. The WMAudio object can only play one piece of media at a time.

Playing an audio clip is as simple as specifying which resource to load, and then telling it to play.

ssCore.WMAudio.setResource({resource:"c:\\MyAudioClip.wav"});
ssCore.WMAudio.play();

By default, the WMAudio commands will attempt to create a WMP6 player. If this fails, SWF Studio will automatically try to create a WMP9 player (which in reality is compatible with WMP 7, 8, 9, and 10). If you have special requirements and do not wish to let SWF Studio choose the player version for you, then you can specify to exclusively use either the version 6 or version 9 player. For example:

ssCore.WMAudio.setVersion({version:"9"}); // WMP 7,8,9,10

This selection only needs to be done once, and must be the first WMAudio command in your application.