In article , Tony Houghton
wrote:
In , Jim Lesurf
wrote:
A question occurs to me prompted by the way the Flack Health Check
program works. (And which I may also use for CD Health Check.)
In operations it relies on writing a tempory file, reading back its
contents, deleting the file, then repeating the process. The 'cycle'
takes somewhat less than a second per tempfile.
Is the file really necessary? If you want to avoid touching the disk
[1], the best way is to avoid using a file. Does the program that reads
the file need to seek around in it, or can it just read it serially?
I'm calling flac to read successive 5-sec chunks from a flac file. Each
time the flac utility will presumably have to seek.
I am aware there are many ways to do what I've done. However I've done it
so far in the way I found easiest and most familiar.
If the reader and writer are separate programs use a pipe.
I may have done if I'd known how to. But in practice I wanted to get a
program that produced the required coconut without too much delay. So far
as I'm concerned, the purpose of the programs I write are to produce a
result. It's nice to learn more about programming, but that's not my
main aim.
I still don't know in sufficient detail how to use a pipe for this. But I
do now know how to set up a 'ramdisc' for myself. Which strikes me as a
perfectly reasonably method - and one I'm familiar with from RO.
Note that - as I've already explained - any user of the program will be
able to choose whatever storage device and directory they wish for the
tempfiles. And that anyone who wants can modify the program as they prefer.
Source code provided. So if someone wished - say - to make a 'load the
entire LPCM in one go' version, or one that pipes, that's fine with me.
If they're the same program just use a RAM buffer. If the files are
small enough to consider using a RAM disk there's no reason not to just
load the whole thing into RAM anyway.
Afraid I don't know the distinction here between a ram buffer and a ram
disc. And the files vary in (unpacked to LPCM) size. But sizes of 1GB or
more aren't unusual for the files I work on.
There is, perhaps, another point you will appreciate. I wrote this program
initially for RISC OS. So I'm essentially 'porting this to Linux' to give
the opportunity of any interested Linux user to perform the same analysis
on their flac files. Given this and my background I'm avoiding making
needless changes. TBH I'm hoping others will be interested and do a
'better' program for the task - and port to other platforms. My interest
is in the audio analysis. I'm not really much of a programmer. Given
that the Flac program works I'd feel it more productive to do the Audio
CD version once I'm settled.
Jim
--
Please use the address on the audiomisc page if you wish to email me.
Electronics
http://www.st-and.ac.uk/~www_pa/Scot...o/electron.htm
Armstrong Audio
http://www.audiomisc.co.uk/Armstrong/armstrong.html
Audio Misc
http://www.audiomisc.co.uk/index.html