From ce91917ec1e80229ce2c0b6c20be6da2c5cb241f Mon Sep 17 00:00:00 2001
From: Prathima Kadari <74645302+prathimacode-hub@users.noreply.github.com>
Date: Sun, 11 Apr 2021 15:24:26 +0530
Subject: [PATCH 1/5] Create README.md
---
scripts/MusicPlayer/README.md | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 scripts/MusicPlayer/README.md
diff --git a/scripts/MusicPlayer/README.md b/scripts/MusicPlayer/README.md
new file mode 100644
index 0000000..d8c7083
--- /dev/null
+++ b/scripts/MusicPlayer/README.md
@@ -0,0 +1,21 @@
+**Project**
+
+This is a basic music player project which is used to play music.
+
+**Usage**
+
+Once we run it, we get a GUI with 2 buttons. 'Select Songs' and 'o'. We select a song through the 'Select Songs' button and 'o' button is used to start or stop the song.
+It supports Python3 and have used Pycharm for it.
+
+**Note**
+
+Audio files should be present in same folder as .py file is present.
+
+**Dependencies**
+
+Have to install library to get functional
+- pip install pygame (in command line terminal)
+
+**Screenshot**
+
+![MusicPlayer](https://github.com/prathimacode-hub/Basic_Music_Player/blob/main/MusicPlayer.png)
From efc1755e75406a9806e7a0c2157d74523df3609e Mon Sep 17 00:00:00 2001
From: Prathima Kadari <74645302+prathimacode-hub@users.noreply.github.com>
Date: Sun, 11 Apr 2021 15:25:07 +0530
Subject: [PATCH 2/5] Add files via upload
---
scripts/MusicPlayer/main.py | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 scripts/MusicPlayer/main.py
diff --git a/scripts/MusicPlayer/main.py b/scripts/MusicPlayer/main.py
new file mode 100644
index 0000000..40bd055
--- /dev/null
+++ b/scripts/MusicPlayer/main.py
@@ -0,0 +1,28 @@
+from tkinter import *
+import pygame
+import os
+from time import strftime
+window = Tk()
+pygame.mixer.init()
+n=0
+def start_stop():
+ global n
+ n=n+1
+ if n == 1:
+ song_name=songs_listbox.get()
+ pygame.mixer.music.load(song_name)
+ pygame.mixer.music.play(0)
+ elif (n%2)==0:
+ pygame.mixer.music.pause()
+ elif (n%2)!=0:
+ pygame.mixer.music.unpause()
+l1=Label(window,text="Prathima Music Player", font="times 18")
+l1.grid(row=1, column=1)
+b2=Button(window,text='o', command=start_stop)
+b2.grid(row=4, column=1)
+songs_list=os.listdir()
+songs_listbox=StringVar(window)
+songs_listbox.set("Select Songs")
+menu=OptionMenu(window, songs_listbox, *songs_list)
+menu.grid(row=4, column=4)
+window.mainloop()
\ No newline at end of file
From b94d40882b2f8af6aa4cc7a00842a1a130d4a1c8 Mon Sep 17 00:00:00 2001
From: Prathima Kadari <74645302+prathimacode-hub@users.noreply.github.com>
Date: Sun, 11 Apr 2021 15:34:27 +0530
Subject: [PATCH 3/5] Create README.md
---
scripts/README.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/README.md b/scripts/README.md
index 0a12b70..562935f 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -36,4 +36,7 @@ Your contribution should update this README with the following information, and
- pdf_merger
A pdf merger to combine multiple PDFs into a single PDF.
[Anshul Hajare](https://github.com/AnshulH)
+- MusicPlayer
+ A music player to select songs and play music.
+ [Prathima Kadari](https://github.com/prathimacode-hub)
From a53a7b698eed184c1782b2a88e5297f1154eb87d Mon Sep 17 00:00:00 2001
From: Prathima Kadari <74645302+prathimacode-hub@users.noreply.github.com>
Date: Sun, 11 Apr 2021 15:37:02 +0530
Subject: [PATCH 4/5] Create README.md
From 977e9f180010db534d227034657d816c8b132ff3 Mon Sep 17 00:00:00 2001
From: Prathima Kadari <74645302+prathimacode-hub@users.noreply.github.com>
Date: Sun, 11 Apr 2021 15:37:28 +0530
Subject: [PATCH 5/5] Create README.md