Sending System Audio to Google Meet

In 2013, I wrote up how to record Google Hangouts in high quality for podcasting or whatever. This post is how to essentially do the same, but for piping audio into Google Meet from any source on your computer.

Just like before, this article is written for Mac OS because that's what I have. If you know of how to do this on Windows or Linux, leave a comment.

Stuff to install

We'll still be using Ladiocast and Soundflower.

Sound settings

Open up System Preferences and go to Sound. Set:

  • Output: Soundflower 2ch
  • Input: Soundflower 64ch

Ladiocast Settings

Open Ladiocast and set:

  • Input 1: Soundflower 2ch (get the computer audio)
  • Input 2 (optional): Your microphone
  • Main Output: Soundflower 64ch
  • Aux Output (optional): Built-in output

Google Meet settings

In your Google Meet, open up your sound settings.

  • Input: Soundflower 2ch
  • Output: Sounndflower 2ch

Ladiocast takes all of your inputs and mixes them into one track that can be sent somewhere. This is a little wonky because we're taking system output, sending it through Ladiocast to get a new input, and then piping that into the Meet. If you set it up right, you should be able to play any audio and hear it from your Google Meet.

Add a Google Meet to Calendar Events with Google Apps Script

My small team relies on automation to make things run. Part of our PD process is a Google Form workflow that kicks off calendar events, document creation, and email notifications. Since we've moved to online learning, we wanted to update that process to automatically add a Google Meet link for any PD that doesn't have to be in person.

This is important for us so we have consistency and maintainability built in. Taking variability out of event creation and management allows us, as a team of two, to make sure all PD in the district is accessible from anywhere, recordings archvied for later, and a full record of all events run in a given time period.

There are some official Google guides that show how to attach a Meet event to the Calendar, but nothing from the perspective of Apps Script specifically, so that's what I'll show here.

The Setup

Before you start, this relies on the advanced Calendar service. So, you'll need to go into your project, click on Resources > Advanced Google Services and then enable the Calendar v3 API in the project and the cloud console.

Enabling the advance service will give you access to the Calendarobject which can take object arguments, which is what you need to for the Meet attachment.

Data Structure

We use a Google Form to populate a spreadsheet of events. I won't go into how that data is collected or processed, so let's assume we have an object which represents values we'll use in the Calendar event:

const obj = {
    "eventId": "abc123",
    "title": "Some event",
    "description": "Let's do stuff in a Meet",
    "start": "2020-06-01T13:00:00",
    "end": "2020-06-01T14:00:00"
}

To create an event with the Calendar advanced service, we need to build a payload object to send with the request with details for the calendar event:

const payload = {
    "start": {
        "dateTime": obj.start,
        "timeZone": "America/Indiana/Indianapolis",
    },
    "end": {
        "dateTime": obj.end,
        "timeZone": "America/Indiana/Indianapolis",
    },
    "conferenceData": {
        "createRequest": {
            "conferenceSolutionKey": {
                "type": "hangoutsMeet"
            },
            "requestId": obj.eventId,
        },
    },
    "summary": obj.title,
    "description": obj.description
}

The only required parameters are the start and end keys. I also defined my time zone instead of manually adding a time offset, but that's for another post.

Notice the new confereceData ket in the middle of the payload. We define a new request for a Meet and set the conferenceSolutionKey.type value to hangoutsMeet. Other valid values are eventHangout for consumers and eventNamedHangout if you haven't enabled Google Meet in your GSuite domain.

Each request needs a requestId value, so I just use the eventId I already have generated, but it can be any valid string.

Finally, we need to set one more argument before we send the request: { "conferenceDataVersion": 1}. This allows that attached Meet to be modified if necessary.

Create the Event

This method uses the insert endpoint on the Calendar service. This takes three arguments: your payload, a Google Calendar ID (as a string), and any additional arguments. You can programatically get Calendar IDs, but we only post to one calendar, so I copied/pasted from the account we're using and set it as a variable.

In your Apps Script project, you can now do something like this:

function demo() {
    const payload = { ... }
    const arg = { "conferenceDataVersion": 1 }

    try {
        const response = Calendar.Events.insert(payload, "yourCalendarID", args)
        console.log(`Success! ${response}`)
        // Do more with the object, like write the event ID or URL back to the sheet for reference, etc.
    } catch(e) {
        console.log(`Oh no: ${e.message}`)
    }
}

If all goes well, you should now have a calendar event with an attached Meet.