This script is really not fancy enough. Modification and additions are most welcome.
#! /usr/bin/python2.4
# script to convert mp3 files to ogg files this
# script depends on the mp32ogg tool for the conversion
# is just a script that accept path to mp3 files then
# calls the mp32ogg tool to converts
import os
# to collect vaules
def mp3Convertor( directory_path ):
#path to directory containing the mp3 files
source_directory = directory_path+'/*.mp3'
#directory to contain the ogg files
#the same as the source directory
#using the mp32ogg tool to convert the mp3 files
# ogg files
oggtool = "mp32ogg %s" % ( source_directory )
if os.system( oggtool ) == 0:
print 'The mp3 files has successfully been converted'
else:
print oggtool
#get path to the mp3 files from the user
source_path = raw_input('Enter path to mp3 files')
if len( source_path ) == 0:
print 'Please enter path to mp3 files'
else:
mp3Convertor( source_path )
No comments:
Post a Comment