Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Mac OSX Terminal – Bash – Convert MP3 to M4R (iPhone Ringtone)

Posted on April 30, 2018 By David Kittell

If you have an MP3 that you’d like to use for your iPhone the script below will help you get that file into your ringtone options.

#!/bin/sh

#  ConvertMP3_To_iPhone.sh
#
#
#  Created by David Kittell on 4/30/18.
#

DIR=$1

mkdir -p $DIR/iPhone

cd $DIR
for f in *.mp3
do
  filename="$(basename -- "$f")"
  extension="${filename##*.}"
  filename="${filename%.*}"
  afconvert "$f" -o "iPhone/$filename.m4r" -f m4af -d aac
done
sh ConvertMP3_To_iPhone.sh /Users/MyUser/Desktop/sounds

Then you can copy the .m4r files into iTunes Tones directory/screen and sync with your phone.

All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code Mac OS X Shell Mac OSX UNIX UNIX Shell Scripts

Post navigation

Previous post
Next post

Related Posts

PowerShell – Backup Windows Drivers

Posted on March 18, 2020August 17, 2024

$DriverBackupPath = "$($env:USERNAME)\Downloads\DriverBackup\$($(Get-WmiObject -Class:Win32_ComputerSystem).Manufacturer)\$($(Get-WmiObject -Class:Win32_ComputerSystem).Model)" mkdir -p $DriverBackupPath -Force Export-WindowsDriver -Verbose -Destination $DriverBackupPath -Online Originally Posted on March 18, 2020Last Updated on August 17, 2024 All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system…

Read More

LDAP Dates Converted

Posted on July 25, 2013October 26, 2015

Dates that look like 127524839567199000 (pwdLastSet, accountExpires, lastLogonTimestamp, etc.) IF( B16>0 ,B16/864000000000 – 109205 ,"" ) Example: 130186556607343750 converts to 40921.80861 40921.80861 in Excel with cell formatting of Date/Time will show as January 13th, 2012 7:24 PM Dates that look like 20050210223453.0Z (whenChanged) DATEVALUE( CONCATENATE( (LEFT(TRIM(B9),4)) ,"-" ,(RIGHT(LEFT(TRIM(B9),6),2)) ,"-" ,RIGHT(LEFT(TRIM(B9),8),2)…

Read More

Azure – MSSQL Server Information

Posted on May 13, 2016

Same as MSSQL Server Information but is specific to what will work in Azure — Basic Information SELECT @@Servername AS [Server Name] –,@@ServiceName AS [Service Instance] ,Name AS [Database Name] ,create_date AS [Service Started] ,DATEDIFF(s, create_date, GETDATE()) / 86400.0 AS [Days Running] ,DATEDIFF(s, create_date, GETDATE()) AS [Seconds Runnig] ,@@VERSION AS…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes