audio API structure

Following listing presents audio API is built.

// and are copies (full or partial) of UPlayeNext module:
var;//new player next instance
Global.PlayerNext1.addProto(Interface);//object GlobalPlayNext1 inherits Interface prototype
//the above step in required before adding object to robot structure as a device"player", Global.PlayerNext1);//instance of UPlayerNext is added to as player (whole module is copied to structure)
//in case of we copy only one slot and prepare our own interface to functions
var;"recorder");//we create new element of structure - now we can use (but it is empty)
PlayerNext2.getSlot("inputDevices").copy(,"inputDevices");//we copy only one slot from PlayerNext2 object to
//we want to have different function names than in module, so we define new functions in structure, which are simply calling the ones from PlayerNext2 object
function SetRecordLevel(input,level) { call.PlayerNext2.SetRecordLevel(input,level); };
function Start(input_device,filename) { call.PlayerNext2.StartRecord(input_device,filename); };
function Stop() { call.PlayerNext2.StopRecord(); };



EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.9.2, 23.11.2017

FLASH Documentation