开源中国社区
找到您想要的开源软件,分享和交流 Android客户端 iPhone客户端 开源软件 资讯
软件
当前位置: 开源软件 » 软件分类 » 多媒体处理 » pySoundic

Python的声音开发包 pySoundic 0人收藏此软件, / 提醒设置

pySonic 是封装了高性能、跨平台的FMOD声音库 Python 开发包。

示例代码:

     import pySonic
      import time
      
      def finished_stream(source):
        print 'Stream finished playing'
      
      # initialize the audio environment
      w = pySonic.World()
      
      # create two sources
      src1 = pySonic.Source()
      src2 = pySonic.Source()
      
      # load a sound entirely from disk, stream another from disk
      src1.Sound = pySonic.FileSample('short.wav')
      src2.Sound = pySonic.FileStream('long.mp3')
      
      # position the sources in 3D space
      src1.Position = (-0.5, 0.0, 0.5)
      src2.Position = (0.5, 0.0, 0.5)
      
      # register a callback for when the stream finishes
      src2.SetEndStreamCallback(finished_stream)
      
      # register a callback for when the stream finishes
      src1.Play()
      src2.Play()
      
      # just block while we're playing in this example
      while src1.IsPlaying() or src2.IsPlaying():
        time.sleep(1)

使用 pySoundic 中的任何问题

我要提问/分享
已发布:)

显示所有 » 共有150个类似软件

共有 0 人关注 pySoundic