Play Sounds at different Speeds

Reply

Join Date: May 2008
Posts: 893
Reputation: Paul Thompson has a spectacular aura about Paul Thompson has a spectacular aura about 
Solved Threads: 143
Sponsor
Paul Thompson's Avatar
Paul Thompson Paul Thompson is offline Offline
previously paulthom12345

Play Sounds at different Speeds

 
0
  #1
Oct 28th, 2008
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.
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 45
Reputation: tyincali is an unknown quantity at this point 
Solved Threads: 6
tyincali tyincali is offline Offline
Light Poster

Re: Play Sounds at different Speeds

 
0
  #2
Oct 28th, 2008
What platform are you on? What module are you using for playback right now?
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,322
Reputation: evstevemd has a spectacular aura about evstevemd has a spectacular aura about evstevemd has a spectacular aura about 
Solved Threads: 124
evstevemd's Avatar
evstevemd evstevemd is offline Offline
Nearly a Posting Virtuoso

Re: Play Sounds at different Speeds

 
0
  #3
Oct 28th, 2008
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
Atheist: God is man made imagination, he doesn't exist!
Theist: It's okay, can you imagine anything else that doesn't exist?
Junior MD --- Python, C++ and PHP
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 45
Reputation: tyincali is an unknown quantity at this point 
Solved Threads: 6
tyincali tyincali is offline Offline
Light Poster

Re: Play Sounds at different Speeds

 
0
  #4
Oct 28th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 893
Reputation: Paul Thompson has a spectacular aura about Paul Thompson has a spectacular aura about 
Solved Threads: 143
Sponsor
Paul Thompson's Avatar
Paul Thompson Paul Thompson is offline Offline
previously paulthom12345

Re: Play Sounds at different Speeds

 
0
  #5
Oct 29th, 2008
Well im on windows if that helps. How would i change the sample rate? Is there an easy way to do that in python?
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 893
Reputation: Paul Thompson has a spectacular aura about Paul Thompson has a spectacular aura about 
Solved Threads: 143
Sponsor
Paul Thompson's Avatar
Paul Thompson Paul Thompson is offline Offline
previously paulthom12345

Re: Play Sounds at different Speeds

 
0
  #6
Oct 29th, 2008
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.
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,322
Reputation: evstevemd has a spectacular aura about evstevemd has a spectacular aura about evstevemd has a spectacular aura about 
Solved Threads: 124
evstevemd's Avatar
evstevemd evstevemd is offline Offline
Nearly a Posting Virtuoso

Re: Play Sounds at different Speeds

 
0
  #7
Oct 30th, 2008
site for pyaudio that i can download and fiddle around? Is it built in? wx.Python??
Atheist: God is man made imagination, he doesn't exist!
Theist: It's okay, can you imagine anything else that doesn't exist?
Junior MD --- Python, C++ and PHP
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 45
Reputation: tyincali is an unknown quantity at this point 
Solved Threads: 6
tyincali tyincali is offline Offline
Light Poster

Re: Play Sounds at different Speeds

 
0
  #8
Oct 30th, 2008
I wish I had something cool to put here...
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 45
Reputation: tyincali is an unknown quantity at this point 
Solved Threads: 6
tyincali tyincali is offline Offline
Light Poster

Re: Play Sounds at different Speeds

 
0
  #9
Oct 30th, 2008
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
I wish I had something cool to put here...
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 893
Reputation: Paul Thompson has a spectacular aura about Paul Thompson has a spectacular aura about 
Solved Threads: 143
Sponsor
Paul Thompson's Avatar
Paul Thompson Paul Thompson is offline Offline
previously paulthom12345

Re: Play Sounds at different Speeds

 
0
  #10
Oct 31st, 2008
Is there anywhere to download pysonic for python 2.5? Because i cant find it on the sourceforge page..
Make it idiot proof and someone will make a better idiot.
Check out my Site | and join us on IRC | Python Specific IRC
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC