playing sound with google script

google sounds
google assistant sound effect
google apps script
google sheet script
google apps script reference
google sheets
google docs audio
record audio in google docs

Is there an easy way to incorporate a sound file into a Google Apps Script? I have seen a posting to try the following:

var audio = new Audio("alert.ogg");;

I get the error:

ReferenceError: "Audio" is not defined

Here's a simple example that embeds a music player into a document sidebar:
var SIDEBAR_TITLE = 'Sidebar Musicbox';

 * Adds a custom menu with items to show the sidebar and dialog.
 * @param {Object} e The event parameter for a simple onOpen trigger.
function onOpen(e) {
      .addItem('Show sidebar', 'showSidebar')

 * Runs when the add-on is installed; calls onOpen() to ensure menu creation and
 * any other initializion work is done immediately.
 * @param {Object} e The event parameter for a simple onInstall trigger.
function onInstall(e) {

 * Opens a sidebar. The sidebar structure is described in the Sidebar.html
 * project file.
function showSidebar() {
  var ui = HtmlService.createTemplateFromFile('Sidebar')
<!-- Use a templated HTML printing scriptlet to import common stylesheet -->
<?!= HtmlService.createHtmlOutputFromFile('Stylesheet').getContent(); ?>

<div class="sidebar branding-below">
    A little music for your enjoyment!
    <audio id="player" controls>
      <source src="" type="audio/mpeg">
      Your browser does not support the audio element.
    <div id="sidebar-status"></div>

<div class="sidebar bottom">
  <span class="gray branding-text">Docs Add-on Sound Demo</span>
<!-- This CSS package applies Google styling; it should always be included. -->
<link rel="stylesheet" href="">

#player {
 width: 95%;

How do I insert audio on a Google Sheet?, r/googlesheets: A subreddit for collaborating and getting help with Google Sheets​. Unofficial. The sound library contains categorized sounds that you can use to enhance the user experience and increase the polish of your actions. Google hosts these sounds for you, so all you need to do is

sure - this works

  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <audio id="audio_01" controls autoplay hidden="hidden">
  <source src="SHAKUHACHI_Masayuki_Koga_trim_mono-IMi00aV1tdA.mp3" type="audio/mpeg">
      Your browser does not support the audio element


    var my_audio_01 = document.getElementById("audio_01");


or this simpler version also works

  <audio controls autoplay hidden="hidden">
    <source src="SHAKUHACHI_Masayuki_Koga_trim_mono-IMi00aV1tdA.mp3" type="audio/mpeg">
      Your browser does not support the audio element

Playing sounds? : googlesheets, function playAudio(assistant) { let text_to_speech = '<speak>' + 'I can play a sound' + '<audio src="  Open the Google Play Store app . Search for "Google". If it's not already installed, tap Install. Once you have the Google Search App: On your device, touch and hold the Home screen. Tap Widgets.

Sound Library | Conversational Actions, Play a sound when a cell in column H changes to "Call" on the sheet "Support". This function will need to run every 5min. Does the sound need  Autoplay When autoplay is enabled, a suggested video will automatically play next. Up next How to add audio to Google Slides and share it in Google Classroom - Duration: 6:11.

Recording .mp3 audio in Google Add-ons/Google Apps Script to , Having previously played around with WebRTC I knew capturing audio from the browser was possible but hadn't looked at processing it. As it  Configuring Google Drive to Play Audio Files Natively - Duration: 2:11. Eric Callis 27,302 views

Applying Conditional Formatting (with sound), The equivalent to Excel VBA is Google Apps Script which is based on JavaScript. Unfortunately they don't include a class for sounds. Play Music Directly from Google Drive Log in to your Google Drive and find the music file you want to play and right-click it. In the menu that comes up, click “Open with” and then the “Connect

How to set Audio alert in Google spreadsheet that triggers by a , Sound player console and background music scripts for HTML websites or web templates. Includes fallback code for older browsers. See Also… Sell mp3  Free radio for everything you do. Store 50,000 tracks from your personal collection. Subscribe for on-demand access to 40 million songs and offline listening.