ArPiRobot-CoreLib C++
C++ library for ArPiRobot robots
Classes | Static Public Member Functions | Friends | List of all members
arpirobot::AudioManager Class Reference

#include <arpirobot/core/audio/AudioManager.hpp>

Static Public Member Functions

static std::vector< AudioDeviceInfogetPlaybackDevices ()
 
static int playSound (std::string file)
 
static int playSound (std::string file, AudioDeviceInfo info)
 
static void stopJob (int jobId)
 

Friends

class BaseRobot
 

Detailed Description

Helper class to play audio files via audio devices on the robot

Member Function Documentation

◆ getPlaybackDevices()

static std::vector<AudioDeviceInfo> arpirobot::AudioManager::getPlaybackDevices ( )
static

Get all available playback devices on this system

Returns
vector of AudioDeviceInfo objects with information about each available device

◆ playSound() [1/2]

static int arpirobot::AudioManager::playSound ( std::string  file)
static

Play a sound file on the default audio device

Parameters
fileFull path to the audio file to play
Returns
A job ID for the sound being played

◆ playSound() [2/2]

static int arpirobot::AudioManager::playSound ( std::string  file,
AudioDeviceInfo  info 
)
static

Play a sound file on a specific audio device

Parameters
fileFull path to the audio file to play
infoAudioDeviceInfo object for the device to play the file on (as obtained from getPlaybackDevices())
Returns
A job ID for the sound being played

◆ stopJob()

static void arpirobot::AudioManager::stopJob ( int  jobId)
static

Stop playing a certain sound using it's job ID (as obtained from playSound()) If the job has already finished, this function will do nothing

Parameters
jobIdjob ID for the sound to stop as obtained from playSound()

The documentation for this class was generated from the following file: