Generating Sound from Sine Waves in Python
Vložit
- čas přidán 22. 07. 2022
- In this video, I demonstrate how to generate sound from sine waves in Python.
Sine Wave Wikipedia: en.wikipedia.org/wiki/Sine_wave
Stackoverflow sound from sine wave: stackoverflow.com/a/16268034
Frequency map Gist: gist.github.com/sahithyen/b20...
Repository: github.com/JamminCoder/music_...
#python
#sinewave
#coding - Auta a dopravní prostředky
I really appreciate how you give credit to all individuals that contributed to the making of the code and video! And it's a good video!
Amazing job thank you
Thank you so much ❤🙂
How would you go with making it play until user hits stop or something? So the program keeps playing continuously
I'm trying to create a version in which 12 long sliders can stream* any type of rhythmic sound. However... I don't want it to rely on the time import, just the wave signal as written maybe through struct.
So how can I make several sine waves sound together?
I am getting an issue when I try to run this code.
"ValueError: Array depth must match number of mixer channels"
Did you experience this at all?
Can this be saved as an audio file?
That's a great question! I found this Stackoverflow question/answer and it looks like it might work: stackoverflow.com/questions/17292444/pygame-mixer-save-audio-to-disk
I wonder if this could be modified to read a midi file and play it.
That is a cool idea! I want to look into that.
haven’t see sine wave in this video can you please show how to?
The audio generated is from sine waves.
What you want is a graphical sine wave, right?
@@jammincoder Yes ( at least as shown in thumbnail 😉), also I want sine wave customisation/ theme.
@@ParagOak Ah ok. I apologize if the wave in the thumbnail is misleading in terms of video content. I'll try and make a video this weekend.
Thanks for subscribing my the way! Is there anything else you would like to see?
Why does it sound distorted? Is it due to using 16 bits?
The bit count will effect the quality of sound, but also when generating loud and precise frequencies it can cause the speakers to distort the sound.
i just got attention tone'd 💀
Love the video but importing math is really unnecessary. You really aren't utilizing numpy's amazing features