[paranoia] splitting sound files?

Bill Davidsen davidsen at tmr.com
Thu Feb 22 11:19:45 PST 2001



On Wed, 14 Feb 2001, Christopher Jones wrote:

> Ok. This is good. I didn't even know about the head command, though I knew
> about the others. But I am a bit unsure about this... the point is to cut, not
> copy parts of the file. Looking at the commands quoted here, I see that dd
> copies, not cuts, big.wav. 

  That's the way the (UNIX) world works. There is no system call to take
part of a file and make it part of another file. The best you can do is
start at the end of the file, seek back SIZE bytes, copy SIZE bytes to a
new file and truncate() the original file to be SIZE bytes shorter. That
way the disk in use for SIZE byte output files is SIZE larger than the
original.

> The point is, given -very- limited hd space, not to effectively double the file
> by duplicating the whole thing in bits. So when I make part0.wav, big.wav
> should get smaller. 

  See above. I'd like truncate() to lop bytes off the front end of the
file, but it doesn't work that way (yes you can copy down and truncate()
at the end). I think what I said is the best you can easily do.

  Given the price of drives these days, I have minimal identification with
this problem. It's an interesting exercise in "how could I do this the
hard way," but I wouldn't do anything the hard way very many times when I
could solve the problem for what it costs to go out to dinner and a
concert with my wife.


-- 
bill davidsen <davidsen at tmr.com>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

--- >8 ----
List archives:  http://www.xiph.org/archives/
Paranoia homepage: http://www.xiph.org/paranoia/
To unsubscribe from this list, send a message to 'paranoia-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Paranoia mailing list