Python Forum
play audio tone of specific frequency
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
play audio tone of specific frequency
#1
Does anyone know of a simple cross-platform Python 3 way to play an audio tone of a specific frequency?

I am developing a sorting animation to help beginners understand sorting algorithms and would like to play sounds that represent the magnitudes of the values being swapped.
Reply
#2
there is this package: https://pypi.python.org/pypi/pysine/0.9.2
I haven't used it, but it looks like it will do the trick.
others: https://pypi.python.org/pypi?%3Aaction=s...mit=search
Reply
#3
I've used pysine in one of my programs. Used on a Windows 10 with Python 3.6.3 and it works fine. Haven't tried it on Linux, Mac or *nix yet, so I can't speak to that.

Very easy to use and the nice thing is you don't need a .wav file or any file for that matter.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#4
Thanks guys. That did the trick!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I send a .mp3 to play through my mic? ejected 20 19,820 Sep-01-2022, 02:38 AM
Last Post: victormayer
  Play the next music in a list Pymax 0 1,181 Jul-28-2021, 07:27 PM
Last Post: Pymax
  Running loop at specific frequency mdsousa 3 5,849 Apr-21-2021, 11:22 AM
Last Post: jefsummers
  Play fixed frequency sound in python 3 jpezz 2 2,724 Feb-07-2021, 08:21 PM
Last Post: jpezz
  how do i play an mp3 from a list gr3yali3n 3 2,074 Dec-01-2020, 08:50 AM
Last Post: Axel_Erfurt
  Find frequencies of an audio file at a specific time via librosa jberesford123__ 0 2,280 Oct-21-2020, 01:18 PM
Last Post: jberesford123__
  Delete specific lines contain specific words mannyi 2 4,069 Nov-04-2019, 04:50 PM
Last Post: mannyi
  How to play against the computer Help_me_Please 4 3,991 Aug-29-2019, 03:37 PM
Last Post: ThomasL
  Play Audio File w/ Python ducky_12 8 4,544 Sep-30-2018, 08:54 AM
Last Post: wavic
  SoX Sound Exchange sample code to Rec & Play audio file Fran_3 3 6,502 Sep-11-2017, 09:13 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020