Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read/write MP3 tags
#23
It's not the best code but it works for me.

Macro MP3 Tags
Code:
Copy      Help
str spam1=" - www.SPAM.com"
str spam2="www.moreSPAM.com"

str sSpam.from(spam1 "|" spam2)

out
;typelib Id3Lib "id3com.dll"

Dir d
foreach(d "$desktop$\MP3\*.mp3" FE_Dir 0x4)
,str sPath=d.FileName(1)
,Rename_MP3Tag sPath sSpam

Function Rename_MP3Tag
Code:
Copy      Help
;/
function str'sPath str'sSpam

str s=sPath
if sPath.replacerx(sSpam)
,ren s sPath
out "--- %s ---" sPath

typelib Id3Lib "id3com.dll"

Id3Lib.ID3ComTag t._create
BSTR b=sPath
t.Link(&b)
;out t.NumFrames
Id3Lib.ID3ComFrame f
int i j
for i 0 t.NumFrames
,f=t.FrameByNum(i)
,;out f.FrameName
,Id3Lib.ID3ComField fi=f.Field(Id3Lib.ID3_FIELD_TEXT)
,;Id3Lib.ID3ComField fi=f.Field(Id3Lib.ID3_FIELD_DESCRIPTION)
,if(fi)
,,for j 1 fi.NumTextItems+1
,,,s=fi.Text(j)
,,,if s.replacerx(sSpam)
,,,,BSTR bs=s
,,,,fi.Text(j)=bs
,,,;s-"[9]"
,,,;out s
t.SaveV1Tag
t.SaveV2Tag


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)