Skip to content

Instantly share code, notes, and snippets.

@mhawksey
Created March 17, 2018 16:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhawksey/a27b46bc3a244ac5cbde221b2af3d798 to your computer and use it in GitHub Desktop.
Save mhawksey/a27b46bc3a244ac5cbde221b2af3d798 to your computer and use it in GitHub Desktop.
Code snippets for Recording .mp3 audio in Google Add-ons/Google Apps Script to Google Drive https://mashe.hawksey.info/?p=17916
blobToDataURL(blob, function(url){
var filename = 'recording_' +
(new Date()) +
'_.mp3';
google.script.run.withSuccessHandler(function(driveUrl){
$('ol.convertedList')
.append('<li><strong> ' + filename +
'</strong> <a href="'+driveUrl+'" target="_blank">Drive Link</a><br/>' +
'<audio controls src="' + url + '"></audio>' +
'</li>');
}).invokeSave(url, filename);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment