Comments (10)
It's on my list to investigate. I'm rewriting deconz integration right now. Then I'll solve some bugs with unifi then I hope to get back to the Axis integration
from axis.
Great news ! I would be happy to test and provide information if needed.
from axis.
Don't expect it to happen before summer though :/
I have too much to do which is the main issue
from axis.
Summer is the best time to test ;-) No worries !
from axis.
I'm doing some tests in the meanwhile and I can send sample sounds to the internal speaker with the following command:
ffmpeg -i <sound_file.mp3> -probesize 32 -analyzeduration 32 -c:a pcm_mulaw -ab 128k -ac 1 -ar 16000 -f wav -chunked_post 0 -content_type audio/axis-mulaw-128 "http://<user>:<password>@<cam_ip>/axis-cgi/audio/transmit.cgi"
from axis.
Oo wow! Awesome job.
from axis.
Thanks ! Just some good old google-fu to be honest 😇 nothing more.
I would like to help to implement that in your add-on but not sure if that really helps... It's a start but I guess that's something that should use some POST to send the sound file to the transmit.cgi and see it as a media_player entity.
from axis.
If you can just give me a proof of concept in python code I can formalize it afterwards
from axis.
I've tried to do something like that, as a PoC, which works fine:
import requests
from requests.auth import HTTPDigestAuth
from pydub import AudioSegment
from pydub.utils import mediainfo
# Set Auth
auth = HTTPDigestAuth("<USER>", "<PASSWORD>")
# Set the server URL
server_url = "http://<IP>/axis-cgi/audio/transmit.cgi"
# Open the MP3 file
input_file = AudioSegment.from_mp3("sound.mp3")
# Convert the MP3 file to WAV format
input_file = input_file.split_to_mono()[0]
input_file = input_file.set_frame_rate(16000)
input_file = input_file.export(
"output.wav", format="wav", codec="pcm_mulaw", bitrate="128k")
# Print some info about the WAV
print(mediainfo("output.wav"))
# Read the WAV file and get its data
with open("output.wav", "rb") as f:
file_data = f.read()
# Set the headers for the HTTP POST request
headers = {
"Content-Type": "audio/axis-mulaw-128",
"Content-Length": str(len(file_data)),
}
try:
# Send the POST request with the file data and headers
response = requests.post(server_url, data=file_data,
auth=auth, headers=headers)
print(response.text)
response.raise_for_status()
except requests.exceptions.HTTPError as errh:
print("Http Error:", errh)
except requests.exceptions.ConnectionError as errc:
print("Error Connecting:", errc)
except requests.exceptions.Timeout as errt:
print("Timeout Error:", errt)
except requests.exceptions.RequestException as err:
print("OOps: Something Else", err)
I've also found some documentation here: https://www.axis.com/vapix-library/subjects/t10100065/section/t10036015/display
from axis.
Sweet! I've taken my first small steps into the refactoring of the Axis library so once I'm further into that I can start looking at adding new things as it would be counterproductive to expand something that will be rewritten shortly after.
from axis.
Related Issues (20)
- Axis f34 HOT 1
- rtsp streaming player window HOT 3
- Server disconnected without sending a response HOT 13
- HTTPS support HOT 6
- Axis problem with post command HOT 1
- Websocket support HOT 1
- Enable/disable automations
- sending command to enable/disable an action rule
- Axis cameras (Companion line) - solved by kimjohnson
- Add PTZ, zoom and preset positions to Axis camera integration
- Pytest picked
- Companion line support
- Axis M1031-W keeps trying to connect to the default IP and spamming the logs
- Cannot view RTSP stream Axis M3106-LVE
- Axis integration, motion sensors randomly stops reporting
- New device class doorbell needed to resolve homekit issue
- Debouncing HA state updates
- Axis camera motion sensor becomes unavailable
- Feature request of PTZ commands and preset positions in Axis cameras HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axis.