AudioRecord.srv里面内容为:
string filename
float32 duration
---
bool status
#!/usr/bin/env python
import rospy
from pyaudio import PyAudio, paInt16
from audio_recorder_nodes.srv import AudioRecord, AudioRecordResponse
import wave
# 定义音频录制服务节点的主体函数
def audio_recording_server():
# 处理具体的音频录制请求
def handle_record_request(req):
if __name__ == '__main__':
try:
# 启动音频录制服务节点
audio_recording_server()
except rospy.ROSInterruptException:
pass
可以加Q 3562487425交流