Class SampleLoader

java.lang.Object
com.softsynth.jmsl.jsyn2.SampleLoader

public class SampleLoader
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    SampleLoader()  
  • Method Summary

    Modifier and Type Method Description
    static void clearFloats()
    Clear the static vector of shorts built by multiple calls to loadShorts()
    static void clearSamples()
    Clear the static vector of com.jsyn.data.AudioSample 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 com.jsyn.data.AudioSample getCrossFadedLoop​(com.jsyn.data.AudioSample sample, int loopStartFrame, int loopEndFrame, int crossFadeInFrames)  
    static com.jsyn.data.FloatSample load​(java.io.File file)
    load a com.jsyn.data.FloatSample from disk file.
    static com.jsyn.data.FloatSample load​(java.lang.String fileName)
    load a com.jsyn.data.FloatSample from disk file.
    static com.jsyn.data.FloatSample load​(java.net.URL url)
    load a com.jsyn.data.FloatSample from 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 Details

    • SampleLoader

      public SampleLoader()
  • Method Details

    • clearSamples

      public static void clearSamples()
      Clear the static vector of com.jsyn.data.AudioSample 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)
    • clearFloats

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

      public static com.jsyn.data.FloatSample load​(java.lang.String fileName) throws java.io.IOException, javax.sound.sampled.UnsupportedAudioFileException
      load a com.jsyn.data.FloatSample from disk file.
      Throws:
      javax.sound.sampled.UnsupportedAudioFileException
      java.io.IOException
    • load

      public static com.jsyn.data.FloatSample load​(java.io.File file) throws java.io.IOException, javax.sound.sampled.UnsupportedAudioFileException
      load a com.jsyn.data.FloatSample from disk file.
      Throws:
      javax.sound.sampled.UnsupportedAudioFileException
      java.io.IOException
    • load

      public static com.jsyn.data.FloatSample load​(java.net.URL url) throws java.io.IOException, javax.sound.sampled.UnsupportedAudioFileException
      load a com.jsyn.data.FloatSample from URL. Smart, checks for WAV/AIFF filetype
      Throws:
      javax.sound.sampled.UnsupportedAudioFileException
      java.io.IOException
    • getCrossFadedLoop

      public static com.jsyn.data.AudioSample getCrossFadedLoop​(com.jsyn.data.AudioSample sample, int loopStartFrame, int loopEndFrame, int crossFadeInFrames)
    • main

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