Basically, it is a fix for macOS Dictation not working with external microphones (USB mics, AirPods, etc.) by automatically terminating corespeechd by running killall corespeechd every 3 hours in the background using LaunchAgents in macOS.
The easiest way to automate this process is by running the provided setup script.
-
Download the script or create it manually by saving the following as
setup_kill_corespeechd.sh:#!/bin/bash # Define the LaunchAgent path PLIST_PATH="$HOME/Library/LaunchAgents/com.user.killcorespeechd.plist" # Create the LaunchAgents directory if it doesn't exist mkdir -p "$HOME/Library/LaunchAgents" # Write the plist file cat <<EOF > "$PLIST_PATH" <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.user.killcorespeechd</string> <key>ProgramArguments</key> <array> <string>/usr/bin/killall</string> <string>corespeechd</string> </array> <key>StartInterval</key> <integer>10800</integer> <!-- 3 hours in seconds --> <key>RunAtLoad</key> <true/> </dict> </plist> EOF # Load the LaunchAgent launchctl load "$PLIST_PATH" # Enable the LaunchAgent for persistence across reboots launchctl enable user/$(id -u)/com.user.killcorespeechd # Check status launchctl list | grep com.user.killcorespeechd && echo "Service successfully installed and running." || echo "Failed to start service." echo "Setup complete. The corespeechd process will be terminated every 3 hours."
-
Make the script executable
chmod +x setup_kill_corespeechd.sh
-
Run the script
./setup_kill_corespeechd.sh
Run the following command to create and open a .plist file:
mkdir -p ~/Library/LaunchAgents
nano ~/Library/LaunchAgents/com.user.killcorespeechd.plistCopy and paste the following XML into the file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.killcorespeechd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/killall</string>
<string>corespeechd</string>
</array>
<key>StartInterval</key>
<integer>10800</integer> <!-- 3 hours in seconds -->
<key>RunAtLoad</key>
<true/>
</dict>
</plist>StartIntervalis set to 10,800 seconds (3 hours).RunAtLoadensures it runs immediately upon loading.
Save the file and run:
launchctl load ~/Library/LaunchAgents/com.user.killcorespeechd.plistTo make sure it persists across reboots, use:
launchctl enable user/$(id -u)/com.user.killcorespeechdVerify that it’s running with:
launchctl list | grep com.user.killcorespeechdIf you ever need to stop it, run:
launchctl unload ~/Library/LaunchAgents/com.user.killcorespeechd.plistIf you prefer using cron, add the following line to your crontab (crontab -e):
0 */3 * * * /usr/bin/killall corespeechd
This will execute the command every 3 hours.
- LaunchAgents is preferred for macOS since
cronhas been deprecated in favor oflaunchd. - If you encounter issues, check logs using:
log stream --predicate 'subsystem == "com.apple.launchservicesd"'
Let me know if you have any questions! 🚀