Code Monkey home page Code Monkey logo

Comments (7)

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024 1

I tried this now on my computer, windows 10, python 3.7.9 and it should plays some midi guitar sounds of a chord progression. And since switching to my ffmpeg version still did not solve the issue, I think it might be the problem of your audio driver. You can take a look at your audio driver settings.

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024 1

That might be your current file path is at the musicpy package in python path, so the midi file is generated there. You can use os.chdir(path_to_your_current_script) before the play function. Or you can add name='path_to_your_current_script/temp.mid' in the play function to make sure the midi file is generated at your current path.

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024 1

Just a check, could you use pygame to play any audio files on you computer? You can put an mp3 file on your current script's path, and try to run this part of code (the mp3 file should be played normally when you open it with usual music player):

from musicpy import *
pygame.mixer.music.load(name_of_file)
pygame.mixer.music.play()

(name_of_file should include extension .mp3)
If you cannot hear any sounds or the sounds is different from the sounds when you play it via a music player, then it is sure that your audio driver has some problems.

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

This play function uses pygame.midi module to play the midi file generated once the play function is running, you should see a temp.mid file generated in the same path as your script, you can open it and listen if it is correct.

from musicpy.

gildurao avatar gildurao commented on June 2, 2024

Do not see any file generated, I will take a look at audio driver settings.

from musicpy.

gildurao avatar gildurao commented on June 2, 2024

Yeah, I cannot hear anything. I do have a Focusrite Audio interface and audio works well, but apparently Python doesn't like it. I will investigate it. Thanks for your help

from musicpy.

Rainbow-Dreamer avatar Rainbow-Dreamer commented on June 2, 2024

You're welcome :)

from musicpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.