Author Topic: how can i play a song after a certain amount of time has passed using events?  (Read 1087 times)

0 Members and 1 Guest are viewing this topic.

Irritatedmonkey

  • Jr. Member
  • **
  • Posts: 6
  • Karma: 0
    • View Profile
how can i play a song after a certain amount of time has passed using events?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
It's not quite clear what you're asking.

More information would be helpful, including:

1. what software you want to use to play your song,
2. after a certain amount of time has passed since what has occurred? (i.e since VC has loaded, since you issued another command, since a light turned on, etc.)?

But basically, you can create a command that uses VC.EventTimer to trigger your other, play song command. http://voxcommando.com/mediawiki/index.php?title=Actions#SetEventTimer

Here, when I turn on my living room light it triggers the event timer command. In five minutes the timer goes off and triggers my existing MediaMonkey play song command, passing it the specific song, "Wake Up Little Susie" as the payload:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="play song in 5 mins" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1121" name="Play song in 5 minutes" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.SetEventTimer</cmdType>
      <cmdString>5m&amp;&amp;playSong&amp;&amp;Wake Up Little Susie</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Vera1.Device.20.On</event>
  </command>
  <command id="113" name="Play Song {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>MM.LoadBySQL</cmdType>
      <cmdString>SongTitle ='{1}'</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{lastresult}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>MM.Play</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>playing song, {1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Play</phrase>
    <phrase optional="true">the</phrase>
    <phrase>song, track</phrase>
    <payloadFromXML phraseOnly="True" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">mmPayloads\mmSongs.xml</payloadFromXML>
    <event>playSong</event>
  </command>
</commandGroup>

The nature of the payload or whether you need one at all will depend on whether you want a specific song, what method you're using to play audio etc.
« Last Edit: February 24, 2014, 01:06:57 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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
how can i play a song after a certain amount of time has passed using events?

Hi IrritatingMonkey.  I recommend you spend a bit more time composing your questions, in order to save everyone a lot of time and frustration.  For some pointers on how to ask questions properly you can review this guide: http://www.voxcommando.com/forum/index.php?topic=1248.0
« Last Edit: February 24, 2014, 02:00:34 PM by jitterjames »