0

Im trying to use a recorded audiofile from Nao in python and turn it using speechrecognition into text.

I looked in FileZilla and the audiofile is stored in "/data/home/nao/record.wav" on the Nao, but Im not able to access it in my python code. I tried to use ALMemoryProxy::getData("/data/home/nao/record.wav") but that did not work. Is there another way?

Vincent
  • 1
  • 1

1 Answers1

0

If anyone needs to do the same I used paramiko

import paramiko

host = 'IP of your NAO'
user = 'nao'
password = 'password of you NAO'
filename = 'name of the file you want to transfer'

try:
    transport = paramiko.Transport((host, 22))
    transport.connect(username=user, password=password)
    sftp = paramiko.SFTPClient.from_transport(transport)
    sftp.get(filename, filename)
    print("File downloaded successfully.")
except Exception as e:
    print("An error occurred:", e)
    # Additional error handling if needed
finally:
    sftp.close()
    transport.close()
Vincent
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 24 '23 at 21:07