Squeak Class Documentation category index | class index  
 
AIFFFileReader
  category: Sound-Synthesis
  superclass: Object
  subclasses:

I am a parser for AIFF (audio interchange file format) files. I can read uncompressed 8-bit and 16-bit mono, stereo, or multichannel AIFF files. I read the marker information used by the TransferStation utility to mark the loop points in sounds extracted from commercial sampled-sound CD-ROMs.

instance methods
  accessing
  bitsPerSample
channelCount
channelData
channelDataOffset
frameCount
gain
isLooped
isStereo
leftSamples
loopEnd
loopLength
markers
pitch
rightSamples
samplingRate

  other
  edit
pitchForKey:
sound

  private
  readChunk:size:
readCommonChunk:
readExtendedFloat
readFrom:
readInstrumentChunk:
readMarkerChunk:
readMergedStereoChannelDataFrom:
readMonoChannelDataFrom:
readMultiChannelDataFrom:
readSamplesChunk:
readStereoChannelDataFrom:

  reading
  readFrom:mergeIfStereo:skipDataChunk:
readFromFile:
readFromFile:mergeIfStereo:skipDataChunk:

class methods
  no messages
 

instance methods
  accessing top  
 

bitsPerSample


 

channelCount


 

channelData


 

channelDataOffset


 

frameCount


 

gain


 

isLooped


 

isStereo


 

leftSamples


 

loopEnd


 

loopLength


 

markers


 

pitch


 

rightSamples


 

samplingRate


  other top  
 

edit


 

pitchForKey:

Convert my MIDI key number to a pitch and return it.


 

sound

Answer the sound represented by this AIFFFileReader. This method should be called only after readFrom: has been done.


  private top  
 

readChunk:size:

Read a AIFF chunk of the given type. Skip unrecognized chunks. Leave the input stream positioned chunkSize bytes past its position when this method is called.


 

readCommonChunk:

Read a COMM chunk. All AIFF files have exactly one chunk of this type.


 

readExtendedFloat

Read and answer an Apple extended-precision 80-bit floating point number from the input stream.


 

readFrom:

Read AIFF data from the given binary stream.


 

readInstrumentChunk:


 

readMarkerChunk:


 

readMergedStereoChannelDataFrom:

Read stereophonic channel data from the given stream, mixing the two channels to create a single monophonic channel. Each frame contains two samples.


 

readMonoChannelDataFrom:

Read monophonic channel data from the given stream. Each frame contains a single sample.


 

readMultiChannelDataFrom:

Read multi-channel data from the given stream. Each frame contains channelCount samples.


 

readSamplesChunk:

Read a SSND chunk. All AIFF files with a non-zero frameCount contain exactly one chunk of this type.


 

readStereoChannelDataFrom:

Read stereophonic channel data from the given stream. Each frame contains two samples.


  reading top  
 

readFrom:mergeIfStereo:skipDataChunk:

Read the AIFF file of the given name. If mergeFlag is true and the file contains stereo data, then the left and right channels will be mixed together as the samples are read in. If skipDataFlag is true, then the data chunk to be skipped; this allows the other chunks of a file to be processed in order to extract format information quickly without reading the data.


 

readFromFile:

Read the AIFF file of the given name.


 

readFromFile:mergeIfStereo:skipDataChunk:

Read the AIFF file of the given name. See comment in readFromStream:mergeIfStereo:skipDataChunk:.


class methods
  no messages top