Hello,
I'm using a bash script to execute a Python program that includes the following code:
print(f"Recording for {duration} seconds...")
audio_data = sd.rec(int(duration * samplerate), samplerate=samplerate, channels=1)
sd.wait() # Wait until recording is finished
sf.write(filename, audio_data, samplerate)
print(f"Recording saved as {filename}")
When I run the python script from terminal the audio records fine, but when I try to run the script using an Alfred shortcut and workflow no audio is recorded.
I'm guessing this is because Alfred doesn't have recording permissions but I have tried and failed to find a way to trigger the permission request, and any help would be appreciated 🙏