Re: [ecasound] extract, mix and save questions

From: Jeremy Hall <jhall@email-addr-hidden>
Date: Mon Dec 19 2005 - 20:39:24 EET

Hi Brad,

I think you could do this with ecasound

When I want to know how long a file is, I have a variety of ways to do it:

1: if the file is a .wav file strip off the first 44 bytes (NOTE there may
be length information in the header but often times there isn't, so best
to calculate it manually)

Let us assume your file is 16-bit samples and 2 channels--you can have
more channels)

(len - 44) / 4

This is assuming 8 bits to a byte, two channels, two bytes (16-bit) now
you have the number of "frames"

Now divide that by your srate--this will tell you (hopefully with
milisecond accuracy) how many seconds the file is. Alternatively, load
your file into ecasound, connect the chain and issue the fs command from
interactive mode--this will tell you with ms accuracy as well.

Now for your second task, locate the second file and do:

ecasound -i foo.raw -y:1800 -t:30 -o foo2.raw

This is the second file, -y means offset into the file, -t says how long
it should run.

Next mix them down

ecasound -a:1 -i source1.wav -y:1500 -a:2 -i foo2.wav -a:1,2 -o foo3.wav

It is important to make sure you use the same srate and that you read
through the requirements from going from mono to stereo etc--use the erc
effect if you want mono in stereo mode.

Is that what you want? NOTE ecasound does an implicit -ea:50 on each chain
(because there are two, and 50+50 == 100) so you may need to adjust your
coefficients during mixing.

Hope this helps.

_J

In the new year, Brad Fuller wrote:
> I couldn't find a way to do this in ecasound, but maybe there's a way to
> do it. Here's what I want to do:
>
> Find the exact length of a audio file in ms. I think ecalength can do
> this, I know it's not sample accurate, but I just need down to the
> around 1ms. Maybe there's another option other than ecalength. IŽd like
> to have it sample accurate, or at least to the nearest zero crossings.
>
> Then, I want to extract a section of another file: at a specific
> location in ms and at a length of the file above. I see that sox may be
> able to do this using the 'trim" feature.
>
> Then, mix that extracted segment with another file and save the result
> to a new file.
>
> How can this be done? Any ideas?
>
> thanks,
>
> brad
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op%cck
> _______________________________________________
> Ecasound-list mailing list
> Ecasound-list@email-addr-hidden
> https://lists.sourceforge.net/lists/listinfo/ecasound-list
>

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op ick
_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Tue Dec 20 00:15:07 2005

This archive was generated by hypermail 2.1.8 : Tue Dec 20 2005 - 00:15:07 EET