Search code examples
pythonpython-2.7roboticsnao-robotpepper

NAOqi No subscription found for SignalLink


I am trying to record an audio file from the robot pepper and store it on my local machine, I tried to use these two approaches:

Here I used NAOqi with ALAudioDevice and ALAudioRecorder but I didn't get any outputs the code exits with no errors:

import naoqi
import qi
from naoqi import ALProxy 
from time import sleep 

ROBOT_IP = '192.168.0.169'
ROBOT_PORT = 9559

# sound = ALProxy("ALAudioDevice" , ROBOT_IP, ROBOT_PORT)
sound = ALProxy("ALAudioRecorder" , ROBOT_IP, ROBOT_PORT)

# sound.startMicrophonesRecording("/tmp/pepper/test.wav")
sound.startMicrophonesRecording("/tmp/pepper/test.wav","wav",16000,[0,0,1,0])

sleep(3)

sound.stopMicrophonesRecording()

but here I did the same thing using qi and I also tried both ALAudioDevice and ALAudioRecorder like this:

import naoqi
import qi
from naoqi import ALProxy 
from time import sleep 

ROBOT_IP = '192.168.0.169'
ROBOT_PORT = 9559

session = qi.Session()
    
connection_url = "tcp://" + ROBOT_IP + ":" + str(ROBOT_PORT)
session.connect(connection_url)

sound = session.service("ALAudioDevice")
# sound = session.service("ALAudioRecorder")

sound.startMicrophonesRecording("/tmp/pepper/test.wav")
# sound.startMicrophonesRecording("/tmp/pepper/test.wav","wav",16000,[0,0,1,0])

sleep(3)

tts.stopMicrophonesRecording()

this is the output and still I don't get any recorded aurdio.

[W] 1615812775.715142 775 qi.path.sdklayout: No Application was created, trying to deduce paths
[W] 1615812776.325653 10499 qitype.signal: disconnect: No subscription found for SignalLink 0.
[W] 1615812776.325654 2819 qitype.signal: disconnect: No subscription found for SignalLink 13.

I would appreciate any help or resources to get the desired recorded audio and saved on my local machine.


Solution

  • ALAudioRecorder produces a sound file on the robot. To collect it, you will have to use scp. In your case, to put the file in your downloads folder:

    scp nao@ROBOT_IP:/tmp/pepper/test.wav ~/Downloads/test.wav
    

    There is also an alternative: you can get the sound buffers directly.

    The logs you have seen are unrelated to your issue, this is just some pollution from the framework.