| A second thought about Richard Dobson's suggestions (below) is that I,
personally, would find the option of an independent 'sndinfo' opcode
preferable in the long run (rather than extending the existing sound-file
opcodes) because I can already forsee instances where the information would
be useful without having to call-up the soundin/diskin opcodes (eg. you may
wish to write a file of identical length as the original or maybe write some
k-rate control procedure but don't require the source sound).
Just a thought in case any of you brilliant and talented programmers fancied
the challenge of writing something :)
Thanks
Richard Bowers.
From: Richard Dobson
> Of course the silly thing about this is that the information is already
> there in the file header. An elegant solution would be to extend the
> soundin and diskin opcodes to return a second value. Ideally this should
> be optional - is such a thing feasible with the current Csound syntax?
> Alternatively, 'sndinfo' could become an opcode.
>
>
> Richard Dobson
>
> > > From: richard bowers
> > [mailto:richardbowers@simulacrum.freeserve.co.uk]
> > > Sent: Friday, July 09, 1999 3:45 AM
> > > To: csound csound
> > > Subject: Audio file lengths
> > >
> > >
> > > Can anyone offer me a solution to obtaining the duration (if
> > > possible) or
> > > file size of an audio file stored on disk from within a
> > > instrument? I feel
> > > it would be useful to know the duration of a file to make
> > > better use of -
> > > and prevent errors when using - the skiptime on the
> > > soundin/diskin ugs.
> > >
> > > Thanks,
> > > Richard Bowers.
|