RiTa
index
Name RiSample
Description Simple library-agnostic audio support for RiTa that handles playback of .wav and .aiff samples and server-based streaming of .mp3s. The following example create a sample object attached to a RiText object.
 
    RiText rt = new RiText(this);
    RiSample sample = rt.loadSample("sampleName.aiff");
Constructors
Methods
fadeVolume()   Fades volume to new value between 0 and 1

getCurrentFrame()   Returns current frame in sample

getNumFrames()   Returns total # of frames in sample

getPan()   Returns current panValue

getVolume()   Returns current volume for the sample

isLooping()   Returns true if the sample is looping

isPlaying()   Returns true if the sample is playing

load()   Loads the sample specified by sampleFileName and sets the initial volume to initialVolume

loop()   Loads and loops indefinately the sample specified by 'sampleFileName'

mute()   Mutes or unmutes the current sample

pan()   Pans sound between left(-1) and right (1)

pause()   Pauses the currently playing sample

play()   Loads and starts the sample specified by 'sampleFileName'

setCurrentFrame()   Moves the playhead to the specified frame

setVolume()   Set volume between 0 and 1 for the current sample

stop()   Stops the currently playing sample

stopFade()   Stops any in-progress 'fades' on the current sample

stopPan()   Stops any in-progress 'pans' on the current sample

RiSample.disableGainWarnings()  

RiSample.setDefaultVolume()   Sets the default volume, e.g., the starting volume, for the sample

Usage Web & Application