xboxscene.org forums

Author Topic: Xbmc Auto Play Mp3 At Boot  (Read 50 times)

yellowfellow

  • Archived User
  • Newbie
  • *
  • Posts: 4
Xbmc Auto Play Mp3 At Boot
« on: July 29, 2004, 02:19:00 PM »

Sorry if this has been ask, but is there a way, (script maybe) for xbmc to play mp3 from hd upon boot.  Kind of like with avalaunch and unleash.  Thanks.
Logged

yellowfellow

  • Archived User
  • Newbie
  • *
  • Posts: 4
Xbmc Auto Play Mp3 At Boot
« Reply #2 on: July 29, 2004, 08:13:00 PM »

Thanks for the link jaydee.  the mp3 scripts only play one song, then stops and not continous (meaning randomly loading mp3s after another when one is done). except for the play list one, but i'm limited to my playlist only.  But I guess that'll do for now until another script is written.
Logged

nimbles

  • Archived User
  • Hero Member
  • *
  • Posts: 513
Xbmc Auto Play Mp3 At Boot
« Reply #3 on: July 29, 2004, 09:34:00 PM »

this is the one i use which selects playlists at random, and shuffles the the playlist on start up too- i didn't write it though not sure if it is up at the xbmc site or not

CODE
# Lit une playlist aleatoirement
###################################################################
# Ce code est les propriété de [email protected]
#
# version 0.1
#
###################################################################


import os.path, string
import glob, random
import xbmc, xbmcgui

filename = []
Repertoire =  'Q:\\albums\\playlists'

def listRep ( args, dirname, filenames ):
    global filename
    filename[:0] = glob.glob(dirname + '\*.m3u')
 
os.path.walk(Repertoire, listRep, None )
a = len(filename)
if a > 0:
    nb = random.randint(0,a-1)
    pls = xbmc.PlayList(0)
    pls.load(filename[nb])
    pls.shuffle()
    xbmc.Player().play(pls)
else:
   dialog = xbmcgui.Dialog()
   dialog.ok(" Error", " No list found")


Just remember to edit the path to your playlists- the script i've got is called "RandomPlay.py"

copy the code paste it in notepad and saves a whatever.py, but then change the autoexec.py to reference whatever.py

HTH

This post has been edited by nimbles on Aug 5 2004, 10:42 AM
Logged

changes13

  • Archived User
  • Newbie
  • *
  • Posts: 9
Xbmc Auto Play Mp3 At Boot
« Reply #4 on: July 29, 2004, 11:55:00 PM »

qiute a learning curve here.  Im starting to customize my xbmc as well.  Where do i find the autoexec.py ?

If I have to create this file in my python directory, what would the format of this file be?   <_<

Thanks in advance for any help.
Logged

ynwa

  • Archived User
  • Newbie
  • *
  • Posts: 37
Xbmc Auto Play Mp3 At Boot
« Reply #5 on: August 09, 2004, 08:29:00 AM »

Do you need to have XBMC as your dash to do the random play on startup. I like the way avalaunch does it, but it really is background music, ie, volume too low.
Logged

nimbles

  • Archived User
  • Hero Member
  • *
  • Posts: 513
Xbmc Auto Play Mp3 At Boot
« Reply #6 on: August 09, 2004, 09:45:00 AM »

no- it will do it whenever load xbmc either as a dash or an app
Logged