Author Topic: Arabic TTS and Al-Jazeera  (Read 10384 times)

0 Members and 1 Guest are viewing this topic.

rio14

  • Contributor
  • ***
  • Posts: 59
  • Karma: 4
    • View Profile
Re: Arabic TTS and Al-Jazeera
« Reply #30 on: May 16, 2016, 04:02:48 PM »
hi all
thanks to you james and nim5ter to arrive finally to acheve this arabic news i combined the option of the first and the second code with script posted by nim5ter, i fixed somes arabic words, the code is working 100%
all you need copy and paste the code
create py folder in VC folder and put alj-script.py in PY folder.
this is a link of arabic-tarik voice and other voices 30days trial versionhttp://www.kobaspeech.com/en/download-voices

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.7-->
<commandGroup open="False" name="Aljazeera news w/ python2" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1299" name="Aljazeera (payloads fixed)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PayloadXML.Clear</cmdType>
      <params>
        <param>payloads\Aljazeera.xml</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://www.aljazeera.net/aljazeerarss/9ff80bf7-97cf-47f2-8578-5a9df7842311/99e42274-a82e-4930-bbd5-ba2b24a88a22</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExSingle</cmdType>
      <params>
        <param>item.*?&lt;title&gt;&lt;.*?DATA.(.*?)\]</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PayloadXML.AddPair</cmdType>
      <params>
        <param>payloads\Aljazeera.xml</param>
        <param>{Match.{i}}</param>
        <param>{i}</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>max</param>
        <param>{#M}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PY.ExecFile</cmdType>
      <params>
        <param>PY\alj-script.py</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>alj_next5</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>News</event>
    <phrase>tell me the news</phrase>
  </command>
  <command id="505" name="Call Google.TTS" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="triggered by an event expecting 2 payloads&#xD;&#xA;{1} text to speech&#xD;&#xA;{2} language code">
    <action>
      <cmdType>RoboB.Select</cmdType>
      <params>
        <param>GoogleTranslate</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Navigate</cmdType>
      <params>
        <param>https://translate.google.com/#en/{2}/{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Google.TTS</event>
  </command>
  <command id="469" name="Google.TTS ready" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="triggered by an event expecting 2 payloads&#xD;&#xA;{1} text to speech&#xD;&#xA;{2} language code">
    <action>
      <cmdType>RoboB.Select</cmdType>
      <params>
        <param>GoogleTranslate</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.ElementByID</cmdType>
      <params>
        <param>gt-res-listen</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>RoboB.Click</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>RoboB.Hide</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>RoboB.Show</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>RoboB.DocComplete.GoogleTranslate</event>
  </command>
  <command id="205" name="Next 5 al jazeera headlines" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>myHeadlines({var.max})</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Next news</phrase>
    <phrase optional="true">please</phrase>
    <event>alj_next5</event>
  </command>
  <command id="188" name="Read Al Jazeera headline number {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>headlines</param>
        <param>..........هَذَه  الاخبَارُ  اللَتي  تَبْحَثُ  عَنْها..........</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PayloadXML.GetValue</cmdType>
      <params>
        <param>payloads\Aljazeera.xml</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>{1} لا يُوجَدُ عُنْوَانٌ بِهَذَا الَّرقْمْ</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Google.TTS</param>
            <param>{1} لا يُوجَدُ عُنْوَانٌ بِهَذَا الَّرقْمْ</param>
            <param>ar</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Google.TTS</param>
            <param>{var.headlines}...{LastResult}</param>
            <param>ar</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>..........هَذَه  الاخبَارُ  اللَتي  تَبْحَثُ  عَنْها..........</param>
            <param>8000</param>
            <param>-5</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.AddText</cmdType>
          <params>
            <param>{1}. {LastResult}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType />
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>tell me the news</phrase>
    <phrase>number</phrase>
    <payloadRange>1,55</payloadRange>
  </command>
  <command id="204" name="Read Al Jazeera headlines {1} through {2}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>headlines</param>
        <param>..........هَذَه  الاخبَارُ  اللتي  تَبْحَثُ  عَنْها..........</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PayloadXML.GetValue</cmdType>
      <params>
        <param>payloads\Aljazeera.xml</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="True">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Google.TTS</param>
            <param>{1} لا يُوجَدُ عُنْوَانٌ بِهَذَا الَّرقْمْ</param>
            <param>ar</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>{1} لا يُوجَدُ عُنْوَانٌ بِهَذَا الَّرقْمْ</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>..........هَذَه  الاخبَارُ  اللتي  تَبْحَثُ  عَنْها..........</param>
        <param>26000</param>
        <param>-5</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <loop>
      <loopParams>
        <from>{1}</from>
        <to>{2}</to>
      </loopParams>
      <loopActions>
        <action>
          <cmdType>PayloadXML.GetValue</cmdType>
          <params>
            <param>payloads\Aljazeera.xml</param>
            <param>{j}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.AddText</cmdType>
          <params>
            <param>{j}. {LastResult}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>headlines</param>
            <param>{var.headlines}...{LastResult}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </loopActions>
    </loop>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>Google.TTS</param>
        <param>{var.headllines}</param>
        <param>ar</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>Google.TTS</param>
        <param>{var.headlines}</param>
        <param>ar</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>read headlines</phrase>
    <payloadRange>1,55</payloadRange>
    <phrase>to</phrase>
    <payloadRange>1,55</payloadRange>
  </command>
</commandGroup>

thanks a lot

rio14

  • Contributor
  • ***
  • Posts: 59
  • Karma: 4
    • View Profile
Re: Arabic TTS and Al-Jazeera
« Reply #31 on: June 05, 2016, 10:54:43 PM »
Hi
this is pandora bot speak Arabic, and any language you want just change language code
and upgrade internet explorer to 11
 
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.6-->
<commandGroup open="True" name="pandora w/translation" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="776" name="pandora W/translation" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="10" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PandoraBot.866638556e37479a</cmdType>
      <params>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>question:   {1} ................... answer:  {LastResult}</param>
        <param>3000</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>google.tts</param>
        <param>{LastResult} </param>
        <param>ar</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.Pause</cmdType>
      <params>
        <param>2000</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>pandora</phrase>
    <payloadDictation>payloadDictation: Regular</payloadDictation>
  </command>
  <command id="488" name="Call Google.TTS" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="triggered by an event expecting 2 payloads&#xD;&#xA;{1} text to speech&#xD;&#xA;{2} language code">
    <action>
      <cmdType>RoboB.Select</cmdType>
      <params>
        <param>GoogleTranslate</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.Navigate</cmdType>
      <params>
        <param>https://translate.google.com/#en/{2}/{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Google.TTS</event>
  </command>
  <command id="446" name="Google.TTS ready" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="triggered by an event expecting 2 payloads&#xD;&#xA;{1} text to speech&#xD;&#xA;{2} language code">
    <action>
      <cmdType>RoboB.Select</cmdType>
      <params>
        <param>GoogleTranslate</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>RoboB.ElementByID</cmdType>
      <params>
        <param>gt-res-listen</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>RoboB.Click</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>RoboB.Hide</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>RoboB.Show</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>RoboB.DocComplete.GoogleTranslate</event>
  </command>
</commandGroup>

rio14

  • Contributor
  • ***
  • Posts: 59
  • Karma: 4
    • View Profile
Re: Arabic TTS and Al-Jazeera
« Reply #32 on: June 05, 2016, 11:08:07 PM »
tomorrow is the first of fasting month june 6 for muslums (ramadhan month)
this code give the age of the moon and the % of illumination for calculation
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.6-->
<commandGroup open="False" name="moon age ramadhan month" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="528" name="moon phase" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="25" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>WUnder.GetCustom</cmdType>
      <params>
        <param>age of the moon is {A.ageOfMoon},  and illumination is  {A.percentIlluminated}% </param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetLastResult</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
        <param>10000</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType />
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>google tell me age of the moon</phrase>
  </command>
</commandGroup>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Arabic TTS and Al-Jazeera
« Reply #33 on: June 06, 2016, 08:18:20 AM »
Thanks for posting. The Ramadan command looks like a great addition.

Did you mean to post that command in this topic thread? I think it would fit well with your prayer time commands.
« Last Edit: June 06, 2016, 12:10:39 PM by nime5ter »
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

  • Contributor
  • ***
  • Posts: 59
  • Karma: 4
    • View Profile
Re: Arabic TTS and Al-Jazeera
« Reply #34 on: June 06, 2016, 01:02:52 PM »
no problem as you like thank you