A Python bot that automates joining Google Meet meetings and plays audio during the session.
- Automatically joins a specified Google Meet meeting as a guest
- Plays audio through the meeting using virtual audio routing.
- Python 3.x
- Required Python packages (listed in
requirements.txt):- playwright
- python-dotenv
- (any other dependencies)
-
Clone the repository:
git clone https://github.com/yourusername/google-meet-bot.git cd google-meet-bot -
Set up a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `.\venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory and add your meeting link:GOOGLE_MEET=your_meeting_link
To route audio through Google Meet using BlackHole, follow these steps:
-
Download BlackHole:
- Go to the BlackHole GitHub page.
- Click on the "Releases" section and download the latest version (usually a
.dmgfile).
-
Install BlackHole:
- Open the downloaded
.dmgfile. - Follow the installation instructions:
- Drag the BlackHole icon to your Applications folder.
- Open the downloaded
-
Open Audio MIDI Setup:
- Go to
Applications > Utilities > Audio MIDI Setup.
- Go to
-
Create an Aggregate Device:
- Click the "+" button in the bottom left corner and select Create Aggregate Device.
- In the right panel, check both your microphone (the physical one you use) and BlackHole 2ch.
- This allows you to use your microphone while also routing audio through BlackHole.
-
Set BlackHole as Default Input:
- Go to
System Preferences > Sound. - Under the Input tab, select BlackHole 2ch.
- Go to
-
Set Your Output Device:
- Under the Output tab, select your regular speakers or headphones.
- If you want to hear the audio yourself while it plays in Google Meet, you can create a Multi-Output Device that includes both BlackHole and your speakers:
- In Audio MIDI Setup, click the "+" button and select Create Multi-Output Device.
- Check both BlackHole 2ch and your regular output device.
-
Open Google Meet:
- Join a meeting.
-
Select BlackHole as Microphone:
- Click on the three dots in the bottom right corner of the Meet window.
- Go to Settings > Audio.
- Set the microphone to BlackHole 2ch.
-
Play Audio:
- Use your bot to play audio. Ensure that the audio is routed through BlackHole.
- For example, in your bot code, you might have:
os.system(f'afplay {audio_path}') # This plays the audio through BlackHole
-
Check in Google Meet:
- Ask someone in the meeting if they can hear the audio.
- Adjust the volume as necessary.
To route audio through Google Meet using VB-Audio Virtual Cable, follow these steps:
-
Install VB-Audio Virtual Cable:
- Download from the VB-Audio website.
- Follow the installation instructions.
-
Set Up Virtual Cable:
- Set the virtual cable as your default playback device in your sound settings.
- Ensure that Google Meet is set to use the virtual cable as the microphone.
To route audio through Google Meet using PulseAudio, follow these steps:
-
Install PulseAudio:
- Most Linux distributions come with PulseAudio pre-installed. If not, install it using your package manager.
- For example, on Ubuntu, you can run:
sudo apt-get install pulseaudio
-
Set Up Loopback:
- Use the
pactlcommand to create a loopback from your audio output to the microphone input:pactl load-module module-loopback
- Use the
-
Configure Google Meet:
- Ensure that Google Meet is set to use the PulseAudio input as the microphone.
-
Run the bot:
python src/bot.py
-
Audio Playback:
- Ensure that the audio file you want to play is in the correct format (e.g., .mp3 or .wav) and located in the specified directory.
- If you encounter issues with audio not being heard in Google Meet, ensure that:
- The correct virtual audio device is set as the microphone input in Google Meet settings.
- The audio file is playing correctly through the bot.