Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to play and stop music python

import soundfile as sf
import sounddevice as sd

data, fs = sf.read(path, dtype='float32')  
sd.play(data, fs)
input("Write anything to stop.")
sd.stop()
Comment

PREVIOUS NEXT
Code Example
Python :: print inline output in python 
Python :: pandas convert first row to header 
Python :: python argparse custom categories 
Python :: Returns the first n rows 
Python :: how to add attribute to class python 
Python :: replace matrix values python 
Python :: Active Voice Python 
Python :: python array methods 
Python :: how to add percentage in countplot 
Python :: python edit string variable 
Python :: downsample image opencv 
Python :: how to delete an item from a list python 
Python :: python list comprehension 
Python :: input in one line python 
Python :: converting numpy array to dataframe 
Python :: function for detecting outliers in python 
Python :: get_absolute_url django 
Python :: Iterate string 2 characters at a time in python 
Python :: python remove blanks from string 
Python :: factorial of a number in python 
Python :: python comment 
Python :: pandas replace nan with none 
Python :: add image pptx python 
Python :: python if string contains substring 
Python :: Python - Change List Items 
Python :: cors python 
Python :: Converting categorical feature in to numerical features 
Python :: numpy random for string 
Python :: python documentation 
Python :: np.mean 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =