|
FP Perception 0.1.2
|
Enumerations | |
| enum class | RESTOptionType { STRING = 0 , BOOL , INT , DOUBLE } |
Functions | |
| fp_perception_msgs::msg::PerceptionAudio | audio_data_to_msg (const audio_data &data) |
| Convert fp_perception::audio_data to fp_perception_msgs::msg::PerceptionAudio message. | |
| audio_data | msg_to_audio_data (const fp_perception_msgs::msg::PerceptionAudio &msg) |
| Convert fp_perception_msgs::msg::PerceptionAudio message to audio_data. | |
| fp_perception_msgs::msg::PerceptionText | text_data_to_msg (const text_data &data) |
| text_data | msg_to_text_data (const fp_perception_msgs::msg::PerceptionText &msg) |
| void | writeWavStream (std::ostream &out, const audio_data &data) |
| Write audio data to a WAV file using an output stream. | |
| void | writeWavFile (const std::string &filename, const audio_data &data) |
| Write audio data to a WAV file. | |
| audio_data | readWavFile (const std::string &filepath) |
| Read audio data from a WAV file. | |
| std::vector< char > | encodeWavToBytes (const fp_perception::audio_data &data) |
| Encode audio data to a WAV file and return as a byte vector. | |
| std::string | getHostApiName (PaHostApiIndex host_api_index) |
| Get the device ID by name. | |
| std::string | describePortAudioDevice (int device_id) |
| template<typename LoggerT > | |
| void | logPortAudioDevices (const LoggerT &logger) |
| int | getDeviceIdByName (const std::string &target_name) |
|
strong |
| fp_perception_msgs::msg::PerceptionAudio fp_perception::audio_data_to_msg | ( | const audio_data & | data | ) |
Convert fp_perception::audio_data to fp_perception_msgs::msg::PerceptionAudio message.
| data | The audio data to convert. |
|
inline |
| std::vector< char > fp_perception::encodeWavToBytes | ( | const fp_perception::audio_data & | data | ) |
Encode audio data to a WAV file and return as a byte vector.
| data | The audio data to encode. |
| fp_perception_exception | if there are issues writing the data. |
|
inline |
|
inline |
Get the device ID by name.
This function searches for a PortAudio device by its name and returns its ID. If the device is not found, it throws an exception.
| target_name | The name of the target device to search for. |
| fp_perception::fp_perception_exception | if no devices are found or if the target device is not found. |
|
inline |
| audio_data fp_perception::msg_to_audio_data | ( | const fp_perception_msgs::msg::PerceptionAudio & | msg | ) |
Convert fp_perception_msgs::msg::PerceptionAudio message to audio_data.
| msg | The message to convert. |
| text_data fp_perception::msg_to_text_data | ( | const fp_perception_msgs::msg::PerceptionText & | msg | ) |
| audio_data fp_perception::readWavFile | ( | const std::string & | filepath | ) |
Read audio data from a WAV file.
| filepath | Path to the WAV file. |
| fp_perception_exception | on file errors or unsupported formats. |
| fp_perception_msgs::msg::PerceptionText fp_perception::text_data_to_msg | ( | const text_data & | data | ) |
| void fp_perception::writeWavFile | ( | const std::string & | filename, |
| const audio_data & | data | ||
| ) |
Write audio data to a WAV file.
| filename | The name of the file to write. |
| data | The audio data to write. |
| fp_perception_exception | if the file cannot be opened or if there are issues writing the data. |
| void fp_perception::writeWavStream | ( | std::ostream & | out, |
| const audio_data & | data | ||
| ) |
Write audio data to a WAV file using an output stream.
| out | The output stream to write the WAV data to. |
| data | The audio data to write. |
| fp_perception_exception | if the output stream is not valid or if there are issues writing the data. |