Skip to content
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

Post Audio Stream (Enhancement) #59

Closed
d-adamson opened this issue Feb 19, 2017 · 5 comments
Closed

Post Audio Stream (Enhancement) #59

d-adamson opened this issue Feb 19, 2017 · 5 comments

Comments

@d-adamson
Copy link

Nice project. Thanks!
Could you implement the Post Audio Stream API (ref section 4.3.3 in the API manual 2.10 2016-05-25)?

Use case:
When motion or sound are detected, play an audio file over the camera's speaker to act as a deterrent. Examples: dog barking, TV or radio playing, background conversations, alarm sound, etc.

@tchellomello
Copy link
Owner

Hello @d-adamson that is a great idea!!

@d-adamson
Copy link
Author

d-adamson commented Feb 22, 2017 via email

@d-adamson
Copy link
Author

I've played around with this a little. Here is a code snippet using the curl program from the command line in Linux. Substituting your user name, password and IP address (of course).
Hopefully this will be of some help to the next person.

The AMCREST seems to be pretty particular about the wav file format. After some trial and error the following worked. Still have not been able to successfully convert & play an mp3 file :(
$ ffmpeg -i 9000g.wav -acodec pcm_alaw -ar 8000 9000g_pcm.wav

$ curl -verbose --request POST --url 'http:https://admin:[email protected]/cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1' --header 'content-length: 9999999' --header 'content-type: Audio/G.711A' --data-binary @9000g_PCM.wav

9000g.zip

@dougsland
Copy link
Collaborator

dougsland commented Mar 20, 2017

Thanks for your collaboration @d-adamson , really motivated me to step out and provide a patch soon.

@dougsland
Copy link
Collaborator

dougsland commented Mar 20, 2017

Pull request based on this idea: #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants