provide installation instructions
[extjs.git] / air / src / Sound.js
1 /*\r
2  * Ext JS Library 0.30\r
3  * Copyright(c) 2006-2009, Ext JS, LLC.\r
4  * licensing@extjs.com\r
5  * \r
6  * http://extjs.com/license\r
7  */\r
8 \r
9 /**\r
10  * @class Ext.air.Sound\r
11  * \r
12  * @singleton\r
13  */\r
14 Ext.air.Sound = {\r
15         /**\r
16          * Play a sound.\r
17          * @param {String} file The file to be played. The path is resolved against applicationDirectory\r
18          * @param {Number} startAt (optional) A time in the sound file to skip to before playing \r
19          */\r
20         play : function(file, startAt){\r
21                 var soundFile = air.File.applicationDirectory.resolvePath(file);\r
22                 var sound = new air.Sound();\r
23                 sound.load(new air.URLRequest(soundFile.url));\r
24                 sound.play(startAt);\r
25         }\r
26 };\r