-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththread_music.py
More file actions
34 lines (30 loc) · 1.25 KB
/
Copy paththread_music.py
File metadata and controls
34 lines (30 loc) · 1.25 KB
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
29
30
31
32
33
34
import threading
from mpyg321.MPyg123Player import MPyg123Player
from decode_frames import decode_frames
from create_password_protected_zip import create_password_protected_zip
from upload import upload_video_to_youtube
def play_music(song_name):
player = MPyg123Player()
music_file = song_name
player.play_song(music_file)
# Function to perform encoding
def perform_encoding(input_file, password):
# Start the music thread before encoding
music_thread = threading.Thread(target=play_music('./songs/Blue Swede, Björn Skifs - Hooked On A Feeling.mp3'))
music_thread.start()
create_password_protected_zip(input_file, password)
# Wait for the music thread to finish
music_thread.join()
# Function to perform decoding
def perform_decoding(input_file):
# Start the music thread before decoding
music_thread = threading.Thread(target=play_music('./songs/Rainbow - Since You Been Gone.mp3'))
music_thread.start()
decode_frames(input_file)
# Wait for the music thread to finish
music_thread.join()
def perform_uploading():
music_thread = threading.Thread(target=play_music("./songs/Jay & The Americans - Come A Little Bit Closer.mp3"))
music_thread.start()
upload_video_to_youtube()
music_thread.join()