Package org.open2jam.parsers.utils

Examples of org.open2jam.parsers.utils.SampleData


      else if (ext.equals(".ogg")) t = SampleData.Type.OGG;
      else if (ext.equals(".mp3")) t = SampleData.Type.MP3;
      else { //not a music file so continue
          continue;
      }
      samples.put(entry.getKey(), new SampleData(new FileInputStream(f), t, f.getName()));
        }
    }
      } catch (IOException ex) {
    Logger.global.log(Level.SEVERE, "{0}", ex);
      }
View Full Code Here


    case 16: M30_xor(sample_data, mask_nami); break;
    case 32: M30_xor(sample_data, mask_0412); break;
    default: Logger.global.log(Level.WARNING, "Unknown encryption flag({0}) !", encryption_flag);
      }

            SampleData audioData = new SampleData(new ByteArrayInputStream(sample_data), SampleData.Type.OGG, sample_name);
            int value = ref;
            if(codec_code == 0){
                value = 1000 + ref;
            }
            else if(codec_code != 5){
View Full Code Here

           buffer = ByteBuffer.allocateDirect(buf.length);
           buffer.put(buf);
           buffer.flip();

           SampleData audioData = new SampleData(new ByteBufferInputStream(buffer), header, sample_name);
           samples.put(sample_id, audioData);
           sample_id++;
       }
       sample_id = 1000; // ogg samples use id 1000~?
       while(file_offset < filesize) // OGG data
       {
           buffer = f.getChannel().map(java.nio.channels.FileChannel.MapMode.READ_ONLY, file_offset, 36);
           buffer.order(java.nio.ByteOrder.LITTLE_ENDIAN);
           file_offset += 36;

           byte[] byte_name = new byte[32];
           buffer.get(byte_name);
     String sample_name = ByteHelper.toString(byte_name);
     if(sample_name.lastIndexOf(".") < 0) sample_name += ".ogg";
    
           int sample_size = buffer.getInt();

           if(sample_size == 0){ sample_id++; continue; }

           buffer = f.getChannel().map(java.nio.channels.FileChannel.MapMode.READ_ONLY, file_offset, sample_size);
           buffer.order(java.nio.ByteOrder.LITTLE_ENDIAN);
           file_offset += sample_size;

           SampleData audioData = new SampleData(new ByteBufferInputStream(buffer), SampleData.Type.OGG, sample_name);
           samples.put(sample_id, audioData);
           sample_id++;
       }

       return samples;
View Full Code Here

      else if (ext.equals(".ogg")) t = SampleData.Type.OGG;
      else if (ext.equals(".mp3")) t = SampleData.Type.MP3;
      else { //not a music file so continue
          continue;
      }
      samples.put(entry.getKey(), new SampleData(new FileInputStream(f), t, f.getName()));
      break;
        }
    }
      } catch (IOException ex) {
    Logger.global.log(Level.SEVERE, "{0}", ex);
View Full Code Here

        // get the chart sound samples
  sounds = new HashMap<Integer, Sound>();
        for(Entry<Integer, SampleData> entry : chart.getSamples().entrySet())
        {
            SampleData sampleData = entry.getValue();
            try {
                Sound sound = soundSystem.load(sampleData);
                sounds.put(entry.getKey(), sound);
            } catch (SoundSystemException ex) {
                java.util.logging.Logger.getLogger(Render.class.getName()).log(Level.SEVERE, "{0}", ex);
View Full Code Here

TOP

Related Classes of org.open2jam.parsers.utils.SampleData

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.