Arcade Voyage: Language, Voice, and Multimodal Processing | GSP222

Solution for Arcade Voyage: Language, Voice, and Multimodal Processing | GSP222. 1 lab: GSP222. Fast copy-paste commands for Google Cloud.

GSP222 — It Speaks! Create Synthetic Speech Using Text-to-Speech

Estimated time: 10 minutes

# 🚀 It Speaks! Create Synthetic Speech Using Text-to-Speech | GSP222 > ⚠️ **Disclaimer:** This is an independent, community-made walkthrough created for educational purposes, hands-on practice, and Google Cloud certification preparation. This guide is designed to help learners understand Google Cloud Text-to-Speech and create synthetic speech from text through practical exercises. Always attempt the lab yourself first and follow Google Cloud Skills Boost / Qwiklabs Terms of Service. This walkt

clear
# Define color variables
RED_TEXT=


\033[0;91m'
GREEN_TEXT=


\033[0;92m'
YELLOW_TEXT=


\033[0;93m'
BLUE_TEXT=


\033[0;94m'
CYAN_TEXT=


\033[0;96m'
RESET_FORMAT=


\033[0m'
BOLD_TEXT=


\033[1m'
UNDERLINE_TEXT=


\033[4m'

# Welcome Banner
echo "${CYAN_TEXT}${BOLD_TEXT}╔════════════════════════════════════════════════════════╗${RESET_FORMAT}"
echo "${CYAN_TEXT}${BOLD_TEXT}             ORBIT OF OPS - TEXT TO SPEECH LAB           ${RESET_FORMAT}"
echo "${BLUE_TEXT}${BOLD_TEXT}          Elevating your Cloud and DevOps Journey        ${RESET_FORMAT}"
echo "${CYAN_TEXT}${BOLD_TEXT}╚════════════════════════════════════════════════════════╝${RESET_FORMAT}"
echo
echo "${GREEN_TEXT}${BOLD_TEXT}🚀 === INITIATING AUTOMATION SEQUENCE ===${RESET_FORMAT}"
echo

echo "${YELLOW_TEXT}--> Authenticating and setting Project ID...${RESET_FORMAT}"
export PROJECT_ID=$(gcloud config get-value project)
echo "${GREEN_TEXT}Project ID set to: $PROJECT_ID${RESET_FORMAT}"
echo

echo "${YELLOW_TEXT}--> Enabling Text-to-Speech API...${RESET_FORMAT}"
gcloud services enable texttospeech.googleapis.com --quiet
echo

echo "${YELLOW_TEXT}--> Installing and configuring Python Virtual Environment...${RESET_FORMAT}"
sudo apt-get update -y -q
sudo apt-get install -y virtualenv
python3 -m venv venv
echo "${GREEN_TEXT}Virtual environment created.${RESET_FORMAT}"
echo

echo "${YELLOW_TEXT}--> Creating Service Account 'tts-qwiklab'...${RESET_FORMAT}"
gcloud iam service-accounts create tts-qwiklab --quiet
echo

echo "${YELLOW_TEXT}--> Generating Service Account Keys...${RESET_FORMAT}"
gcloud iam service-accounts keys create tts-qwiklab.json --iam-account tts-qwiklab@$PROJECT_ID.iam.gserviceaccount.com --quiet
echo

# Completion Banner
echo "${CYAN_TEXT}${BOLD_TEXT}╔════════════════════════════════════════════════════════╗${RESET_FORMAT}"
echo "${GREEN_TEXT}${BOLD_TEXT}             ALL TASKS COMPLETED SUCCESSFULLY             ${RESET_FORMAT}"
echo "${CYAN_TEXT}${BOLD_TEXT}╚════════════════════════════════════════════════════════╝${RESET_FORMAT}"
echo
echo "${BLUE_TEXT}${BOLD_TEXT}🚀 Keep exploring the Orbit of Ops${RESET_FORMAT}"
echo "${RED_TEXT}${BOLD_TEXT}${UNDERLINE_TEXT}https://www.youtube.com/@orbitofops${RESET_FORMAT}"
echo "${CYAN_TEXT}${BOLD_TEXT}Please Subscribe to the channel for more Cloud and DevOps videos${RESET_FORMAT}"
echo "${CYAN_TEXT}${BOLD_TEXT}Don't forget to Like, Share and Subscribe${RESET_FORMAT}"
echo

echo "${YELLOW_TEXT}${BOLD_TEXT}⚠️ CRITICAL: To finish the lab setup in your active shell, copy and paste these two lines manually:${RESET_FORMAT}"
echo "${CYAN_TEXT}source venv/bin/activate${RESET_FORMAT}"
echo "${CYAN_TEXT}export GOOGLE_APPLICATION_CREDENTIALS=tts-qwiklab.json${RESET_FORMAT}"