Last updated:
0 purchases
playmusic 1.0
play-music is a PyPi library which allows you to play wav files or numpy arrays
Installation
Use the package manager pip to
install play-music.
pip install play-music
Usage
play music from wavfile:
import play-music
if __name__ == "__main__":
process = play-music.playMusic("alarm.wav", loop=False, threaded=False)
play music on loop:
import play-music
if __name__ == "__main__":
process = play-music.playMusic("alarm.wav", loop=True, threaded=True)
play music asynchronous:
import play-music
if __name__ == "__main__":
process = play-music.playMusic("alarm.wav", loop=False, threaded=True)
stop all sounds:
import play-music, time
if __name__ == "__main__":
process = play-music.playMusic("alarm.wav", loop=True, threaded=True)
time.sleep(1)
play-music.stopAllSounds()
stop specific sound:
import play-music, time
if __name__ == "__main__":
process = play-music.playMusic("alarm.wav", loop=True, threaded=True)
process2 = play-music.playMusic("alarm2.wav", loop=True, threaded=True)
time.sleep(1)
play-music.stopSpecificSound(process)
stop specific sounds:
import play-music, time
if __name__ == "__main__":
sounds_to_stop = []
process = play-music.playMusic("alarm.wav", loop=True, threaded=True)
sounds_to_stop.append(process)
process2 = play-music.playMusic("alarm2.wav", loop=True, threaded=True)
sounds_to_stop.append(process2)
process3 = play-music.playMusic("alarm2.wav", loop=True, threaded=True)
time.sleep(1)
play-music.stopSpecificSounds(sounds_to_stop)
Contributing
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
MIT
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.