last weekend my girlfriend wanted to set a new mp3 song as ringtone in her mobile phone. so she opened up her brand new sony vaio (chocked by preinstalled software) and tried to find the appropiate application for cropping an mp3. she didn't want to have a 4 min song as  ringtone, instead she wanted to create a new file with just a small portion (10-15sec) of the original song. at first she asked me "how can i do sth like this?" i replied "just open visual foxpro and i will show you"  she said  "aaahh you have overdone it with vfp! my super laptop is full of utilities, there must be something here for something so simple...". i said ok and i switched on the tv because brasil's match have just begun. 90 minutes later i found her trying while several windows lying on the screen. she couldn't find something so when i said "ok open visual foxpro" she gave up. i launched visual foxpro and immediately the command window appeared. i typed 5 commands:

lcfile = filetostr("c:\music\a.mp3")

lnfilelen = len(lcfile)

lnsizepersec = lnfilelen / 200 && 3.20 total song time in sec.

lcnewfile = substr(lcfile, lnsizepersec * 20, lnsizepersec * 15)

? strtofile(lcnewfile, "c:\music\new.mp3")

and voila! a new mp3 file was there as she wanted!

vfp does ringtones too!

ofcourse this really simple case has nothing extraordinary from programmer's view. everyone could create a similar "program" with its favourite programming tool but here there is a detail. i didn't create any program! all these commands were executed  directly from vfp's magical command window! 

 i have never seen a similar command window in any other language. if you know something that i have missed please let me know

p.s don't forget vfp can do anything you can imagine!

One Response to VFP does Mp3 too!

  • cesarchalom says:

    “and I switched on the tv because Brasil’s match have just begun”
    That match is something to be forgotten !

    Very cool Vassilis !
    Thanks for sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *