@@ -0,0 +1,1193 @@
+#!/usr/bin/python3%0A%0A# Call scripty with:%0A# ./sound.py CAM_IP FILENAME%0A%0Aimport sys%0Aimport os%0A%0Afrom xmcam import *%0Afrom xmconst import *%0Afrom time import sleep%0A%0ACAM_IP = sys.argv%5B1%5D%0AFILE = sys.argv%5B2%5D%0A%0ACAM_PORT = 34567%0A%0Aif __name__ == '__main__':%0A%0A    cam = XMCam(CAM_IP, CAM_PORT, 'admin', '')%0A    login = cam.cmd_login()%0A    print(login)%0A%0A    sleep(0.1)%0A%0A    streamconn = cam.create_sub_connection(True)%0A%0A    sleep(0.1)%0A    %0A    success, pcm_audio_path = XMCam.talk_convert_to_pcm(FILE)%0A%0A    if success: # if audio converted into PCM successfully%0A%0A        streamconn.cmd_talk_claim()%0A        print(%22CLAIM%22)%0A        %0A        sleep(0.1)%0A%0A        cam.cmd_talk_start()%0A        print(%22START%22)%0A        %0A        audio_chunks = XMCam.talk_get_chunks(pcm_audio_path)%0A%0A        if audio_chunks is not None:%0A%0A            for audio_chunk in audio_chunks:%0A                streamconn.cmd_talk_send_stream(audio_chunk)%0A%0A            # Sufficient wait for playing whole file%0A            stat = os.stat(pcm_audio_path).st_size%0A            sleep(stat / 8000)%0A%0A        sleep(0.05)%0A%0A        cam.cmd_talk_stop()%0A        print(%22END%22)%0A        %0A        sleep(0.1)%0A%0A    sleep(0.1)%0A%0A    cam.disconnect()%0A    print(%22END%22)%0A

Create sound.py