Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to play a mp3 file in python

from pygame import mixer#if this module in not installed then install it by pip install pygame
mixer.init()
mixer.music.load('alarm.mp3')
mixer.music.play()
Comment

how to play mp3 audio in python

#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")
# note: ````in python you need to specify path using double back slashes "",
# instead of single forward or back slash````
# please read the starting comment lines they are very useful(ignore if readed)
# Enjoy :)
Comment

play mp3 file python

from playsound import playsound
playsound(r"C:path	osong")
Comment

Python How To Play Mp3 File

import pygame
pygame.mixer.init()
pygame.mixer.music.load('sample.mp3')
pygame.mixer.music.play()
Comment

PREVIOUS NEXT
Code Example
Python :: csv from string python 
Python :: read image python 
Python :: how to make a url shortener in python 
Python :: plot normal distribution python 
Python :: clear console in python 
Python :: adjust tick label size matplotlib 
Python :: how to order randomly in django orm 
Python :: RandomForestRegressor import 
Python :: input stdout python 
Python :: python xor two bytes 
Python :: seaborn styles 
Python :: python datetime minus 1 day 
Python :: python plot cut off when saving figure 
Python :: python sort with comparator 
Python :: how to read zip csv file in python 
Python :: scikit learn ridge classifier 
Python :: matplotlib set size 
Python :: format numbers in dataframe pandas 
Python :: Removing punctuation in Python 
Python :: Make tkinter window look less blury 
Python :: length ofarray in ptyon 
Python :: get from time secs and nsecs 
Python :: how to add multiple dfs to excel sheet 
Python :: change title size matplotlib 
Python :: selenium iframe python 
Python :: FizzBuzz FizzBuzz is a well known programming assignment, asked during interviews. 
Python :: set threshold resnet18 pytorch 
Python :: generate 12 random numbers python 
Python :: python similar strings 
Python :: how to save model to a file python 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =