Generating Sound from Sine Waves in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ส.ค. 2024
  • In this video, I demonstrate how to generate sound from sine waves in Python.
    Sine Wave Wikipedia: en.wikipedia.o...
    Stackoverflow sound from sine wave: stackoverflow....
    Frequency map Gist: gist.github.co...
    Repository: github.com/Jam...
    #python
    #sinewave
    #coding

ความคิดเห็น • 19

  • @atamaminami5752
    @atamaminami5752 ปีที่แล้ว +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 ปีที่แล้ว +1

    Amazing job thank you

  • @efefrk7313
    @efefrk7313 ปีที่แล้ว

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

  • @ThankYouESM
    @ThankYouESM 5 หลายเดือนก่อน

    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.

  • @tridyo43
    @tridyo43 7 หลายเดือนก่อน

    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?

  • @yanikovu
    @yanikovu 5 หลายเดือนก่อน

    So how can I make several sine waves sound together?

  • @freepythoncode
    @freepythoncode ปีที่แล้ว

    Thank you so much ❤🙂

  • @richardboreiko
    @richardboreiko ปีที่แล้ว

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

    • @jammincoder
      @jammincoder  11 หลายเดือนก่อน +1

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

  • @kenizah
    @kenizah 2 ปีที่แล้ว +1

    Can this be saved as an audio file?

    • @jammincoder
      @jammincoder  2 ปีที่แล้ว

      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

  • @ParagOak
    @ParagOak 2 ปีที่แล้ว

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

    • @jammincoder
      @jammincoder  2 ปีที่แล้ว

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

    • @ParagOak
      @ParagOak 2 ปีที่แล้ว

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

    • @jammincoder
      @jammincoder  2 ปีที่แล้ว +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 ปีที่แล้ว

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

    • @jammincoder
      @jammincoder  ปีที่แล้ว +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
    @retroboi128thegamedev ปีที่แล้ว

    i just got attention tone'd 💀

  • @tobystupp2976
    @tobystupp2976 ปีที่แล้ว

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