i get how to play a mp3 with python vlc no problem what i am trying to figure out is the best way to store a album and be able to call any song from the list of tuples or from the dictionary that the album is stored in..so for example i could store an album in a list of tuples ,then assign the songs to variables that could be called by the track titles, but this seems incorrect..
and here is the dictionary version this is the other way i was told to do it but I am not so sure as to how i am supposed to be able to point to the position of the stored mp3 file on the hdd for vlc to play when i call it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import vlc albums = [ ( "Abby road" , "The Beatles" , 1969 , [ ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/01-Come Together.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/02-Something.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/03 - Maxwells Silver Hammer.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/04 - Oh! Darling.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/05 - Octopuss Garden.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/06-I Want You .mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/07 - Here Comes The Sun.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/08 - Because.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/09 - You Never Give Me Your Money.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/10 - Sun King.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/11 - Mean Mr. Mustard.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/12 - Polythene Pam.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/13 - She Came In Through The Bathroom Window.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/14 - Golden Slumbers.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/15 - Carry That Weight.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/16 - The End.mp3" ), ( "/home/gr3yali3n/Music/The Beatles - Abbey Road/17 - Her Majesty.mp3" ), ] ), bathroom = albums[ 0 ][ 3 ][ 12 ] media = vlc.MediaPlayer(bathroom) media.play() |
1 2 3 4 5 6 |
albums = { "The beatles" : { "Abby Road" : [ "come together" , "something" , "maxwell's silver hammer" , "oh! darling" , "octopuss garden" , "i want you (shes so heavy)" , "here comes the sun" , "becdause" , "you neve give me your money" , "sun king" , "mean mr.mustard" , "polythene pam" , "she came in through the bathroom window" , "golden slumbers" , "carry that weight" , "the end" , "her majesty" ]}} |