com.softsynth.jmsl.jsyn
Class SampleLoader

java.lang.Object
  extended by com.softsynth.jmsl.jsyn.SampleLoader

public class SampleLoader
extends java.lang.Object

Load SynthSamples from a file or from a URL. Maintain a Hashtable of filename keys pointing to synthSamples to avoid loading any sample more than once.

Author:
Nick Didkovsky, June 3, 2002

Constructor Summary
SampleLoader()
           
 
Method Summary
static void clearSamples()
          Clear the static vector of SynthSample built by multiple calls to load() (for example, call this in applet.stop() after JSyn's synth engine is stopped, to prevent invalid tokens upon reloading)
static void clearShorts()
          Clear the static vector of shorts built by multiple calls to loadShorts()
static com.softsynth.jsyn.SynthSample load(java.lang.String fileName)
          load a SynthSample from disk file.
static com.softsynth.jsyn.SynthSample load(java.net.URL url)
          load a SynthSample from URL.
static short[] loadShorts(java.lang.String fileName)
           
static short[] loadShorts(java.net.URL url)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleLoader

public SampleLoader()
Method Detail

load

public static com.softsynth.jsyn.SynthSample load(java.lang.String fileName)
                                           throws java.io.IOException
load a SynthSample from disk file. Smart, checks for WAV/AIFF filetype

Throws:
java.io.IOException

load

public static com.softsynth.jsyn.SynthSample load(java.net.URL url)
                                           throws java.io.IOException
load a SynthSample from URL. Smart, checks for WAV/AIFF filetype

Throws:
java.io.IOException

loadShorts

public static short[] loadShorts(java.lang.String fileName)
                          throws java.io.IOException,
                                 com.softsynth.jsyn.SynthException
Throws:
java.io.IOException
com.softsynth.jsyn.SynthException

loadShorts

public static short[] loadShorts(java.net.URL url)
                          throws java.io.IOException
Throws:
java.io.IOException

clearSamples

public static void clearSamples()
Clear the static vector of SynthSample built by multiple calls to load() (for example, call this in applet.stop() after JSyn's synth engine is stopped, to prevent invalid tokens upon reloading)


clearShorts

public static void clearShorts()
Clear the static vector of shorts built by multiple calls to loadShorts()


main

public static void main(java.lang.String[] args)