Hawkeye
Hawkeye

Reputation: 43

How do you play sound in Python WITHOUT downloading anything

I have been looking for ages on ways to find out how to make idle python play sound such as wav.

The solutions I have found are used by programs such as pygame. I can't download pygame or any other program.

Many thanks

Upvotes: 0

Views: 8174

Answers (2)

Hawkeye
Hawkeye

Reputation: 43

To play a sound without downloading anything, you use the code:

import winsound

winsound.PlaySound('FILENAMEHERE.wav', winsound.SND_FILENAME)

keep everything the same apart from FILENAMEHERE

Upvotes: 3

WholesomeGhost
WholesomeGhost

Reputation: 1121

Why are you unable to download anything? https://pypi.python.org/pypi/playsound/1.2.1 - link for playsound module it is very easy to download. You can download it using pip by navigating with cmd to your python folder (usualy C:\Users\UserName\AppData\Local\Programs\Python\Python35-32) and writing: python -m pip install playsound (if you are using python 3). I think that is the easiest and the fastest way for you to play sound if you have any other questions about this let me know.

p.s If you need to you can download pip here: https://pip.pypa.io/en/stable/installing/https://pip.pypa.io/en/stable/installing/ Hope I was helpful. :)

Upvotes: 0

Related Questions