# Test core audio functionalities with `qrb_ros_audio_service` `qrb_ros_audio_service` is a ROS package that provides core audio functionalities. It serves as the primary interface for audio playback and recording within the ROS ecosystem. - QRB ROS Audio Service: A ROS node that creates a service server, responds to requests from the application, and translates them into operations on the Audio Manager. - QRB ROS Audio Common: A ROS node that acts as a bridge between QRB ROS Audio Service and QRB Audio Common Lib. - QRB Audio Manager: Executes audio operations provided by the Audio Service, based on stream configurations. - QRB Audio Common Lib: Provides audio functionalities by calling PulseAudio APIs. ## Pipeline flow  **`qrb_ros_audio_service` pipeline** ## `qrb_ros_audio_service` APIs ROS interfaces | Interface | Name | Type | Description | | --- | --- | --- | --- | | Service | `/audio_service` | `qrb_ros_audio_service_msgs::srv::AudioRequest` | Allows ROS applications to send service requests for audio playback and recording. | ## `qrb_ros_audio_common` APIs **ROS parameters** ROS parameters | Name | Type | Description | Default value | | --- | --- | --- | --- | | `Stream_type` | string | Specifies the stream type for the action: "playback" for audio playback or "capture" for audio recording. | `default_stream` | | `action_name` | string | Specifies the name of an action. | `default_action` | | `topic_name` | string | Specifies the name of a topic. | `default_topic` | **ROS interfaces** ROS interfaces | Interface | Name | Type | Description | | --- | --- | --- | --- | | Action | `/ros_audio_playback` | `qrb_ros_audio_common_msgs::action::AudioCommon` | Action for playback function, specify the action name by the `action_name` parameter. | | Action | `/ros_audio_capture` | `qrb_ros_audio_common_msgs::action::AudioCommon` | Action for record function, specify action name by `action_name` parameter. | | Subscriber | `/qrb_audiodata` | `qrb_ros_audio_common_msgs::msg::AudioData` | Used for streaming audio playback. Subscribes to raw audio data from this node. You can change the topic name using the `--topic_name` parameter. | | Publisher | `/qrb_audiodata` | `qrb_ros_audio_common_msgs::msg::AudioData` | Used for streaming audio recording. Publishes real-time raw audio data during recording. You can change the topic name using the `--topic_name` parameter. | `qrb_audio_common_lib` **APIs** qrb_audio_common_lib APIs | Function | Parameters | Description | | --- | --- | --- | | `uint32_t audio_stream_open(const audio_stream_info & stream_info, stream_event_callback_func event_callback)` |
stream_info: A structure specifies the configuration of stream.
stream_event_callback_func: callback function.
stream_handle: A unique identifier for stream.
mute: Boolean flag indicating whether to mute the stream.
stream_handle: A unique identifier for stream.
length: Size to write.
buf: Point to data buffer.