Results 1 to 5 of 5

Thread: Good library for audio playback in Python

  1. #1
    Join Date
    Nov 2011
    Posts
    263
    Rep Power
    0

    Default Good library for audio playback in Python

    Right now I'm trying to build some softsynths in Python, but it hasn't been working out. It's PyMedia that I'm using. Here's what the document says, and what I've been doing.

    Code:
    import time 
    import wave 
    import pymedia.audio.sound as sound 
    f= wave.open( ' Sound files for drum machine here', 'rb' )
    sampleRate= f.getframerate()
    channels= f.getnchannels() 
    format= sound.AFMT_S16_LE
    snd= sound.Output( sampleRate, channels, format )
    s= f.readframes( 300000 )
    snd.play( s )
    Error happens here:

    Code:
    import pymedia.audio.sound as sound
    All attempts to use pymedia.audio.sound have failed. Anyone every had this problem, or should I just use Pygame instead?
    Last edited by Satanforce; Sep 17, 2014 at 06:25 PM.
    Phone: Nokia 1200 with Satantendo ROM v.3.3
    Laptop: (Pentium III 850 MHz, 512 MB, 60 GB)
    Console: Sega Dreamcast
    Check out my blog: http://satanforce.wordpress.com/

  2. #2
    Join Date
    Mar 2006
    Posts
    325
    Rep Power
    0

    Default

    maybe one of your python environment variables wasn't set up correctly
    1337

  3. #3
    Join Date
    Nov 2011
    Posts
    263
    Rep Power
    0

    Default

    Quote Originally Posted by wiel View Post
    maybe one of your python environment variables wasn't set up correctly
    I am going to look into that. However, I've switched to pyglet. It lets me do the same thing with just two lines of code. Also, it is pro-pig.
    Phone: Nokia 1200 with Satantendo ROM v.3.3
    Laptop: (Pentium III 850 MHz, 512 MB, 60 GB)
    Console: Sega Dreamcast
    Check out my blog: http://satanforce.wordpress.com/

  4. #4
    Join Date
    Feb 2012
    Posts
    295
    Rep Power
    0

    Default

    looks like you have missing modules, how did you install it?

  5. #5
    Join Date
    Nov 2011
    Posts
    263
    Rep Power
    0

    Default

    Firstly, wiel was right. Usually I use a combination of Portable Python on my thumb drive, and ActiveState Python install. Normally I do not use the usual setup files, instead relying on the source files. This time I got them mixed up, and forget to the copy and paste to the appropriate folder. But I had done the right thing with pyglet.

    Also:

    Phone: Nokia 1200 with Satantendo ROM v.3.3
    Laptop: (Pentium III 850 MHz, 512 MB, 60 GB)
    Console: Sega Dreamcast
    Check out my blog: http://satanforce.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •