Android Open Source - voicelink Audio Send Manage






From Project

Back to project page voicelink.

License

The source code is released under:

Apache License

If you think the Android project voicelink listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.audio.send;
/*from www.j  a va  2 s  . c o m*/
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;

import android.media.MediaCodec;

public class AudioSendManage {

  public AACStream mAACStream;

  public MediaCodec mMediaCodec;

  public MediaCodecInputStream mMediaCodecInputStream;

  public ByteBuffer[] mMediaCodecInputBuffers;
  public ByteBuffer[] mMediaCodecOutputBuffers = null;

  public AACLATMPacketizer mAACLATMPacketizer;

  public SendSocket sendSocket;

  InetSocketAddress dest;
  int port;

  public void initialize() {
    mAACStream = new AACStream();
    mAACStream.initializeMediaCodec();
    mMediaCodec = mAACStream.mMediaCodec;

    mMediaCodecInputBuffers = mAACStream.mMediaCodecInputBuffers;
    mMediaCodecInputStream = new MediaCodecInputStream(mMediaCodec);
    mMediaCodecOutputBuffers = mMediaCodecInputStream.mMediaCodecOutputBuffers;

    mAACLATMPacketizer = new AACLATMPacketizer();
    mAACLATMPacketizer.mMediaCodecInputStream = mMediaCodecInputStream;

    sendSocket = new SendSocket();
    dest = new InetSocketAddress("192.168.1.7", 8051);
    port = 8051;
    sendSocket.setDestination(dest, port, 8080);
    sendSocket.setCacheSize(0);

    mAACLATMPacketizer.sendSocket = sendSocket;

  }

  public void start() {
    try {
      mAACStream.encodeWithMediaCodec();

      mAACLATMPacketizer.start();

    } catch (IOException e) {
      e.printStackTrace();
    }
  }

}




Java Source Code List

net.audio.example2.MainActivity.java
net.audio.example2.testActivity.java
net.audio.recieve.AACLATMunPacketizer.java
net.audio.recieve.AACStream.java
net.audio.recieve.AudioQuality.java
net.audio.recieve.AudioRecieveManage.java
net.audio.recieve.MediaCodecInputStream.java
net.audio.recieve.RecieveSocket.java
net.audio.send.AACLATMPacketizer.java
net.audio.send.AACStream.java
net.audio.send.AudioQuality.java
net.audio.send.AudioSendManage.java
net.audio.send.MediaCodecInputStream.java
net.audio.send.SendSocket.java