InDashPC.org Forum Index InDashPC.org
In Dash Car PC forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question

 
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software -> PyMedia Tutorials
View previous topic :: View next topic  
Author Message
evilx



Joined: 08 Jan 2008
Posts: 1

PostPosted: Tue Jan 08, 2008 2:46 pm    Post subject: Question Reply with quote

I don't really see a forum/thread for pymedia help. I am curious if pymedia is able to trim a .wav length and convert it to a single channel. I have been reading over the documentations, but I dont really see much on what I am trying to do.
Back to top
View user's profile Send private message
jbors
Site Admin


Joined: 12 Nov 2004
Posts: 1675

PostPosted: Tue Jan 08, 2008 10:57 pm    Post subject: Reply with quote

In fact you won't need pymedia for that,
Most wav files I seen are raw PCM data. So you can use Numeric to do that.
However you still can use Resample object to convert 2 channel into mono. It will be much faster than Numeric though.
See aplayer.py in examples (look for sound.Resampler) for more info on resampling
Back to top
View user's profile Send private message
dhenrie
Newbie


Joined: 16 Jul 2008
Posts: 5

PostPosted: Wed Jul 16, 2008 11:02 am    Post subject: "trim a .wav length and convert it to a single channel& Reply with quote

I wrote a script that crops a wav file, it's in a reply to a post entitled "Good way to seek to a position in an audio file?"; just do a Google search for that (should be the topmost result). (I can't write links yet)

As far as making a wav file mono, just change this (in the code I wrote in the above post):

Code:
fp_out.setparams(fp_in.getparams())# copy misc information


into this:

Code:
fp_out.setparams(fp_in.getparams())# copy misc information

fp_out.setnchannels(1)


Also, be sure to read the documentation of the "wave" module at the main python site (including the "Wave_read" and Wave_write" object documentation).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software -> PyMedia Tutorials All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group