Re: [ecasound] extract, mix and save questions

From: Brad Fuller <brad@email-addr-hidden>
Date: Mon Dec 19 2005 - 22:10:28 EET

Jeremy Hall wrote:

>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.
>
>
thanks, jeremy.
At this point, foo2.raw is the extracted file that is 30seconds long,
right? I assume that you are saying that the file in step1 is 30sec long.

BTW, Do you know if there is a way to have it start at the closest zero
crossing?

>Next mix them down
>
>ecasound -a:1 -i source1.wav -y:1500 -a:2 -i foo2.wav -a:1,2 -o foo3.wav
>
>
I don't know why you used -y here. foo2.wav should be the length of the
first file (source1.wav). I guess the issue is how does ecasound mix the
two? does it bypass the WAV header and start at index 0 in the audio
data (I assume that it does). If that's the case, then wouldn't it be:

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

Where source1.wav is the file in the first step: source1.wav and
foo2.wav should be the exact same length.
(also assuming there is a step before this that converts foo2.raw to
foo2.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.
>
>
That's good to know, and it's appropriate that it does that.

>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 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:09 2005

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