xboxscene.org forums

Author Topic: Autoplay Mp3 - Hdd Or Mp3-cd  (Read 425 times)

juliecash

  • Archived User
  • Newbie
  • *
  • Posts: 5
Autoplay Mp3 - Hdd Or Mp3-cd
« on: December 26, 2004, 08:29:00 PM »

Hi Guys
I own no code, its all the coder's gold.

slight Modified the mp3-shuffler pythn script
import os, xbmc, xbmcgui

musicDir = "ur DVD/CD directory"   # change that !

playlist = xbmc.PlayList(1)

if playlist.size() == 0:

musicDir = "HDD directory"   # change that !

for root, dirs, files in os.walk(musicDir):
   for name in files:
      if name[-4:] == ".mp3":               
         playlist.add(os.path.join(root, name))


playlist.shuffle()
xbmc.Player().play(playlist) ## play the playlist


----------

use this script in autoplay script for xbmc.
well done.
thanks for the coder.
regards
julie.

Logged