I try to use some methods of http://doc.aldebaran.com/2-5/naoqi/audio/alaudioplayer-api.html
But the terminal tells me that most of them don't work.
# -*- encoding: UTF-8 -*-
import sys
import time
from naoqi import *
IP = "127.0.0.1"
PORT = 9559
try:
aup = ALProxy("ALAudioPlayer", IP, PORT)
except Exception,e:
print "Could not create proxy to ALAudioPlayer"
print "Error was: ",e
sys.exit(1)
#this line works. I can hear the music
fileId = aup.post.playFile("C:\VALIDPATH.wav")
#does not show most of the methods
print(aup.getMethodList())
time.sleep(1)
#this line does not work
currentPos = aup.getCurrentPosition(fileId)
The output :
['isStatsEnabled', 'enableStats', 'stats', 'clearStats', 'isTraceEnabled', 'enableTrace', 'exit', '__pCall', 'pCall', 'version', 'ping', getMethodList', 'getMethodHelp', 'getModuleHelp', 'wait', 'isRunning', 'stop', 'getBrokerName', 'getUsage', 'playFile', 'playFileInLoop', 'playFileFromPosition', 'pause']
Traceback (most recent call last): File "fggfgf.py", line 27, in currentPos = aup.getCurrentPosition(fileId) File "C:\Python27\lib\site-packages\naoqi.py", line 301, in call return self.wrapped.method_missing(self.method, *args, **kwargs) File "C:\Python27\lib\site-packages\naoqi.py", line 371, in method_missing raise e RuntimeError: ALAudioPlayer::getCurrentPosition Can't find method: getCurrentPosition (resolved to '(i)')