Pygmalion
Pygmalion

Reputation: 919

Simple beep to speakers

I want windows (possibly cross-platform) solution to play simple tone of certain frequency and length on speakers. Here

Python: Making a beep noise

it is suggested to use winsound, but this solution only creates PC speaker sound. Is there any way to create sound on real speakers?

Upvotes: 1

Views: 2751

Answers (1)

Pythonic
Pythonic

Reputation: 2131

You can use winsound to play

A single-frequency beep:

winsound.Beep(2000,500) # Hz, milliseconds

An external sound:

winsound.PlaySound('./sounds_folder/my_sound.wav', winsound.SND_FILENAME)                

Upvotes: 2

Related Questions