58 if (
strcmp(format.c_str(),
".wav") == 0)
62 else if (
strcmp(format.c_str(),
".mp3") == 0)
110 m_sound_data.resize(0,0);
A mini-server for performing network communication in the background.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
Sound subSound(size_t first_sample, size_t last_sample)
Returns a subpart of the sound.
size_t getSamples() const
Get the number of samples contained in the sound.
bool open(const char *filename)
bool rewind(size_t sample_offset=0)
size_t readBlock(Sound &dest, size_t block_size)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
An interface to the operating system, including Port based communication.
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
bool write_mp3_file(const Sound &data, const char *filename, size_t bitrate=64000)
Write a sound to a mp3 file.
bool read_wav_file(Sound &data, const char *filename)
Read a sound from a .wav audio file.
bool read_mp3_file(Sound &data, const char *filename)
Read a sound from a .mp3 audio file.
bool read_mp3_bytestream(Sound &data, const char *bytestream, size_t streamsize)
Read a sound from a byte array.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
bool read_bytestream(Sound &data, const char *filename, size_t streamsize, std::string format)
Read a sound from a byte array.
bool write_wav_file(const Sound &data, const char *filename)
Write a sound to a .wav file.
bool read_wav_bytestream(Sound &data, const char *bytestream)
Read a sound from a byte array.