Examples of IWavSample


Examples of com.voyagegames.core.audio.editing.interfaces.IWavSample

    final int durationInMilliseconds = (numSamples / sampleRate) * 1000;
    final byte[] sampleData = new byte[dataSize];
   
    System.arraycopy(data, offset + 8, sampleData, 0, dataSize);
   
    IWavSample sample = null;
   
    if (bitSize == 8) {
      sample = new WavSample8Bit(sampleRate, durationInMilliseconds, Frequency.A_4, numChannels);
    } else if (bitSize == 16) {
      sample = new WavSample16Bit(sampleRate, durationInMilliseconds, Frequency.A_4, numChannels);
    } else {
      throw new IllegalArgumentException("Something bad happened; should not have hit this");
    }
   
    sample.setGenerated(sampleData);
    sample.generateSampleFromGenerated();
    return sample;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.