Re: [Audacity-devel] reading au-files
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Tim-Christian M. <de...@ti...> - 2010-06-23 07:38:44
|
Hi, Michael Chinen schrieb: > On Tue, Jun 22, 2010 at 10:19 PM, Tim-Christian Mundt <de...@ti...> wrote: > >> Hi, >> >> I didn't receive the reply via email but only found it in the archives, >> that's why I can't reply directly. >> >> Thanks, Michael, for your info. I won't explain how I came to assume 16 >> bits, too embarrassing. After trying 4 byte floats the min and max >> worked immediately. The naive implementation for rms does not work >> (simple the sqrt of the sum of the squares of all samples), so I adapted >> the implementation found in Audacity, which works fine (a bit slow). >> Could someone please clarify shortly what is actually done there? >> > I don't know - if you mean the one in WaveClip::GetWaveDisplay > (WaveClip.cpp:657), yours looks the same to me No, I mean BlockFile::CalcSummary (BlockFile.cpp:201). I'll provide the file as soon as it's usable. > (although i don't know > python and why you are dividing by two and multiplying by one if you > are summing everything into the same variable.) > Multiplying by 1.0 (the .0 is important) is like casting to float, otherwise the result would be an integer. Divide by two was due to my assumption of having two bytes per sample. Nothing we need to elaborate on... >> One question remains: how can I find out the order of the files? I could >> sort by date which works ok, but how can I find out which of the two >> channels they belong to? Two files always have the same creation date. >> > Unfortunately this may be tricky. Couldn't figure it out from a quick > look, but for filenames unfortunately it looks like it uses rand() for > the general case: > Would it be possible to derive something from the data in the files? Maybe check which values are closer to each other? So I'd take two consequent pairs of files, read the last samples of the first ones and the first samples of the second files. Then I'd check what's closer. Wave files tend to be continuous, right? Maybe an interpolation algorithm is needed, but first I'd try the simple one. How does that sound? Best Tim |