//+------------------------------------------------------------------+
//| VoiceTime.mq4 |
//| Copyright 2016, A.Voronin |
//| giskoats@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, A.Voronin"
#property link "giskoats@gmail.com"
#property version "1.1"
#property strict
#property description "Произнести текущее время"
int VoicePause = 1000;//Задержка между словами
int TimeSH,TimeSM;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void start()
{
TimeSH=-1;TimeSM=-1;
VoiceTime();
return;
}
//+------------------------------------------------------------------+
void VoiceTime()
{
if(TimeSH!=TimeHour(TimeLocal()) && TimeSM!=TimeMinute(TimeLocal()))
{
TimeSH=TimeHour(TimeLocal());TimeSM=TimeMinute(TimeLocal());
switch(TimeSH)
{
case 0: {PlaySound("Digits/0.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 1: {PlaySound("Digits/1.wav");Sleep(VoicePause);PlaySound("Digits/hour.wav");break;}
case 2: {PlaySound("Digits/2.wav");Sleep(VoicePause);PlaySound("Digits/hours-a.wav");break;}
case 3: {PlaySound("Digits/3.wav");Sleep(VoicePause);PlaySound("Digits/hours-a.wav");break;}
case 4: {PlaySound("Digits/4.wav");Sleep(VoicePause);PlaySound("Digits/hours-a.wav");break;}
case 5: {PlaySound("Digits/5.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 6: {PlaySound("Digits/6.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 7: {PlaySound("Digits/7.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 8: {PlaySound("Digits/8.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 9: {PlaySound("Digits/9.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 10: {PlaySound("Digits/10.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 11: {PlaySound("Digits/11.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 12: {PlaySound("Digits/12.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 13: {PlaySound("Digits/1.wav");Sleep(VoicePause);PlaySound("Digits/hour.wav");break;}
case 14: {PlaySound("Digits/2.wav");Sleep(VoicePause);PlaySound("Digits/hours-a.wav");break;}
case 15: {PlaySound("Digits/3.wav");Sleep(VoicePause);PlaySound("Digits/hours-a.wav");break;}
case 16: {PlaySound("Digits/4.wav");Sleep(VoicePause);PlaySound("Digits/hours-a.wav");break;}
case 17: {PlaySound("Digits/5.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 18: {PlaySound("Digits/6.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 19: {PlaySound("Digits/7.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 20: {PlaySound("Digits/8.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 21: {PlaySound("Digits/9.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 22: {PlaySound("Digits/10.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
case 23: {PlaySound("Digits/11.wav");Sleep(VoicePause);PlaySound("Digits/hours.wav");break;}
default: return;
}
Sleep(VoicePause);
switch(TimeSM)
{
case 0: {PlaySound("Digits/0.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 1: {PlaySound("Digits/1f.wav");Sleep(VoicePause);PlaySound("Digits/minute.wav");break;}
case 2: {PlaySound("Digits/2f.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 3: {PlaySound("Digits/3.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 4: {PlaySound("Digits/4.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 5: {PlaySound("Digits/5.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 6: {PlaySound("Digits/6.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 7: {PlaySound("Digits/7.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 8: {PlaySound("Digits/8.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 9: {PlaySound("Digits/9.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 10: {PlaySound("Digits/10.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 11: {PlaySound("Digits/11.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 12: {PlaySound("Digits/12.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 13: {PlaySound("Digits/13.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 14: {PlaySound("Digits/14.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 15: {PlaySound("Digits/15.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 16: {PlaySound("Digits/16.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 17: {PlaySound("Digits/17.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 18: {PlaySound("Digits/18.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 19: {PlaySound("Digits/19.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 20: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 21: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/1f.wav");Sleep(VoicePause);PlaySound("Digits/minute.wav");break;}
case 22: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/2f.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 23: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/3.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 24: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/4.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 25: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/5.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 26: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/6.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 27: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/7.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 28: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/8.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 29: {PlaySound("Digits/20.wav");Sleep(VoicePause);PlaySound("Digits/9.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 30: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 31: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/1f.wav");Sleep(VoicePause);PlaySound("Digits/minute.wav");break;}
case 32: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/2f.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 33: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/3.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 34: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/4.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 35: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/5.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 36: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/6.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 37: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/7.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 38: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/8.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 39: {PlaySound("Digits/30.wav");Sleep(VoicePause);PlaySound("Digits/9.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 40: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 41: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/1f.wav");Sleep(VoicePause);PlaySound("Digits/minute.wav");break;}
case 42: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/2f.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 43: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/3.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 44: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/4.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 45: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/5.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 46: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/6.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 47: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/7.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 48: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/8.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 49: {PlaySound("Digits/40.wav");Sleep(VoicePause);PlaySound("Digits/9.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 50: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 51: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/1f.wav");Sleep(VoicePause);PlaySound("Digits/minute.wav");break;}
case 52: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/2f.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 53: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/3.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 54: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/4.wav");Sleep(VoicePause);PlaySound("Digits/minutes-i.wav");break;}
case 55: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/5.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 56: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/6.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 57: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/7.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 58: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/8.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
case 59: {PlaySound("Digits/50.wav");Sleep(VoicePause);PlaySound("Digits/9.wav");Sleep(VoicePause);PlaySound("Digits/minutes.wav");break;}
default: return;
}
}
return;}
//+------------------------------------------------------------------+