Save Google Voice messages to Google Drive as MP3

When you have a message on your voicemail, to a phone number that is linked to your account at Google Voice, you receive an email notification to your Gmail account along with a link so you can hear the audio message on your phone or computer. Below we will post a script that will enable you to automatically save this voice messages to your Google Drive as MP3 files.

Google Voice

The web application was developed by Amit Agarwal (amit [at] labnol.org) and scans your Gmail mailbox for any voicemail messages from Google Voice. Once discovered, it saves the sound to a specific folder on your Google Drive. The application converts voicemail messages into the MP3 file, and lets you search for them through Google Drive.

To get started, Click here για να επιτρέψετε στην εφαρμογή να έχει πρόσβαση στους λογαριασμούς σας στο Gmail και το Google Drive. Στην επόμενη σελίδα, κάντε on of Google Voice and wait for the application to prepare. That's it. The app will run in the background and monitor your Gmail account for any messages from Google Voicemail.

It will create a new folder called Google Voice in your Google Drive and store all the MP3 files it will convert from your voicemail. Also, whenever a voice message is received in your Gmail, it will show a new tag called MP3 to prevent the app from re-processing it.

Below is the source code of the application. You can stop the script at any time by using the uninstall link you received on your Gmail when you authorized the app.

  1. / * Written by Amit Agarwal amit@labnol.org * /
  2. / * Tutorial: http://www.labnol.org/?p=25153 * /
  3.  
  4. var folder, folder_name =Google Voice;
  5. var archive, gmail_label ="MP3";
  6.  
  7. / * Find Google Voice messages in Gmail * /
  8.  
  9. var filter =“From: voice-noreply@google.com -label:”+ gmail_label;
  10. var threads =GmailApp.search(filter,0,10);
  11.  
  12. if(threads.length){
  13. / * Google Drive folder where MP3 files will be stored * /
  14. var =DriveApp.getFoldersByName(folder_name);
  15. folder = folders.hasNext()? folders.Next():DriveApp.createFolder(folder_name);
  16. / * Gmail Label that is applied to processed voice mails * /
  17. archive =GmailApp.getUserLabelByName(gmail_label)?
  18. GmailApp.getUserLabelByName(gmail_label):GmailApp.createLabel(gmail_label);
  19. for(var x=0; xthreads.length; x+){
  20. threads[x].addLabel(archive);
  21. var msg = threads[x].getMessages() [0];
  22. / * Find the link to play the voice mail message * /
  23. var url = msg.getBody().match(/https?:\/\/www.google.com\/voice\/fm[^\ `]*/gi);
  24. if(url){
  25. / * Find the name of the voice sender (or their phone number) * /
  26. var file_name = msg.getSubject().match(/ new voicemail from (. *) at /i);
  27. / * Add the voice mail to the file name * /
  28. var file_date =Utilities.formatDate(
  29. msg.getDate().getScriptTimeZone()"Yyyy-MM-dd HH: mm");
  30. if(file_name){
  31. / * Extract the audio file and save as a MP3 file * /
  32. var mp3 = url[0].replace(“/ Voice / fm /”,“/ Voice / media / svm /”);
  33. var fillet = folder.createFile(UrlFetchApp.fetch(mp3).getBlob());
  34. / * Save the voice mail transcript with the audio file * /
  35. fillet.setName(file_name[1]+”[“+ file_date +"]"+“.Mp3”);
  36. fillet.setDescription(msg.getPlainBody());
  37. }
  38. }
  39. }
  40. }
[*] The script runs every 15 minutes and processes 10 voicemail messages each time starting with the most recent ones. If you have too many old voice messages in your Gmail, it may take a while to process them all.
[**] The web application requires permissions to access your Gmail and Google Drive. The source code of the application will convince you that the application is secure. If the Web App is not believed to be running with the above code, just make a copy of the above code on your Google Drive and run it manually.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.082 registrants.

Written by giorgos

George still wonders what he's doing here ...

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).