News:

There is now a ChangeLog page on the wiki
New developments are added at the bottom of the page.

Main Menu

Learning Arabic with Voxcommando

Started by xtermin8r, March 20, 2013, 02:16:00 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

xtermin8r

السلام عليكم

Learning a new language.

A demo of Voxcommando and the Robobrowser plugin in action.

Software Used:
Voxcommando and the Robobrowser plugin
Frameless 1.0.1.1 Frameless is a borderless, captionless image viewer with commandline options for display placement. http://skwire.dcmembers.com/fp/?page=frameless




http://www.youtube.com/watch?v=ggAKUAsPwUA

[attachment=2]
Neural Net Based Artificial Intelligence.

nime5ter

Wow. Is she pronouncing the Arabic words correctly?
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

Excellent.  Would love to see the xml some time ;)

xtermin8r

Neural Net Based Artificial Intelligence.

xtermin8r

Quote from: jitterjames on March 20, 2013, 03:19:18 PM
Excellent.  Would love to see the xml some time ;)

i'll upload it soon as i have made a few changes.
Neural Net Based Artificial Intelligence.

Kalle

***********  get excited and make things  **********

xtermin8r

hi

below is the xml file for the Arabic Lesson 01 Demo.

webpage that robobrowser uses to collect the data  http://www.madinaharabic.com/Arabic_Language_Course/Lessons/L001_001.html

[attachment=1]
Neural Net Based Artificial Intelligence.

jitterjames

Wow.  Thanks for all the info.  Very cool that you can do all that with just two commands, and one extra command line utility.

I have actually been meaning to create an action which displays an image like that, but in the past I just used eventGhost for that.

rio14

السلام عليكم هل هناك شيء عن  اوقات الصلاة يشتغل مع فوكس كماندو شكرا

nime5ter

#9
@rio14 . Unfortunately, I don't think xtermin8r checks this forum much.

Yes, there are probably a variety of ways to get VC to announce prayer times.

The website http://praytimes.org/ provides code in various programming languages to calculate prayer times depending on your location, including in Python. I was able to use their code without any problems using VC's Python plugin.

The only thing I added to their script is an extra function that generates scheduled events in VoxCommando, and also displays an OSD with all the prayer times for that day.

The scheduled events occur at the start of each of the following prayer times: 'Fajr', 'Sunrise', 'Dhuhr', 'Asr', 'Maghrib', and 'Isha'.

To use my example, the PY plugin must be enabled in VoxCommando. The python script, called prayerTimes.py, is attached. It should be placed in the PY subfolder of your VoxCommando folder.

I have made the following example of how you could use the Python script with VoxCommando.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.5-->
<commandGroup open="True" name="Call to prayer" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="315" name="load Python script" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecFile</cmdType>
      <params>
        <param>PY\prayerTimes.py</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>today</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>vc.loaded</event>
  </command>
  <command id="316" name="What are today's prayer times (edit the first action with your location info)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="myPrayTimes(lat,long,utc) --&gt; replace lat, long, utc with your location information. lat=your latittude, long = your longitude, utc = your time zone's offset from GMT. (e.g., in winter, Montreal, NYC, &amp; Washington, D.C. are -5 from GMT, so UTC will be -5)">
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>myPrayTimes(45,-75,-5)</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.StopEventTimer</cmdType>
      <params>
        <param>today</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <params>
        <param>12:30 AM</param>
        <param>today</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>What are today's prayer times</phrase>
    <event>today</event>
  </command>
  <command id="317" name="Announce time for prayers" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>It's time for prayer: {1} begins at {2}.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>It's time for prayer: {1} begins at {2}.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Sound.PlayWav</cmdType>
      <params>
        <param>If appropriate, you could add an audio file such as a call to prayer wav.</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <action>
      <cmdType>SMTP.Send</cmdType>
      <params>
        <param>youremail@yourmail.com</param>
        <param>Time for prayer: {1} at {2}</param>
        <param>Time for prayer: {1} at {2}</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <event>praytime.*</event>
  </command>
</commandGroup>


Note: In the command, "What are today's prayer times," you will need to replace the location information with your own. As an example, I have shown my Canadian information (roughly).

myPrayTimes(45,-75,-5)

That is my information for myPrayTimes(lat,long,utc)

It will need to be replaced with your latitude, longitude, and time zone offset from GMT. (That will need to be manually edited when there are bi-annual timeshifts, in my case, from -5 to -4 during Daylight Saving Time).

So someone in Miami, FL, for example, would need to change that to something like:
myPrayTimes(26,-80,-5)

... That's a lot of information, sorry. :) I hope it makes sense and is of use to you. I'm happy to answer any questions or try to help resolve any problems with my example.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

Another option would be to use the REST-based API posted at http://xhanch.com/xhanch-api-islamic-get-prayer-time/

That requires Internet access, of course, but for some users may be a simpler option.

As an example, the following URL will retrieve daily prayer times for all of February 2016 for Washington, D.C., in xml format.

http://api.xhanch.com/islamic-get-prayer-time.php?lng=-77&lat=39&yy=2016&mm=2&gmt=-5&m=xml
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

rio14

hi
please according to prayer times there is some thing to fix, when i start vc the first time and i excute the commande, time does not work and i see error in plugin py prayer times.py the error is
Line: 1 >> myPrayTimes(45,-73,-5)
NameError: name 'myPrayTimes' is not defined

the commande to work good i must go to plugin and file prayer times.py and i do  excute, so now commande can work fine, if i do full restart and execute commande, does not works,  i have to execute the prayer times to get it working is it narmal!! thank you 

nime5ter

#12
Hi,

I have just tested what I posted above, and the script is loading correctly for me.

I would need to see a VoxCommando log to know what is not working. Is it possible the python file is not located in VoxCommando's PY folder?

The command that first loads the script expects the file to be in the PY subfolder, within your main VoxCommando folder.

PY\prayerTimes.py

TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

rio14

hi
the file is in the right place.thank you

nime5ter

#14
The log doesn't show me what I need to see, unfortunately. I need to see what happens when VC first starts up and all the commands are loaded.

It looks like maybe you enabled logging after VC was already running. (Unless the log file I am looking at was edited?)

It is the 'VC.Loaded' event that should trigger the command "load Python script," which executes the Python script. That occurs when VC first launches and finishes loading command groups.

Can you please enable logging, then re-start VC, let it run for a few minutes, and then post that log file?  Thanks.



TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)