ejes consulting

Techincal Consulting Design and Automation

mp3-to-m4r.bat

This is a copy & paste batch file to convert mp3 files to iPhone ringtone (m4r) files using VLC player.

Copy and paste the below text into a new text file, rename it to “mp3-to-4r.bat” and drag an mp3 file onto it.

@echo off
FOR /R %%G IN (*.mp3) DO (CALL :SUB_VLC "%%G")
FOR /R %%G IN (*.mp3.m4a) DO (CALL :SUB_RENAME "%%G")
GOTO :eof

:SUB_VLC
 SET _firstbit=%1
 SET _qt="
 CALL SET _newnm=%%_firstbit:%_qt%=%%
 SET _commanm=%_newnm:,=_COMMA_%
 CALL "C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy -vvv %1 --sout="#transcode{acodec=mp4a,ab=128,channels=2}:standard{access=file,mux=mp4,dst=%_commanm%.m4a}" vlc://quit
GOTO :eof

:SUB_RENAME
 SET _origfnm=%1
 SET _endbit=%_origfnm:*.mp3=%
 CALL SET _newfilenm=%%_origfnm:.mp3%_endbit%=.m4r%%
 SET _newfilenm=%_newfilenm:_COMMA_=,%
 echo rename %1 to %1_newfilenm%
 COPY %1 %_newfilenm%
 DEL %1
GOTO :eof

:eof

Written by ejes

June 8, 2009 at 2:03 pm

One Response

Subscribe to comments with RSS.

  1. […] https://ejesconsulting.wordpress.com/scripts/mp3-to-m4r-bat/ Possibly related posts: (automatically generated)Download the iPhone RingtonesNo TitleRingtone Recorder Pro provides iPhones a roundabout route for ringtone captureHands On With The Sony Series-X Walkman […]


Comments are closed.

%d bloggers like this: