Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Examples of scripts with Operator query panel and SIP-terminal  Example of a script with Videogate Next page


Formats

Operator format to describe actions with the Audio player:

DoReact("PLAYER","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Microphone:

OnEvent("OLXA_LINE ", "_id_","_event_")

Operator format to describe actions with the Microphone:

DoReact("OLXA_LINE ","_id_","_command_" [,"_parameters_"]);

Function to check the state of the Microphone object:

CheckState("OLXA_LINE","number","state")

Examples

Examples of using events and reactions of the Audio player object:

  1. Playback the audio file when the camera stops recording:

    OnEvent("CAM",N,"REC_STOP")
    {
        DoReact("PLAYER","1","PLAY_WAV","file<C:\Program Files (x86)\Axxon PSIM\Wav\cam_alarm_"+N+".wav>,from_macro<1>");
    }
  2. Stop playing back the audio file when the camera starts recording:

    OnEvent("CAM",N,"REC")
    {
    	DoReact("PLAYER","1","STOP_WAV");
    }
  3. Playback the audio file from the occurrence of an event to the occurrence of another event (in this example, it is the start of macros).
    Audio file must last no longer than the number of seconds specified in the Wait statement.
    OnEvent("MACRO","1","RUN")
     
    {
        flag=1;
        [
        for(i=1;flag;i=1)
        {
            DoReact("PLAYER","1","PLAY_WAV","file<C:\Program Files\Axxon PSIM\Wav\cam_alarm_1.wav>");
            Wait(3);
        }
        ]
    }
     
    OnEvent("MACRO","8","RUN")
    {
        flag=0;
    }

Examples of using events and reactions of the Microphone object:

  1. Turn on the first microphone when the sound activated recording is enabled.

    OnEvent("OLXA_LINE","1","accu_start") //enable sound activated recording
    {
        DoReact("OLXA_LINE","1","ARM"); //enable record from microphone
    }
  2. Set minimum compression on microphone when disabling record of audio signal.

    OnEvent("OLXA_LINE","1","DISARM") // disable record from microphone
    {
        DoReact("OLXA_LINE","1","SETUP","compression<5>"); //minimum compression is set up
    }
    
  3. The audio from the microphone (OLXA_LINE) isn’t recorded synchronously with the camera. By default, the microphone isn’t armed. It is necessary to record audio both on sound activation and on camera detection. When sound activated recording (ACCU_START) and motion detection start, forced audio recording is enabled, and the flag variable is incremented by one. At the end of sound activated recording and motion detection, the flag variable is decremented by one, and audio recording stops only if it is equal to zero, it means, there is neither sound activation nor motion.
    OnInit()
    {
        flag=0;
    }
     
    OnEvent("CAM","3","MD_START")
    {
        flag=str(flag+1);
        DoReact("OLXA_LINE","1","RECORD_START");
    }
     
    OnEvent("OLXA_LINE","1","ACCU_START")
    {
        flag=str(flag+1);
        DoReact("OLXA_LINE","1","RECORD_START");
    }
     
    OnEvent("OLXA_LINE","1","ACCU_STOP")
    {
        flag=str(flag-1);
        if (!(flag))
        {
            DoReact("OLXA_LINE","1","RECORD_STOP");
        }
    }
     
    OnEvent("CAM","3","MD_STOP")
    {
        flag=str(flag-1);
        if (!(flag))
        {
            DoReact("OLXA_LINE","1","RECORD_STOP");
        }
    }
  • No labels