[comp.sys.next] playing an arbitrary part of a soundfile

paul@phoenix.Princeton.EDU (Paul Lansky) (05/27/89)

It seems that the playFrom selector described in the online documentation
of the sound object is not included (yet?).  Is there another way to 
play an arbitrary part of a soundfile?  Aside from using SoundView?

Paul Lansky

ali@polya.Stanford.EDU (Ali T. Ozer) (05/28/89)

In article <8714@phoenix.Princeton.EDU> Paul Lansky writes:
>It seems that the playFrom selector described in the online documentation
>of the sound object is not included (yet?).  Is there another way to 
>play an arbitrary part of a soundfile?  Aside from using SoundView?

Use the copySamples:at:count: method to copy the desired portion of
the sound to another sound object. You can then play that sound object
for the same behaviour once provided by playFrom:count:.

Before you say "but that sounds so inefficient," let me add that it isn't;
the copy involves lots of Mach magic and not much real data copying is done
(unless you somehow write into the data later, of course). 

Ali Ozer, NeXT Developer Support
aozer@NeXT.com