Discussion:
[BitPim-devel] WAV (PCM) audio chopping
Roger Binns
2005-01-12 08:01:54 UTC
Permalink
Joe,

Do you think you could make a function that when given a wav file and a
start time can return a new wav file/data that starts from that point?

I am changing the audio convert doohickey to use a new widget that
shows the whole time and lets you select a range instead. It will
be more generic and useful for the convert to qcp stuff. But I
really need to start play of wav data at a specified point. The
wav will be post conversion and so will be mono at some random
bitrate.

You can preview the new widget by running rangedslider.py.

Roger
d***@netzero.com
2005-01-12 13:01:38 UTC
Permalink
Do you think you could make a function that when given a wav file and >a start time can return a new wav file/data that starts from that >point?
Yes, I'll take a look at your new widget and come up with something appropriately.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
d***@netzero.com
2005-01-12 14:37:29 UTC
Permalink
Do you think you could make a function that when given a wav file and >>a start time can return a new wav file/data that starts from that >point?
Yes, I'll take a look at your new widget and come up with something >appropriately.
On second thought, I think I already have something like that as part of my MP3-to-QCP-Conversion 'OnPlay' routine (redoing a wav file with start/durtation parameters). Please take a look at that and let me know if that'd work for you.

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
BitPim-devel mailing list
BitPim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-01-12 16:22:19 UTC
Permalink
Post by d***@netzero.com
On second thought, I think I already have something like that as part of my
MP3-to-QCP-Conversion 'OnPlay' routine (redoing a wav file with start/durtation
parameters). Please take a look at that and let me know if that'd work for you.
That uses ffmpeg to make a clip. I want something in Python code that just
works with the wav data and doesn't invoke ffmpeg.

Roger
d***@netzero.com
2005-01-12 17:16:18 UTC
Permalink
want something in Python code that just works with the wav data and >doesn't invoke ffmpeg
Got you. How about something along the line of:

def trimwave(wavedatain, start, duration=None) return newwavedata

If the input is not PCM/WAVE format, return data unchanged or raise exception?

-Joe Pham



______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-01-13 04:11:20 UTC
Permalink
Post by d***@netzero.com
def trimwave(wavedatain, start, duration=None) return newwavedata
If the input is not PCM/WAVE format, return data unchanged or raise exception?
That is exactly what I want. Raise an exception on invalid data - it should
only be called with a valid wav. You can make the initial version only
work with mono.

Roger
d***@netzero.com
2005-01-13 04:55:40 UTC
Permalink
right now I have 2 versions:

trimwav(wavinfilename, waveoutfilename, start, duration=None)

or

trimwav(wavedatain, start, duration=None) return newwavedata

which one would you prefer? The reason I came up with the first one is because I figure we could use wx.PlaySound, which takes a file name as input.

-Joe Pham


______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!
Roger Binns
2005-01-14 03:38:32 UTC
Permalink
Post by d***@netzero.com
The reason I came up with the first one is because I figure we could
use wx.PlaySound, which takes a file name as input.
The docs say it can either be a filename or a memory buffer. I need
to look at the wx code and see what it does in either case. The
most important criteria in the begining is that my guess as to how
long the sound has been playing is accurate. That requires the minumum
time delay from the Play method being called and playing actually
happening.

Roger
Roger Binns
2005-01-14 04:33:20 UTC
Permalink
Post by Roger Binns
Post by d***@netzero.com
The reason I came up with the first one is because I figure we could
use wx.PlaySound, which takes a file name as input.
The docs say it can either be a filename or a memory buffer. I need
to look at the wx code and see what it does in either case.
On Windows and Linux, wxWidgets loads the file contents and internally
only does the memory buffer form. On Mac, it uses whichever is passed
in. (The Mac code is also highly amusingly commented with some
competition to see what the longest possible function names are.)

Roger

Loading...