#!/usr/bin/env python # coding: utf-8 # install: # sudo apt-get install libttspico-utils # extended text input syntax: http://dafpolo.free.fr/telecharger/svoxpico/SVOX_Pico_Manual.pdf import subprocess from time import sleep import socket while(True): try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8",80)) #Google's public DNS server ipAddress=s.getsockname()[0] print(ipAddress) s.close() subprocess.call(['pico2wave', '--lang=de-DE', '--wave=/tmp/test.wav', '"'+ipAddress+'"']) subprocess.call(['aplay', '/tmp/test.wav']) subprocess.call(['rm', '/tmp/test.wav']) except: pass sleep(3)