Skip to content

Instantly share code, notes, and snippets.

@navinpai
Created November 23, 2011 16:14
Show Gist options
  • Save navinpai/1389090 to your computer and use it in GitHub Desktop.
Save navinpai/1389090 to your computer and use it in GitHub Desktop.
Convert M4A to MP3 With VLC
@ECHO OFF
REM Use this to convert m4a's to mp3's using VLC (http://www.videolan.org/vlc/).... Had to find this to convert songs
REM downloaded with https://github.com/navinpai/8Tracks-Downloader :P :)
:START
FOR /R %%G IN (*.m4a) DO (CALL :SUB_VLC "%%G")
FOR /R %%G IN (*.m4a.mp*) DO (CALL :SUB_RENAME "%%G")
FOR /R %%G IN (*.m4a) DO (del "%%G")
sleep 1000
GOTO :START
GOTO :eof
:SUB_VLC
SET _firstbit=%1
SET _qt="
CALL SET _newnm=%%_firstbit:%_qt%=%%
SET _commanm=%_newnm:,=_COMMA_%
REM echo %_commanm%
CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc" -I dummy -vvv %1 --sout=#transcode{acodec="mp3",ab="192","channels=2",samplerate="44100"}:standard{access="file",mux="raw",dst="%_commanm%.mp3"} vlc://quit
GOTO :eof
:SUB_RENAME
SET _origfnm=%1
SET _endbit=%_origfnm:*.m4a=%
CALL SET _newfilenm=%%_origfnm:.m4a%_endbit%=.mp3%%
SET _newfilenm=%_newfilenm:_COMMA_=,%
COPY %1 %_newfilenm%
DEL %1
GOTO :eof
:eof
REM Use this to convert m4a's to mp3's using VLC (http://www.videolan.org/vlc/).... Had to find this to convert songs
REM downloaded with https://github.com/navinpai/8Tracks-Downloader :P :)
@ECHO OFF
FOR /R %%G IN (*.m4a) DO (CALL :SUB_VLC "%%G")
FOR /R %%G IN (*.m4a.mp*) DO (CALL :SUB_RENAME "%%G")
GOTO :eof
:SUB_VLC
SET _firstbit=%1
SET _qt="
CALL SET _newnm=%%_firstbit:%_qt%=%%
SET _commanm=%_newnm:,=_COMMA_%
REM echo %_commanm%
CALL "C:\Program Files (x86)\VideoLAN\VLC\vlc" -I dummy -vvv %1 --sout=#transcode{acodec="mp3",ab="512","channels=2"}:standard{access="file",mux="raw",dst="%_commanm%.mp3"} vlc://quit
GOTO :eof
:SUB_RENAME
SET _origfnm=%1
SET _endbit=%_origfnm:*.m4a=%
CALL SET _newfilenm=%%_origfnm:.m4a%_endbit%=.mp3%%
SET _newfilenm=%_newfilenm:_COMMA_=,%
COPY %1 %_newfilenm%
DEL %1
GOTO :eof
:eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment