tchellomello / python-amcrest

A Python 2.7/3.x module for Amcrest and Dahua Cameras using the SDK HTTP API.
GNU General Public License v2.0
210 stars 76 forks source link

play wav only sends static (audio) #149

Open AlexKohanim opened 4 years ago

AlexKohanim commented 4 years ago

Hello, I'm loving this project so far which has greatly simplified the API calls for the amcrest camera.

I am currently testing with this camera [IP2M-841B]. And have run into one issue so far.

I'm using the pypip package to run the funcions.

For recording which works: camera = AmcrestCamera(ip, 80, 'user', 'password').camera camera.audio_stream_capture( httptype="singlepart", channel=1, path_file="audio.wav")

But trying to "stream" the same file just plays back about 10 seconds of static: camera = AmcrestCamera(ip, 80, 'user', 'password').camera camera.play_wav("singlepart", channel=1, path_file="audio.wav")

Any and all help would be appreciated.

Thanks!

tylertroy commented 4 years ago

Hi Amcrest,

I would love some more information on sending audio with the API. In particular I would like to stream audio to the device but even just playing a wav file is proving difficult as brought to light in this issue. My company is very interested in Amcrest offerings but two-way audio is vital for our use case.

The solution discussed in the issue linked below is not solved despite being marked so. https://github.com/tchellomello/python-amcrest/issues/75

More guidance on this issue would be greatly appreciated.

AlexKohanim commented 4 years ago

Hi @tylertroy

My team has a fix for this. I don't have it with me right now, but I remember it was due to a hardcoded file type or hardcoded stream type for the audio sent.

I have never made a PR officially, so it might take a bit to get the change here, unless someone has the time to help me out.

Take care,

-Alex Kohanim

tylertroy commented 4 years ago

Hi @AlexKohanim

Thanks for your response. I would appreciate any help with this matter and would be happy to assist in any way in making/reviewing changes to the existing code base. Please feel free to contact me via email for further discussion. You can find my email address in my Github profile and thanks again.

AlexKohanim commented 4 years ago

@tylertroy If you could Test the new implementation and let us know your findings, we can work to close this Issue.