943,821 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 2510
  • Python RSS
You are currently viewing page 1 of this multi-page discussion thread
Oct 28th, 2008
0

Play Sounds at different Speeds

Expand Post »
Hi guys,
I have a program that lets the user play a sound but i was wanting to know how i could make it so the user could vary the speed in which the sound plays so the sound can play slowly and quickly and normaly as well. Is this even possible with python? Becuase i was looking and i couldn't find any modules to help me with this problem but if anyone could give me a hand that would be greatly appreciated.
Thanks.
Similar Threads
Reputation Points: 264
Solved Threads: 183
Veteran Poster
Paul Thompson is offline Offline
1,095 posts
since May 2008
Oct 28th, 2008
0

Re: Play Sounds at different Speeds

What platform are you on? What module are you using for playback right now?
Reputation Points: 31
Solved Threads: 7
Light Poster
tyincali is offline Offline
45 posts
since Oct 2008
Oct 28th, 2008
0

Re: Play Sounds at different Speeds

I don't know about python but the trick of doing this is increasing the tempo of music. If the current module you are using can do that then that will be simple case
Reputation Points: 462
Solved Threads: 392
Senior Poster
evstevemd is offline Offline
3,681 posts
since Jun 2007
Oct 28th, 2008
0

Re: Play Sounds at different Speeds

Similiar to what evstevemd said, I was thinking you would need to change the sample rate (how many bits per second are played) if you take a 44000hz sample and play it at 88000hz, it should play at double speed.
Reputation Points: 31
Solved Threads: 7
Light Poster
tyincali is offline Offline
45 posts
since Oct 2008
Oct 29th, 2008
0

Re: Play Sounds at different Speeds

Well im on windows if that helps. How would i change the sample rate? Is there an easy way to do that in python?
Reputation Points: 264
Solved Threads: 183
Veteran Poster
Paul Thompson is offline Offline
1,095 posts
since May 2008
Oct 29th, 2008
0

Re: Play Sounds at different Speeds

Okay well got an update for everyone. I am using pyAudio and wave modules to play my .wav file. Now i can set the "Rate" in which the file plays. This i can change at the start of the program and it will change the rate at which the sound is played. This changes the speed and therefore the pitch. My issue is, with using pyAudio i haven't been able to work out how to change the rate while the application is running.

So if anyone knows how to do that. That will be very helpful.
Reputation Points: 264
Solved Threads: 183
Veteran Poster
Paul Thompson is offline Offline
1,095 posts
since May 2008
Oct 30th, 2008
0

Re: Play Sounds at different Speeds

site for pyaudio that i can download and fiddle around? Is it built in? wx.Python??
Reputation Points: 462
Solved Threads: 392
Senior Poster
evstevemd is offline Offline
3,681 posts
since Jun 2007
Oct 30th, 2008
0

Re: Play Sounds at different Speeds

Reputation Points: 31
Solved Threads: 7
Light Poster
tyincali is offline Offline
45 posts
since Oct 2008
Oct 30th, 2008
0

Re: Play Sounds at different Speeds

I think a better option might be to switch to pySonic

http://pysonic.sourceforge.net

the Song.userspeed() property in particular looks like what you would want
Reputation Points: 31
Solved Threads: 7
Light Poster
tyincali is offline Offline
45 posts
since Oct 2008
Oct 31st, 2008
0

Re: Play Sounds at different Speeds

Is there anywhere to download pysonic for python 2.5? Because i cant find it on the sourceforge page..
Reputation Points: 264
Solved Threads: 183
Veteran Poster
Paul Thompson is offline Offline
1,095 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Python-Tuple Help!
Next Thread in Python Forum Timeline: Yet another pygame help thread





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC