Environment: Siren
Instances of SoundFile are used for reading and writing sound objects to/from files using the libSndFile API.
Instance variables:
accessing
sound
rate
channels
fileName
file
position
headerSize
properties
format
size
channels: theChannels
Accept the argument, 'theChannels', as the new instance variable 'channels'.
fileFormat
fileFormat: aValue
format
mode: theMode
Set the receiver's mode to #read or #write
name
Answer the instance variable 'name'.
name: theFileName
Accept the argument, 'theFileName', as the new instance variable 'name'.
rate
Return the instance variable 'rate'.
rate: aRate
Set the instance variable 'rate'.
sampleFormat
sampleFormat: aValue
samples
Return the instance variable 'samples'.
size
Answer the number of sample frames in the file.
size: aNumber
Set the number of sample frames in the file.
sizeInSamples
Answer the number of sample frames in the file.
sound
Answer the instance variable 'sound'.
sound: theSound
Accept the argument, 'theSound', as the new instance variable 'sound'.
read/write
Read samples from the file into the sample buffer.
readSamples: sndClass
Read samples from the file into the sample buffer.
saveSound: snd
Write samples from the given sound to the receiver file.
printing
Format and print the receiver on the argument.
initialize-release
Close the receiver's file.
initialize
Set up the instance variables of a default sound file.
open
Open the named file and read the header
openForReading
Open the named file and read the header
MetaClass: SoundFile class
instance creation
Open the given file (EBICSF, SPARC, or NeXT soundfile format)
openFileNamed: nameString
Open the given file (EBICSF, SPARC, AIFF, or NeXT soundfile format)
readFileNamed: nameString
Open the given file (EBICSF, SPARC, or NeXT soundfile format)
readFileNamed: nameString answer: theClass
Open the given file (EBICSF, SPARC, or NeXT soundfile format)
releaseFileIndex: index
Free the given sound file index
class initialization
Set up the file format and sample format dictionaries to interface with libsndfile.