Examples of AudioData


Examples of com.jme3.audio.AudioData

            }
        }
    }
   
    public Object load(AssetInfo info) throws IOException {
        AudioData data;
        InputStream inputStream = null;
        try {
            inputStream = info.openStream();
            data = load(inputStream, ((AudioKey)info.getKey()).isStream());
            if (data instanceof AudioStream){
View Full Code Here

Examples of com.jme3.audio.AudioData

        boolean streamCache = key.useStreamCache();
       
        InputStream in = null;
        try {
            in = info.openStream();
            AudioData data = load(in, readStream, streamCache);
            if (data instanceof AudioStream){
                // audio streams must remain open
                in = null;
            }
            return data;
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

 
      // I can stream audio
      //packets successfully using linear PCM at 11025Hz. For those packets I
      //push one byte (0x06) which specifies the format of audio data in a
      //ByteBuffer, and then real audio data:
      RTMPMessage rtmpMsg = RTMPMessage.build(new AudioData(buffer), (int) ts);
      client.publishStreamData(streamId, rtmpMsg);
    }
  }
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

          if (audioCodec != null) {
            //check for decoder configuration to send
            IoBuffer config = audioCodec.getDecoderConfiguration();
            if (config != null) {
              log.debug("Decoder configuration is available for {}", audioCodec.getName());
              AudioData audioConf = new AudioData(config.asReadOnlyBuffer());
              try {
                log.debug("Setting decoder configuration for recording");
                listener.getFileConsumer().setAudioDecoderConfiguration(audioConf);
              } finally {
                audioConf.release();
              }
            }
          } else {
            log.debug("No decoder configuration available, audioCodec is null.");
          }
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

        ITag tag = reader.readTag();
        if (tag != null) {
          int timestamp = tag.getTimestamp();
          switch (tag.getDataType()) {
            case Constants.TYPE_AUDIO_DATA:
              msg = new AudioData(tag.getBody());
              break;
            case Constants.TYPE_VIDEO_DATA:
              msg = new VideoData(tag.getBody());
              break;
            case Constants.TYPE_INVOKE:
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

          if (audioCodec != null) {
            //check for decoder configuration to send
            IoBuffer config = audioCodec.getDecoderConfiguration();
            if (config != null) {
              log.debug("Decoder configuration is available for {}", audioCodec.getName());
              AudioData audioConf = new AudioData(config.asReadOnlyBuffer());
              try {
                log.debug("Setting decoder configuration for recording");
                listener.getFileConsumer().setAudioDecoderConfiguration(audioConf);
              } finally {
                audioConf.release();
              }
            }
          } else {
            log.debug("No decoder configuration available, audioCodec is null.");
          }
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

      }
      // if no message has been sent by this point send an audio packet
      if (!messageSent) {
        // Send blank audio packet to notify client about new position
        log.debug("Sending blank audio packet");
        AudioData audio = new AudioData();
        audio.setTimestamp(seekPos);
        audio.setHeader(new Header());
        audio.getHeader().setTimer(seekPos);
        RTMPMessage audioMessage = RTMPMessage.build(audio);
        lastMessageTs = seekPos;
        doPushMessage(audioMessage);
        audioMessage.getBody().release();
      }
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

          break;
        case Constants.TYPE_AUDIO_DATA:
          log.trace("Audio data");
          buf = ((AudioData) msg).getData();
          if (buf != null) {
            AudioData audioData = new AudioData(buf.asReadOnlyBuffer());
            audioData.setHeader(header);
            audioData.setTimestamp(header.getTimer());
            log.trace("Source type: {}", ((AudioData) msg).getSourceType());
            audioData.setSourceType(((AudioData) msg).getSourceType());
            audio.write(audioData);
          } else {
            log.warn("Audio data was not found");
          }
          break;
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

              event = new Aggregate(buffer);
              event.setTimestamp(cachedEvent.getTimestamp());
              message = RTMPMessage.build(event);
              break;
            case Constants.TYPE_AUDIO_DATA:
              event = new AudioData(buffer);
              event.setTimestamp(cachedEvent.getTimestamp());
              message = RTMPMessage.build(event);
              break;
            case Constants.TYPE_VIDEO_DATA:
              event = new VideoData(buffer);
              event.setTimestamp(cachedEvent.getTimestamp());
              message = RTMPMessage.build(event);
              break;
            default:
              event = new Notify(buffer);
              event.setTimestamp(cachedEvent.getTimestamp());
              message = RTMPMessage.build(event);
              break;
          }
          // push it down to the recorder
          recordingConsumer.pushMessage(null, message);
        } else if (bufferLimit == 0 && dataType == Constants.TYPE_AUDIO_DATA) {
          log.debug("Stream data size was 0, sending empty audio message");
          // allow for 0 byte audio packets
          event = new AudioData(IoBuffer.allocate(0));
          event.setTimestamp(cachedEvent.getTimestamp());
          message = RTMPMessage.build(event);
          // push it down to the recorder
          recordingConsumer.pushMessage(null, message);
        } else {
View Full Code Here

Examples of org.red5.server.net.rtmp.event.AudioData

            // check for decoder configuration to send
            IoBuffer config = audioCodec.getDecoderConfiguration();
            if (config != null) {
              log.debug("Decoder configuration is available for {}", audioCodec.getName());
              //log.debug("Dump:\n{}", Hex.encodeHex(config.array()));
              AudioData conf = new AudioData(config.asReadOnlyBuffer());
              log.trace("Configuration ts: {}", conf.getTimestamp());
              RTMPMessage confMsg = RTMPMessage.build(conf);
              try {
                log.debug("Pushing decoder configuration");
                msgOut.pushMessage(confMsg);
              } finally {
                conf.release();
              }
            }
          } else {
            log.debug("No decoder configuration available, audioCodec is null");
          }
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.