-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help talk back audio #2
Comments
if __name__ == '__main__':
cam = XMCam(CAM_IP, CAM_PORT, 'admin', 'admin')
login = cam.cmd_login()
print(login)
sleep(0.1)
streamconn = cam.create_sub_connection(True)
sleep(0.1)
success, pcm_audio_path = XMCam.talk_convert_to_pcm('/path/to/audio/file.mp3')
if success: # if audio converted into PCM successfully
streamconn.cmd_talk_claim()
sleep(0.1)
cam.cmd_talk_start()
audio_chunks = XMCam.talk_get_chunks(pcm_audio_path)
if audio_chunks is not None:
for audio_chunk in audio_chunks:
streamconn.cmd_talk_send_stream(audio_chunk)
sleep(0.04)
sleep(0.1)
cam.cmd_talk_stop()
sleep(0.1)
streamconn.disconnect()
sleep(0.1)
cam.disconnect() Just improve the sleep position and time to improve prefered continous audio stream. Hope this help. |
Just forget/remove |
"xcam Cannot start keepalive" error dont connect, user admin and password ***** are corrects. from xmcam import * CAM_IP = '192.168.0.4' if name == 'main': |
Hi. First many thanks.
I need help sending audio to web cam.
I dont how to do it, i need an example code (python) to send audiio to web cam, please.
Many thanks for your great job!
The text was updated successfully, but these errors were encountered: