Announcement

Collapse
No announcement yet.

How do I email mp3, not wav?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I email mp3, not wav?

    I wrote a script to email the phone message files (the built-in HS function won't work for me). My script works well, but it sends the .wav file. I would rather send the .mp3 - it is a much smaller file size.

    I have already enabled saving messages as mp3's, I just need to figure out how to select them as the attachment to the email. The following is an exerpt from the script:

    msgfile=hsp.MBFirstUnreadMessage(1,MB)
    ...
    lot of stuff in here
    ...
    attachment=hsp.GetAppPath & "\messages\" & msgfile

    I guess by default, msgfile will be the .wav file. How do I make the above two functions return the .mp3 file?

    Mark
    Mark

    Hometroller S6 w/ HS3Pro, Way2Call
    BLAB8SS, BL Backup, Easy Trigger, HSTouch, Open Sprinkler, SONOS, Ultra1Wire3, UltraM1G, WeatherXML, Z-Wave

    #2
    OK. I got no replies on this, so I had to "apply myself". I got a book on VBScript and after some searching I found the Replace function.

    msgfile=hsp.MBFirstUnreadMessage(1,MB)
    ...
    lot of stuff in here
    ...
    attach=hsp.GetAppPath & "\messages\" & msgfile
    attach=Replace(attach, ".wav", ".mp3")

    It works, but it seems TOO EASY.

    Mark
    Mark

    Hometroller S6 w/ HS3Pro, Way2Call
    BLAB8SS, BL Backup, Easy Trigger, HSTouch, Open Sprinkler, SONOS, Ultra1Wire3, UltraM1G, WeatherXML, Z-Wave

    Comment


      #3
      Mark,
      All you did is replace the wav extention with an mp3 extension but the file is still a wav file.
      -Rupp
      sigpic

      Comment


        #4
        Rupp-

        The file that I receive is indeed the mp3 from the \messages directory. Are you saying that the mp3 file in the \messages directory is technically not an mp3 file, but a wav with the wrong extension?

        It may be a moot point, because I seem to have achieved what I was after. I ran a test of the script both ways. The original script delivered the .wav file at 64 kbps with a file size of about 150 KB. The version with the "Replaced" extension delivered the ".mp3" file (real mp3 or not) at 16 kbps with a file size of around 45 KB. Much smaller file, but audio quality is still good.

        My mother-in-law leaves VERY long messages. If I used the original wav format, I'm sure the files would be in the MB range. And the last thing I want to do is wait for a download of a 3 MB email only to find out it's a message from her.

        I was questioning whether my somewhat "kludgey" method of selecting the mp3 file might eventually cause me problems. Is there a better way?

        Mark
        Mark

        Hometroller S6 w/ HS3Pro, Way2Call
        BLAB8SS, BL Backup, Easy Trigger, HSTouch, Open Sprinkler, SONOS, Ultra1Wire3, UltraM1G, WeatherXML, Z-Wave

        Comment

        Working...
        X