Hi Inmoov Team,
pls. let us know how to run any mp3 file in inmoov script.
thanks and regards.
sunil
You use the AudioFile service like this:
Mr. Mats,uThnaks for giving responce for my post.
But still we couldn't start it with voice command of "play music " or play some music.
below are the updated file of audio.py
# ############################################################################## # AUDIOFILE SERVICE # ############################################################################## # http://myrobotlab.org/service/audiofile
# ############################################################################## # MRL SERVICE CALL # ##############################################################################
#startup sound AudioPlayer = Runtime.createAndStart("AudioPlayer", "AudioFile")
def onAudioStart(data): if AudioSignalProcessing and isHeadActivated: print "onaudiostart" try: head.attach() head.jaw.moveTo(180) left.enablePin(AnalogPinFromSoundCard,HowManyPollsBySecond) except: print "onAudioStart error" pass
def onAudioEnd(data): if AudioSignalProcessing and isHeadActivated: try: left.disablePin(AnalogPinFromSoundCard) #head.jaw.detach() except: print "onAudioEnd error" pass def AudioPlay(file): AudioPlayer.playFile(file,False)
python.subscribe(AudioPlayer.getName(),"publishAudioStart") python.subscribe(AudioPlayer.getName(),"publishAudioEnd") #if StartupSound:AudioPlayer.playFile(RuningFolder+'/system/sounds/startupsound.mp3', False) if StartupSound:AudioPlayer.playFile(RuningFolder+'C:\Users\sunil\Music\HEROPANTI\whistle-baja-(Muskurahat.Com).mp3', False) sleep(2)
thanks
OK
If you want to use voice commands like "play song" you should define that in InMoovs "brain".
InMoov "brain" is the ProgramAB service, and it uses a lot of different *.aiml files to define what InMoov will do in response to different commands.
Here is the link to the ProgramAB service page.
http://myrobotlab.org/service/ProgramAB
Here is one thread that discusses different ways to define the aiml files.
http://myrobotlab.org/content/programab-aiml-and-mrl-support-oob-tags
Install the InMoov service and the ProgramAB service, and you will find a lot of examples in
<MRL home>/InMoov/chatbot/bots/<language>/aiml
You can also search this site for ProgramAB or AIML.
The AIML to execute a method in a service looks like this:
<category>
<pattern>PLAY SONG</pattern>
To execute a function in a python script:
<oob>
Thanks a lot sir,
i will try this and get back to you .
Hi Mats,
I tried to load play song command in python . it run and play specific song but it will not stop or go to next song,
i think we should write all command like play , next, return,pause and stop for this category .
if possible can you give a flow chart for the same.
thanks in advance.
AudioFile service
You use the AudioFile service like this:
audio file.
Mr. Mats,uThnaks for giving responce for my post.
But still we couldn't start it with voice command of "play music " or play some music.
below are the updated file of audio.py
# ##############################################################################
# AUDIOFILE SERVICE
# ##############################################################################
# http://myrobotlab.org/service/audiofile
# ##############################################################################
# MRL SERVICE CALL
# ##############################################################################
#startup sound
AudioPlayer = Runtime.createAndStart("AudioPlayer", "AudioFile")
def onAudioStart(data):
if AudioSignalProcessing and isHeadActivated:
print "onaudiostart"
try:
head.attach()
head.jaw.moveTo(180)
left.enablePin(AnalogPinFromSoundCard,HowManyPollsBySecond)
except:
print "onAudioStart error"
pass
def onAudioEnd(data):
if AudioSignalProcessing and isHeadActivated:
try:
left.disablePin(AnalogPinFromSoundCard)
#head.jaw.detach()
except:
print "onAudioEnd error"
pass
def AudioPlay(file):
AudioPlayer.playFile(file,False)
python.subscribe(AudioPlayer.getName(),"publishAudioStart")
python.subscribe(AudioPlayer.getName(),"publishAudioEnd")
#if StartupSound:AudioPlayer.playFile(RuningFolder+'/system/sounds/startupsound.mp3', False)
if StartupSound:AudioPlayer.playFile(RuningFolder+'C:\Users\sunil\Music\HEROPANTI\whistle-baja-(Muskurahat.Com).mp3', False)
sleep(2)
thanks
AIML
OK
If you want to use voice commands like "play song" you should define that in InMoovs "brain".
InMoov "brain" is the ProgramAB service, and it uses a lot of different *.aiml files to define what InMoov will do in response to different commands.
Here is the link to the ProgramAB service page.
http://myrobotlab.org/service/ProgramAB
Here is one thread that discusses different ways to define the aiml files.
http://myrobotlab.org/content/programab-aiml-and-mrl-support-oob-tags
Install the InMoov service and the ProgramAB service, and you will find a lot of examples in
<MRL home>/InMoov/chatbot/bots/<language>/aiml
You can also search this site for ProgramAB or AIML.
The AIML to execute a method in a service looks like this:
<category>
<pattern>PLAY SONG</pattern>
To execute a function in a python script:
<oob>
Thanks a lot sir, i will try
Thanks a lot sir,
i will try this and get back to you .
Hi Mats, I tried to load play
Hi Mats,
I tried to load play song command in python . it run and play specific song but it will not stop or go to next song,
i think we should write all command like play , next, return,pause and stop for this category .
if possible can you give a flow chart for the same.
thanks in advance.
sunil