How to Play Audio Files (Sound Effects and Music) in Python Using Pygame (Mp3 and Others)

Поделиться
HTML-код
  • Опубликовано: 15 окт 2024
  • 💻 Get the Source Code + mp3 files and support the channel ❤️: www.buymeacoff...
    ⬇️ LEARN ON THE BEST LEARNING PLATFORMS (LINKS BELOW) 😉💪 ⬇️
    💻 My Source Codes: www.buymeacoff...
    ☕ Buy me a coffee: www.buymeacoff...
    😍 One-off donation: www.paypal.me/...
    SKILLSHARE
    (Python, Web Dev, UI/UX Design, Music, Art, Animation and a lot more)
    🔗 skillshare.eqc... (Affiliate)
    DATACAMP
    (Python, ChatGPT, SQL, Power BI, and a lot more)
    🔗 datacamp.pxf.i... (Affiliate)
    COURSERA PYTHON
    (For beginners, Data Science, Data Analysis, AI, Cybersecurity and a lot more):
    🔗 imp.i384100.ne... (Affiliate)
    COURSERA WEB DEVELOPMENT
    (Full Stack, Front-End, Back-End, Web Design and a lot more):
    🔗 imp.i384100.ne... (Affiliate)
    Learn how to play sounds and music with Python (Mp3, WAV and others)
    If the video was helpful, let me know in the comments down below and also like the video so that other people can see it. Needles to say I really appreciate your support 💪❤️
    📨 SUBSCRIBE so that you don't miss any new video:
    www.youtube.co...
    🤗 BIO PAGE (contacts, etc): solo.to/fabiom...
    Create Your Bio Page (10% OFF Upgraded Plans 😉): solo.to/inv/ND...
    🔗 RELATED CONTENT (videos, playlists, etc) 🔗
    Python Playlist: • 🐍 Learn Python With Fa...
    🤩 AFFILIATE LINKS 🤩
    Create Your Bio Page (10% OFF Upgraded Plans): solo.to/inv/ND...
    🧑🏻‍💻 ABOUT ME 🧑🏻‍💻
    I'm Fabio, I started programming with Python a lot of years ago and I fell in love with this world.
    I started this RUclips channel to help you during your own journey and I hope that my help can make you an amazing programmer who loves this world as I do.
    Welcome on board!! 🚀
    #pythonWithFabioMusanni #pythonforbeginners #python #pythontutorial #pythonprogramming #coding #programming

Комментарии • 19

  • @FabioMusanni
    @FabioMusanni  Год назад

    💻 *Source Code + mp3 Files:* www.buymeacoffee.com/fabiomusanni/e/183129
    ☕ *Buy me a coffee:* www.buymeacoffee.com/fabiomusanni
    😍 *One-off donation:* www.paypal.me/FabioMusanni/
    ⬇️ *LEARN ON THE BEST LEARNING PLATFORMS* 😉💪 ⬇️
    *SKILLSHARE*
    _(Python, Web Dev, UI/UX Design, Music, Art, Animation and a lot more)_
    🔗 skillshare.eqcm.net/5gxzD2 (Affiliate)
    *DATACAMP*
    _(Python, ChatGPT, SQL, Power BI, and a lot more)_
    🔗 datacamp.pxf.io/vN1bDj (Affiliate)
    *COURSERA PYTHON*
    _(For beginners, Data Science, Data Analysis, AI, Cybersecurity and a lot more):_
    🔗 imp.i384100.net/k0Nk60 (Affiliate)
    *COURSERA WEB DEVELOPMENT*
    _(Full Stack, Front-End, Back-End, Web Design and a lot more):_
    🔗 imp.i384100.net/EKWxBW (Affiliate)
    Thank you for the support!❤
    🎥All my videos about Python: ruclips.net/p/PLs8qUrmRvaR0IT4IwJl-LSweAdACW-yLK

  • @starbassthema2351
    @starbassthema2351 3 месяца назад

    Thanks, for this video. Now Pygame runs very well.

    • @FabioMusanni
      @FabioMusanni  3 месяца назад +1

      Glad to hear that! 😍💪

  • @maiktester5085
    @maiktester5085 8 месяцев назад +1

    Great Video, thanks for the help

    • @FabioMusanni
      @FabioMusanni  8 месяцев назад +1

      Thank you! Glad the video helped! 💪😊

  • @andrewthomas3467
    @andrewthomas3467 6 месяцев назад

    is there a way to have a sound keep repeatedly playing without having to manually enter an input?

    • @FabioMusanni
      @FabioMusanni  6 месяцев назад

      When you call "play", there should be an option called "loops", if you set that to -1 the sound will keep looping. I think I mentioned that somewhere in the video.

  • @gemmalacdao
    @gemmalacdao 5 месяцев назад

    how to add background music in your game?😢

  • @RenRuin
    @RenRuin Год назад

    Thanks for this video. Really helped me figure out what I was doing wrong.

    • @FabioMusanni
      @FabioMusanni  Год назад

      Thank you for the comment! 😍 I'm glad the video helped you shed some light on the topic 🤗💪

  • @Manishincode
    @Manishincode 4 месяца назад

    Best video on yt..

  • @ars44pro
    @ars44pro 4 месяца назад

    the best video-instruction!!!!!!!!!!

    • @FabioMusanni
      @FabioMusanni  4 месяца назад

      Glad you liked it, thank you for the comment! 💪😍

  • @ndeneve3817
    @ndeneve3817 6 месяцев назад

    my game over music keeps repeating even tho i added the loop = 0. im so stuck

    • @mysterypotionx
      @mysterypotionx 5 месяцев назад

      Maybe you are looping the play command

    • @gunre0n
      @gunre0n 4 месяца назад

      don't write anything in the brackets instead of the 'loops = 0' :d

  • @minecrafttiger6198
    @minecrafttiger6198 Год назад +1

    Whenever music is in my while true loop it never plays

    • @FabioMusanni
      @FabioMusanni  Год назад

      Hello 😊
      If the code is the same, it's impossible it doesn't work, check carefully the indentation and the code itself.

    • @comingsoon578
      @comingsoon578 7 месяцев назад

      @@FabioMusanni I don't know why your code didn't worked for me, but it solved by doing this:
      mixer.init()
      sound = mixer.Sound('your_sound.mp3')
      sound.play()
      sleep(5)