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

Play Mp3 Files With Python Using the playsound Package

# If you don’t have the playsound package installed on your system,
# you can install it with the command:

"""
$ pip install playsound
"""

import playsound

playsound.playsound('sample.mp3')
Comment

PREVIOUS NEXT
Code Example
Python :: python exe not working on other pc 
Python :: python list methods 
Python :: how to get the mouse input in pygame 
Python :: dataframe sort by column 
Python :: print fibonacci series in reverse in python 
Python :: make first row column names pandas 
Python :: df drop column 
Python :: deleting duplicates in list python 
Python :: how to create a database in python 
Python :: sqlalchemy lock row 
Python :: python fizzbuzz 
Python :: cv2 videocapture program for python 
Python :: all subarrays of an array python 
Python :: sample datafra,e PYTHON 
Python :: how to define dtype of each column before actually reading csv file 
Python :: python sum of natural numbers recursion 
Python :: keep only duplicates pandas multiple columns 
Python :: win32api.mouse_event python 
Python :: import load_iris 
Python :: django RetrieveUpdateDestroyAPIView 
Python :: mad scipy 
Python :: pd add column with zeros 
Python :: boxplot for all columns in python 
Python :: pip install vlc 
Python :: psyche asteroid 
Python :: pandas datetime.time 
Python :: program to tell if a number is a perfect square 
Python :: flask_mail 
Python :: jupyter notebook not showing all columns 
Python :: string to datetime python 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =