Skip to content

Commit

Permalink
Python Tkinter Build an MP3 player Update 4
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-emarquez committed Sep 20, 2020
1 parent d7fe3d1 commit b5f2fb3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Python TKinter Build An MP3 Player/buildAnMP3Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

root = Tk()

root.title("MP3 Player")
root.title("Reproductor MP3")
root.geometry("500x400")

# Initialize Pygame
Expand All @@ -27,7 +27,7 @@ def play_time():

# Reconstruct song with directory structure stuff
song = playlist_box.get(ACTIVE)
song = f'Python TKinter Build An MP3 Player/audio/{song}.mp3'
song = f'C:/mp3/audio/{song}.mp3'

# Find Current Song Length
song_mut = MP3(song)
Expand Down Expand Up @@ -80,7 +80,7 @@ def add_many_songs():
# Loop thru song list and replace directory structure and mp3 from song name
for song in songs:
# Strip out directory structure and .mp3 from song title
song = song.replace("C:/mp3/audio/", "")
song = song.replace("c", "")
song = song.replace(".mp3", "")
# Add To End of Playlist
playlist_box.insert(END, song)
Expand All @@ -103,8 +103,7 @@ def play():

# Reconstruct song with directory structure stuff
song = playlist_box.get(ACTIVE)
song = f'Python TKinter Build An MP3 Player/audio/{song}.mp3'

song = f'C:/mp3/audio/{song}.mp3'
#Load song with pygame mixer
pygame.mixer.music.load(song)
#Play song with pygame mixer
Expand Down

0 comments on commit b5f2fb3

Please sign in to comment.