Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python play mp3 in background

#TO playsound in your python code you need to install play sound module.
# To install playsound moudule-
#(1). Open Terminal 
#(2). "In terminal only" type "pip install playsound"
# After installing playsound you need to write-
import playsound from playsound
# syntax of playsound command
playsound("C:file_linkfile_name")
# this will run in bakground also
# note: ````in python you need to specify path using double back slashes "",
# instead of single forward or back slash````
# please reaad the starting comments also they are very useful(ignore if readed)
# Enjoy :)
Comment

Play Audio File In Background Python

#You First Need To Do This In Your Python Terminal: "pip install pydub"
from pydub import AudioSegment
from pydub.playback import play
import threading

sound = AudioSegment.from_wav('myfile.wav')
t = threading.Thread(target=play, args=(sound,))
t.start()

print("I like this line to be executed simoultinously with the audio playing")
Comment

PREVIOUS NEXT
Code Example
Python :: python super 
Python :: Load dataset from seaborn 
Python :: python print 2 decimal places 
Python :: how to downgrade python 3.9 to 3.8 
Python :: changing the port of django port 
Python :: numpy average 
Python :: python pandas column where 
Python :: shape pandas 
Python :: beautifulsoup find get value 
Python :: create empty numpy array without shape 
Python :: python venv activate 
Python :: how to use fastapi ApiClient with pytest 
Python :: pycocotools python3.7 
Python :: add column in spark dataframe 
Python :: bot ping command 
Python :: python initialize dict with empty list values 
Python :: python declare a variable 
Python :: divisible in python 
Python :: remove tab space from string in python 
Python :: string print in pattern in python 
Python :: pygame point at mouse 
Python :: list exclude list 
Python :: Game of Piles Version 2 
Python :: map and filter in python 
Python :: Python numpy.broadcast_to() Function Example 
Python :: same elements of two sets in python 
Python :: Sending POST request in Django 
Python :: list of dataframe to dataframe 
Python :: python negative indexing 
Python :: pie plot in python 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =