Generating Sound from Sine Waves in Python

Sdílet
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

Komentáře • 19

  • @atamaminami5752
    @atamaminami5752 Před rokem +5

    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!

  • @ImplodingSunset
    @ImplodingSunset Před rokem +1

    Amazing job thank you

  • @freepythoncode
    @freepythoncode Před rokem

    Thank you so much ❤🙂

  • @efefrk7313
    @efefrk7313 Před rokem

    How would you go with making it play until user hits stop or something? So the program keeps playing continuously

  • @ThankYouESM
    @ThankYouESM Před 4 měsíci

    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.

  • @yanikovu
    @yanikovu Před 3 měsíci

    So how can I make several sine waves sound together?

  • @tridyo43
    @tridyo43 Před 5 měsíci

    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?

  • @kenizah
    @kenizah Před rokem +1

    Can this be saved as an audio file?

    • @jammincoder
      @jammincoder  Před rokem

      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

  • @richardboreiko
    @richardboreiko Před 10 měsíci

    I wonder if this could be modified to read a midi file and play it.

    • @jammincoder
      @jammincoder  Před 10 měsíci +1

      That is a cool idea! I want to look into that.

  • @ParagOak
    @ParagOak Před rokem

    haven’t see sine wave in this video can you please show how to?

    • @jammincoder
      @jammincoder  Před rokem

      The audio generated is from sine waves.
      What you want is a graphical sine wave, right?

    • @ParagOak
      @ParagOak Před rokem

      @@jammincoder Yes ( at least as shown in thumbnail 😉), also I want sine wave customisation/ theme.

    • @jammincoder
      @jammincoder  Před rokem +3

      @@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?

  • @cory99998
    @cory99998 Před rokem

    Why does it sound distorted? Is it due to using 16 bits?

    • @jammincoder
      @jammincoder  Před rokem +1

      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.

  • @retroboi128thegamedev

    i just got attention tone'd 💀

  • @tobystupp2976
    @tobystupp2976 Před rokem

    Love the video but importing math is really unnecessary. You really aren't utilizing numpy's amazing features