0

I am trying to load an audio file on my desktop to the NAO Robot and it keeps saying that the audio file is not found.

audio = ALProxy("ALAudioPlayer",ip, port)
fileid = audio.loadFile("C:/Users/robot/Desktop/song1.wav")
print("hello")
time.sleep(5)
audio.play(fileid)

I keep getting this error

  File "c:\Users\robot\Desktop\vsc python test.py", line 7, in <module>
    fileid = audio.loadFile("C:/Users/robot/Desktop/song1.wav")
  File "C:\Users\Administrator\Downloads\pynaoqi-python2.7-2.8.7.4-win64-vs2015-20210818_210634\lib\naoqi.py", line 194, in __call__
    return self.__wrapped__.method_missing(self.__method__, *args, **kwargs)
  File "C:\Users\Administrator\Downloads\pynaoqi-python2.7-2.8.7.4-win64-vs2015-20210818_210634\lib\naoqi.py", line 264, in method_missing
    raise e
RuntimeError:   ALAudioPlayer::loadFile
                ALAudioPlayer::loadFile
                ALAudioPlayerTask::initialize
                ALAudioPlayer::ALAudioPlayerTask constructor
        file 'C:/Users/robot/Desktop/song1.wav' not found
PS C:\Users\robot\Desktop> 
Jin
  • 9
  • 3

1 Answers1

0

Your NAO is a different computer than the computer where you're developing, so when you're asking to load a file, it has to be on NAO's hard drive.

You can upload it using, scp, ftp (filezilla,...) or choregraphe.

It's a linux os, so it will be somewhere like /home/nao/, then you can do something like:

fileid = audio.loadFile("/home/nao/song1.wav")
Alexandre Mazel
  • 2,462
  • 20
  • 26