Python Forum
play audio tone of specific frequency - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: play audio tone of specific frequency (/thread-6349.html)



play audio tone of specific frequency - insearchofanswers87 - Nov-17-2017

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.


RE: play audio tone of specific frequency - Larz60+ - Nov-17-2017

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=search&term=play+frequency&submit=search


RE: play audio tone of specific frequency - sparkz_alot - Nov-17-2017

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.


RE: play audio tone of specific frequency - insearchofanswers87 - Nov-18-2017

Thanks guys. That did the trick!