Package net.sf.asap

Examples of net.sf.asap.ASAP


    selectCommand = new Command("Select", Command.ITEM, 1);
    backCommand = new Command("Back", Command.BACK, 1);
    stopCommand = new Command("Stop", Command.STOP, 1);
    exitCommand = new Command("Exit", Command.EXIT, 2);
    module = new byte[ASAP.MODULE_MAX];
    asap = new ASAP();
    displayFileList(new FileList("Select File", "", null, FileSystemRegistry.listRoots()));
  }
View Full Code Here


  {
    InputStream is = new FileInputStream(inputFilename);
    byte[] module = new byte[ASAP.MODULE_MAX];
    int module_len = is.read(module);
    is.close();
    ASAP asap = new ASAP();
    asap.load(inputFilename, module, module_len);
    ASAP_ModuleInfo module_info = asap.getModuleInfo();
    if (song < 0)
      song = module_info.default_song;
    if (duration < 0) {
      duration = module_info.durations[song];
      if (duration < 0)
        duration = 180 * 1000;
    }
    asap.playSong(song, duration);
    asap.mutePokeyChannels(muteMask);
    if (outputFilename == null) {
      int i = inputFilename.lastIndexOf('.');
      outputFilename = inputFilename.substring(0, i + 1) + (outputHeader ? "wav" : "raw");
    }
    OutputStream os;
    if (outputFilename.equals("-"))
      os = System.out;
    else
      os = new FileOutputStream(outputFilename);
    byte[] buffer = new byte[8192];
    if (outputHeader) {
      asap.getWavHeader(buffer, format);
      os.write(buffer, 0, ASAP.WAV_HEADER_BYTES);
    }
    int n_bytes;
    do {
      n_bytes = asap.generate(buffer, format);
      os.write(buffer, 0, n_bytes);
    } while (n_bytes == buffer.length);
    os.close();
    outputFilename = null;
    song = -1;
View Full Code Here

TOP

Related Classes of net.sf.asap.ASAP

Copyright © 2018 www.massapicom. 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.