Generating sine wave sound in Python

后端 未结 6 1128
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 05:31

I need to generate a sine wave sound in Python, and I need to be able to control frequency, duration, and relative volume. By \'generate\' I mean that I want it to play thou

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 06:06

    One of the more consistent andeasy to install ways to deal with sound in Python is the Pygame multimedia libraries.

    I'd recomend using it - there is the pygame.sndarray submodule that allows you to manipulate numbers in a data vector that become a high-level sound object that can be playerd in the pygame.mixer module.

    The documentation in the pygame.org site should be enough for using the sndarray module.

提交回复
热议问题