Fetching contributors…
Cannot retrieve contributors at this time
33 lines (26 sloc) 1 KB
# 10/05/2015
# Load a mp3 sound from the Web URL and save it localy (by default the directory from where you start MRL
# test on Pc-win7 only...
from org.myrobotlab.service import Speech
import urllib2
import os
# The directory where the file will be saved default = current directory
# To set a directory
# os.chdir("h:/mrl/sound")
# the name of the local file
# remove the file if it already exist in the Audiofile directory
soundfilename="starting mouth.mp3";
mp3file = urllib2.urlopen('')
output = open(soundfilename,'wb')
except IOError:
print "Check access right on the directory"
except Exception:
print "Can't get the sound File ! Check internet Connexion"
# Start the sound...
mouth = Runtime.createAndStart("mouth","Speech")
mouth.audioFile.playFile(currentdir+"/"+soundfilename, False)