feat: add script to adjust microphone volume to 100% on macOS, to avoid "auto adjusting"
This commit is contained in:
parent
dce5668934
commit
614293b68e
@ -13,6 +13,7 @@ Additionally I install next software, that is not (yet) presented in Brew:
|
|||||||
|
|
||||||
1. Install Brew from here: https://brew.sh/
|
1. Install Brew from here: https://brew.sh/
|
||||||
2. Copy Brewfile to your computer and run `brew bundle` from the same folder where you copied the file.
|
2. Copy Brewfile to your computer and run `brew bundle` from the same folder where you copied the file.
|
||||||
|
3. Run `chmod +x ./cron-adjust-microphone-gain-to-100.sh` and `./cron-adjust-microphone-gain-to-100.sh` [to change microphone gain to 100% on macOS](https://apple.stackexchange.com/questions/97810/mac-osx-microphone-input-volume-level-auto-adjusts-can-it-be-disabled).
|
||||||
|
|
||||||
Note: Brew will ask you for the root password and other apps inside Brewfile might ask you for your password as well.
|
Note: Brew will ask you for the root password and other apps inside Brewfile might ask you for your password as well.
|
||||||
Usually installation takes 10-20 min, so make sure to brew a cup of tea or coffee :)
|
Usually installation takes 10-20 min, so make sure to brew a cup of tea or coffee :)
|
||||||
|
19
cron-adjust-microphone-gain-to-100.sh
Executable file
19
cron-adjust-microphone-gain-to-100.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# If the microphone gain is less than 100, increase it by 3 every 0.1 seconds until it reaches 100
|
||||||
|
CRON_JOB="* * * * * while (( \$(osascript -e \"input volume of (get volume settings)\") < 100 )); do osascript -e \"set volume input volume (input volume of (get volume settings) + 3)\"; sleep 0.1; done;"
|
||||||
|
|
||||||
|
# Escape percent signs for cron
|
||||||
|
ESCAPED_CRON_JOB=$(echo "${CRON_JOB}" | sed 's/%/\\%/g')
|
||||||
|
|
||||||
|
# Backup current crontab (just in case)
|
||||||
|
CRONTAB_BACKUP=$(crontab -l)
|
||||||
|
|
||||||
|
# Check if the cron job already exists
|
||||||
|
if echo "${CRONTAB_BACKUP}" | grep -F -- "${CRON_JOB}" > /dev/null 2>&1; then
|
||||||
|
echo "Cron job already exists. Not adding again."
|
||||||
|
else
|
||||||
|
# Add the cron job to the crontab
|
||||||
|
(echo "${CRONTAB_BACKUP}"; echo "${ESCAPED_CRON_JOB}") | crontab -
|
||||||
|
echo "Cron job added."
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user