Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Tiny app to compress MP3 files and put the result into a WAV container

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

  • Steve Hutchesson
    replied
    I am not sure why you are making comments in the source code only sub forum but with the source available and referring to ffmpeg, was there some point to the comment ?

    This is the preferred site for Windows versions at https://www.gyan.dev/ffmpeg/builds/ and get the full build one.

    Leave a comment:


  • Stuart McLachlan
    replied
    Note that this "tiny app" requires the presence of the 74.6.MB (as at current build) ffmpeg.exe command line tool, downloadable from https://ffbinaries.com/downloads

    Leave a comment:


  • Tiny app to compress MP3 files and put the result into a WAV container

    The resulting WAV file can be used with the API PlaySound().

    Code:
    ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    
        #compile exe "m2w.exe"
        #compiler pbcc
    
    ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    
     FUNCTION PBmain as LONG
    
        cmd$ = command$
    
        If cmd$ = "" Then
          StdOut $CRLF+"Input file must be an MP3 file, either on command line OR drag and drop of MP3 file"
          StdOut "Press any key ...."
          ! jmp bye
        End If
    
        If lcase$(right$(cmd$,4)) <> ".mp3" Then
          StdOut "File to convert must be an MP3 file"
          StdOut "Press any key ...."
          ! jmp bye
        End if
    
        bare$ = left$(cmd$,-4)
        outp$ = bare$+".wav"
    
        shell "ffmpeg -i "+cmd$+" -loglevel 0 -codec:a libmp3lame -q:a 9 -hide_banner xxxx.mp3"
        shell "ffmpeg -y -i xxxx.mp3 -c copy -f wav -hide_banner "+outp$
    
        kill "xxxx.mp3"
        cls
    
        cln$ = "cmd /c dir "+bare$+".*"
        shell cln$
    
      bye:
        waitkey$
    
     End FUNCTION
    
    ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Working...
X