Examples of Bitstream


Examples of javazoom.jl.decoder.Bitstream

      return false;
    }
  }

  private int getFramesCount(String name) {
    Bitstream tmp = new Bitstream(getInputStream(name));
    int c = 0;
    try {
      while (skipFrame(tmp))
          c++;
    } catch (BitstreamException e1) {
      e1.printStackTrace();
    }
   
    try {
      tmp.close();
    } catch (BitstreamException e) {
      e.printStackTrace();
    }
    return c;
  }
View Full Code Here

Examples of javazoom.jl.decoder.Bitstream

    this(stream, null)
  }
 
  public Player(InputStream stream, AudioDevice device) throws JavaLayerException
  {
    bitstream = new Bitstream(stream);   
    decoder = new Decoder();
       
    if (device!=null)
    {   
      audio = device;
View Full Code Here

Examples of javazoom.jl.decoder.Bitstream

      progressListener.converterUpdate(ProgressListener.UPDATE_FRAME_COUNT, frameCount, 0);


      Obuffer output = null;
      Decoder decoder = new Decoder(decoderParams);
      Bitstream stream = new Bitstream(sourceStream);

      if (frameCount==-1)
        frameCount = Integer.MAX_VALUE;

      int frame = 0;
      long startTime = System.currentTimeMillis();

      try
      {
        for (; frame<frameCount; frame++)
        {
          try
          {
            Header header = stream.readFrame();
            if (header==null)
              break;

            progressListener.readFrame(frame, header);

            if (output==null)
            {
              // REVIEW: Incorrect functionality.
              // the decoder should provide decoded
              // frequency and channels output as it may differ from
              // the source (e.g. when downmixing stereo to mono.)
              int channels = (header.mode()==Header.SINGLE_CHANNEL) ? 1 : 2;
              int freq = header.frequency();
              output = new WaveFileObuffer(channels, freq, destName);
              decoder.setOutputBuffer(output);
            }

            Obuffer decoderOutput = decoder.decodeFrame(header, stream);

            // REVIEW: the way the output buffer is set
            // on the decoder is a bit dodgy. Even though
            // this exception should never happen, we test to be sure.
            if (decoderOutput!=output)
              throw new InternalError("Output buffers are different.");


            progressListener.decodedFrame(frame, header, output);

            stream.closeFrame();

          }
          catch (Exception ex)
          {
            boolean stop = !progressListener.converterException(ex);
View Full Code Here

Examples of javazoom.jl.decoder.Bitstream

    this(stream, null);
  }

  public AdvancedPlayer(InputStream stream, AudioDevice device) throws JavaLayerException
  {
    bitstream = new Bitstream(stream);

    if (device!=null) audio = device;
    else audio = FactoryRegistry.systemRegistry().createAudioDevice();
    audio.open(decoder = new Decoder());
  }
View Full Code Here

Examples of javazoom.jl.decoder.Bitstream

  private Object locked = new Object();
  private boolean seeking = false;
 
  public MP3FileDecoder(AudioStream in) {
    this.in = in;
    bitstream = new Bitstream(in);
    equalizer = new Equalizer();
    decoder = new Decoder();
    decoder.setEqualizer(equalizer);
    try {
      header = bitstream.readFrame();
View Full Code Here

Examples of javazoom.jlme.decoder.BitStream

  private boolean playable = true;
  //Runtime rt = null;


  public Player(InputStream stream) throws Exception {
    bitstream = new BitStream(stream);
    //rt = Runtime.getRuntime();
  }
View Full Code Here

Examples of net.javazoom.jl.decoder.Bitstream

    this(stream, null);
  }

  public AdvancedPlayer(InputStream stream, AudioDevice device) throws JavaLayerException
  {
    bitstream = new Bitstream(stream);

    if (device!=null) audio = device;
    else audio = FactoryRegistry.systemRegistry().createAudioDevice();
    audio.open(decoder = new Decoder());
  }
View Full Code Here

Examples of net.sourceforge.jaad.aac.syntax.BitStream

    if(!canDecode(config.getProfile())) throw new AACException("unsupported profile: "+config.getProfile().getDescription());

    syntacticElements = new SyntacticElements(config);
    filterBank = new FilterBank(config.isSmallFrameUsed(), config.getChannelConfiguration().getChannelCount());

    in = new BitStream();

    LOGGER.log(Level.FINE, "profile: {0}", config.getProfile());
    LOGGER.log(Level.FINE, "sf: {0}", config.getSampleFrequency().getFrequency());
    LOGGER.log(Level.FINE, "channels: {0}", config.getChannelConfiguration().getDescription());
  }
View Full Code Here

Examples of org.dspace.content.Bitstream

        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {
                    Bitstream bitstream = Bitstream.find(context,
                            Integer.parseInt(row.getLabel()));

                    SolrQuery solrQuery = new SolrQuery();
                    solrQuery.setQuery(getFromField() +":"+ Constants.BITSTREAM + "-"+ bitstream.getID());
                    try
                    {
                        QueryResponse solrQueryResponse = crisSearchService.search(solrQuery);
                        for (SolrDocument doc : solrQueryResponse.getResults())
                        {
View Full Code Here

Examples of org.dspace.content.Bitstream

            AuthorizeException
    {
        boolean formatKnown = true;
        boolean fileOK = false;
        BitstreamFormat bf = null;
        Bitstream b = null;
        //NOTE: File should already be uploaded.
        //Manakin does this automatically via Cocoon.
        //For JSP-UI, the SubmissionController.uploadFiles() does the actual upload

        Enumeration attNames = request.getAttributeNames();
       
        //loop through our request attributes
        while(attNames.hasMoreElements())
        {
            String attr = (String) attNames.nextElement();
           
            //if this ends with "-path", this attribute
            //represents a newly uploaded file
            if(attr.endsWith("-path"))
            {
                //strip off the -path to get the actual parameter
                //that the file was uploaded as
                String param = attr.replace("-path", "");
               
                // Load the file's path and input stream and description
                String filePath = (String) request.getAttribute(param + "-path");
                InputStream fileInputStream = (InputStream) request
                                    .getAttribute(param + "-inputstream");
               
                //attempt to get description from attribute first, then direct from a parameter
                String fileDescription =  (String) request
                                    .getAttribute(param + "-description");
                if(fileDescription==null ||fileDescription.length()==0)
                    request.getParameter("description");
               
                // if information wasn't passed by User Interface, we had a problem
                // with the upload
                if (filePath == null || fileInputStream == null)
                    return STATUS_UPLOAD_ERROR;
               
                if (subInfo != null)
                {
                    // Create the bitstream
                    Item item = subInfo.getSubmissionItem().getItem();
       
                    // do we already have a bundle?
                    Bundle[] bundles = item.getBundles("ORIGINAL");
       
                    if (bundles.length < 1)
                    {
                        // set bundle's name to ORIGINAL
                        b = item.createSingleBitstream(fileInputStream, "ORIGINAL");
                    }
                    else
                    {
                        // we have a bundle already, just add bitstream
                        b = bundles[0].createBitstream(fileInputStream);
                    }
       
                    // Strip all but the last filename. It would be nice
                    // to know which OS the file came from.
                    String noPath = filePath;
       
                    while (noPath.indexOf('/') > -1)
                    {
                        noPath = noPath.substring(noPath.indexOf('/') + 1);
                    }
       
                    while (noPath.indexOf('\\') > -1)
                    {
                        noPath = noPath.substring(noPath.indexOf('\\') + 1);
                    }
       
                    b.setName(noPath);
                    b.setSource(filePath);
                    b.setDescription(fileDescription);
       
                    // Identify the format
                    bf = FormatIdentifier.guessFormat(context, b);
                    b.setFormat(bf);
       
                    // Update to DB
                    b.update();
                    item.update();
       
                    if (bf == null || !bf.isInternal())
                    {
                        fileOK = true;
                    }
                    else
                    {
                        log.warn("Attempt to upload file format marked as internal system use only");
                       
                        // remove bitstream from bundle..
                        // delete bundle if it's now empty
                        Bundle[] bnd = b.getBundles();

                        bnd[0].removeBitstream(b);

                        Bitstream[] bitstreams = bnd[0].getBitstreams();
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.