SoftBank Robotics documentation What's new in NAOqi 2.5?

ALSoundLocalization API

NAOqi Audio - Overview | API


Namespace : AL

#include <alproxies/alsoundlocalizationproxy.h>

Method list

As any module, this module inherits methods from ALModule API. It also has the following specific methods:

class ALSoundLocalizationProxy

Methods

void ALSoundLocalizationProxy::setParameter(const std::string& parameter, const AL::ALValue& value)

Sets parameters.

Parameters:
  • parameter – Name of the parameter
  • value – Value of the parameter

Available parameters:

  • “EnergyComputation” to True or False (default: False). When set to True, the peak energy of the located sound is estimated. The ALMemory key “ALSoundLocalization/SoundLocated” where the result of the computation is updated is modified consequently:
[ [time(sec), time(usec)],

  [azimuth(rad), elevation(rad), confidence, energy],

  [Head Position[6D]] in FRAME_TORSO
  [Head Position[6D]] in FRAME_ROBOT
]
  • “Sensibility”: DEPRECATED, use “Sensitivity” instead.
  • “Sensitivity” between 0 and 1 to adjust the minimal sound level to trigger the localization. This parameter is the same as in the ALSoundDetection module.
void ALSoundLocalizationProxy::subscribe(const std::string& name)

Subscribes to ALSoundLocalization. This causes the module to start raising the “ALSoundLocalization/SoundLocated” ALMemory event which you can subscribe to by using ALMemoryProxy::subscribeToMicroEvent.

Parameters:
  • name – Name used to identify the subscriber
void ALSoundLocalizationProxy::unsubscribe(const std::string& name)

Unsubscribes to ALSoundLocalization. This causes the module to stop raising the “ALSoundLocalization/SoundLocated” ALMemory event.

Parameters:

Events

Event: "ALSoundLocalization/SoundLocated"
callback(std::string eventName, AL::ALValue value, std::string subscriberIdentifier)

Raised when a sound source has been localized.

Parameters:
  • eventName (std::string) – “ALSoundLocalization/SoundLocated”
  • value – Array containing information about the localized sounds. Please refer to ALSoundLocalization for details.
  • subscriberIdentifier (std::string) –
Event: "ALSoundLocalization/SoundsLocated"
callback(std::string eventName, AL::ALValue value, std::string subscriberIdentifier)

Raised every 170ms if one or several sounds have been localized during that timeframe.

Parameters:
  • eventName (std::string) – “ALSoundLocalization/SoundsLocated”
  • value – Array containing information about the localized sounds. Please refer to ALSoundLocalization for details.
  • subscriberIdentifier (std::string) –