Results 1 to 7 of 7
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    Converting a WAV file to MP3 from VBA

    I've found several posts online as to how to convert WAV files to MP3 using 3rd party UIs, but would like to be able to accomplish the task via a SHELL interface or a similar fashion.
    I don't believe there's a Windows FSO option that would copy/convert, so I'm assuming I'm still up against a 3rd party app of some kind?
    Thoughts?
    Thanks,
    Bill

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    Thanks. I did see the references to LAME but shied away when I saw the requirement needing to deal with C++ distribution of the code.

  4. #4
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    309
    Please click on the ⭐ below if this post helped you.


  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    I'll investigate and run some tests. I assume from a quick look I can SHELL with a ffmpeg command string.

  6. #6
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    309
    Yes, you could shell those. Give it a shot.
    Please click on the ⭐ below if this post helped you.


  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    ffmpeg works as advertised. First attempt failed without any indication as to what the error might be, I had attempted to create "C:\Beethoven.mp3". I had to run the same command string from the Windows "Run app" to discover the permission error, as ffmpeg could not create a file in the root of "C:".

    Windows "flashes" the screen when ffmpeg runs, so I need to somehow suppress that? Any suggestions? (It's been awhile since my DOS days )

    Code:
    Option Compare Database
    Option Explicit
    Dim strShell As String
    Dim shellret As Variant
    
    
    Private Sub PlayWav()
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    
    
    strShell = "c:\TMS\ffmpeg\ffplay.exe " & "C:\TMS\ffmpeg\Beethoven.mp3"
    shellret = Shell(strShell, 4)
    
    
    End Sub
    
    
    Private Sub WavToMP3()
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    
    
    strShell = "c:\TMS\ffmpeg\ffmpeg.exe " & " -i C:\Beethoven.wav -ar 44100 -ac 2 -b:a 192k C:\TMS\ffmpeg\Beethoven.mp3"
    shellret = Shell(strShell, 4)
    
    
    End Sub
    (PS) Beethoven.wav is just the first few bars of his 5th symphony. I've uploaded that snip to my iPhone and associated that ringtone with my mistress. Needless to say, that if I forget to set my phone to vibrate when I attend a meeting and she calls, everyone in the room knows who the idiot is .

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Placing mp3 file in text box
    By Jaap in forum Access
    Replies: 27
    Last Post: 09-23-2024, 09:56 AM
  2. How to get Metadata from .wav file into Access ?
    By edmscan in forum Programming
    Replies: 3
    Last Post: 12-31-2016, 01:21 PM
  3. Replies: 12
    Last Post: 03-01-2015, 01:00 PM
  4. Specified .WAV file not playing on Form Open
    By ANTHROPOIDLUVA in forum Forms
    Replies: 10
    Last Post: 05-31-2012, 11:57 PM
  5. how to play mp3 direct from database
    By sean in forum Access
    Replies: 0
    Last Post: 10-20-2009, 08:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums