I would like to write a small Python script which writes a message on the console if it detects that the microphone is used by a process in Windows. I searched in the PyAudio documentation but I didn't find any solution to this. How could I solve this task? Thank you.
Related
I am trying to read the stream from HDMI-USB video-capture card using opencv. But OpenCV doesn't seem to support that functionality. I used opencv to read RTSP streams and webcams. Can anyone suggest a way here. Currently I am accessing the stream using OBS Studio software. Is there any other module in python that I can use. Thanks in advance.
There's a similar question here. But that approach doesn't work for me.
Edit:
video0 or video1 depends on your system and connected devices.
Turns out we can access this USB device using opencv itself.
In linux you can access these devices at /dev/video0.
import cv2
cap = cv2.VideoCapture('/dev/video0')
I'm yet to figure out how to do this in windows though
I need to check if any application is playing any kind of media. Most importantly I want my Python program to detect whichever application is playing audio.
The name of the application the audio is playing. And any related data are welcome.
I searched this up before posting here. I got many results, but unfortunately those are not for python. They were made for languages like C and C++.
My spec for your reference:
Operating System: Windows 10
Python Version 3.8
So me and my friend are working on this project where a raspberry pi with certain sensors collects some data and outputs it.
Now, we want certain parameters to be passed on runtime. So we were thinking of creating a react-native app which could connect with the Pi using Bluetooth. Once connected, it could then send the arguments over Bluetooth.
The python script would then intercept these arguments and then run its program and then send its output back to the app.
While searching for libraries to help me with this, I came across this library: https://github.com/Polidea/react-native-ble-plx
While going through the documentation, I came across https://github.com/Polidea/react-native-ble-plx/wiki/Characteristic-Writing, which seems to be the method used for writing some data and sending it.
In Bluetooth terms, what exactly are these services and characteristics and do I have to create my own service and characteristic while working on my project? Or can I write to any existing characteristic so that the python script can read that?
If I have wrongly understood certain concepts, please correct me. Also if there are any better ways to architect this approach please let me know
Currently, there is no official Expo Bluetooth API. I looked up the same library you are looking at and I find it a little complicated.
I found this link https://askubuntu.com/questions/838697/share-files-between-2-computers-via-bluetooth-from-terminal, where you could open up one terminal and use Bluetoothctl to connect to a specific device. Now, open up another terminal and use the bluetooth-sendto --device= MAC:ADDRESS (read that link) to send the file from Raspberry Pi to a phone (I tested on Android and it worked).
You could also send data from the phone to Raspberry Pi. Again, check out that link.
I am developing an Offline Artificial-Intelligence Agent.
What I still need to do is overcome the Voice Recognition Problem.
My Problem is that I cannot find a proper way to record the correct format for Pocketsphinx through the Terminal in order to embed it to the AI Agent.
Could anyone post any possible method to do this?
Thanks in Advance.
I've been trying for a while but struggling. I have two projects:
Stream audio to server for distribution over the web
Stream audio and video from a webcam to a server for distribution over the web.
I have thus far tried ffmpeg and ffserver, PulseAudio, mjpegstreamer (I got this working but no audio) and IceCast all with little luck. While I'm sure this is likely my fault, I was wondering if there are any more option?
I've spent a while experimenting with Linux options and was also wondering if there were options with Python having recently played with OpenCV.
If anyone can suggest more options to look into Python or Linux based it would be much appreciated or point me at some good tutorials or explainations of what I've already used it would be much appreciated.
A good start for trying different options is to use vlc (http://www.videolan.org) Its file->transmit menu command opens a wizard with which you can play.
Another good one is gstreamer, (http://www.gstreamer.net), the gst-launch program in particular, which allows you to build pipelines from the command line.
As for me, RTSP casting is the easiest way.
GStreamer can do a lot of stuff, but you cannot start RTSP server just with gst-launch. One needs to compile an own RTSP server from gst-rtsp package. Compiling one of gst-rtsp examples will do.