Tabnine Logo
AudioFormat.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
javax.media.format.AudioFormat
constructor

Best Java code snippets using javax.media.format.AudioFormat.<init> (Showing top 20 results out of 315)

origin: igniterealtime/Smack

/**
 * Return a JMF AudioFormat for a given Jingle Payload type.
 * Return null if the payload is not supported by this jmf API.
 *
 * @param payloadtype payloadtype
 * @return correspondent audioType
 */
public static AudioFormat getAudioFormat(PayloadType payloadtype) {
  switch (payloadtype.getId()) {
    case 0:
      return new AudioFormat(AudioFormat.ULAW_RTP);
    case 3:
      return new AudioFormat(AudioFormat.GSM_RTP);
    case 4:
      return new AudioFormat(AudioFormat.G723_RTP);
    default:
      return null;
  }
}
origin: igniterealtime/Smack

localhost = InetAddress.getLocalHost();
AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7002, 7020, new AudioFormat(AudioFormat.GSM_RTP), null);
AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7020, 7002, new AudioFormat(AudioFormat.GSM_RTP), null);
origin: igniterealtime/Smack

try {
  AudioFormat af = new AudioFormat(AudioFormat.LINEAR, 44100, 16,
      2);
  rend.setInputFormat(af);
origin: jitsi/libjitsi

/**
 * Initializes a new <tt>AudioMediaFormatImpl</tt> instance with the
 * specified encoding and a single audio channel.
 *
 * @param encoding the encoding of the new <tt>AudioMediaFormatImpl</tt>
 * instance
 */
public AudioMediaFormatImpl(String encoding)
{
  this(new AudioFormat(encoding));
}
origin: jitsi/libjitsi

public JavaDecoder()
{
  supportedInputFormats = new AudioFormat[]
  { new AudioFormat(AudioFormat.ULAW) };
  defaultOutputFormats = new AudioFormat[]
  { new AudioFormat(AudioFormat.LINEAR) };
  PLUGIN_NAME = "Mu-Law Decoder";
}
origin: jitsi/libjitsi

/**
 * Creates DePacketizer
 */
public DePacketizer()
{
  inputFormats = new Format[]{new AudioFormat(Constants.ALAW_RTP)};
}
origin: jitsi/libjitsi

/**
 * Constructs a new <tt>Packetizer</tt>.
 */
public Packetizer()
{
  super();
  this.inputFormats = new Format[]{
      new AudioFormat(
          AudioFormat.GSM,
          8000,
          8,
          1,
          Format.NOT_SPECIFIED,
          AudioFormat.SIGNED,
          264,
          Format.NOT_SPECIFIED,
          Format.byteArray)};
}
origin: jitsi/libjitsi

/**
 * Constructs a new <tt>DePacketizer</tt>.
 */
public DePacketizer()
{
  super();
  this.inputFormats = new Format[] {
    new AudioFormat(
        AudioFormat.GSM_RTP,
        8000,
        8,
        1,
        Format.NOT_SPECIFIED,
        AudioFormat.SIGNED,
        264,
        Format.NOT_SPECIFIED,
        Format.byteArray)};
}
origin: jitsi/libjitsi

/**
 * Constructs a new <tt>Encoder</tt>.
 */
public Encoder()
{
  super();
  this.inputFormats = new Format[]{
      new AudioFormat(
          AudioFormat.LINEAR,
          8000,
          16,
          1,
          AudioFormat.BIG_ENDIAN,
          AudioFormat.SIGNED,
          Format.NOT_SPECIFIED,
          Format.NOT_SPECIFIED,
          Format.byteArray)
  };
}
origin: jitsi/libjitsi

/**
 * Initializes a new <tt>AudioLevelEffect2</tt>.
 */
public AudioLevelEffect2()
{
  supportedAudioFormats
      = new Format[]
      {
          new AudioFormat(
              AudioFormat.LINEAR,
              Format.NOT_SPECIFIED,
              16,
              1,
              AudioFormat.LITTLE_ENDIAN,
              AudioFormat.SIGNED,
              16,
              Format.NOT_SPECIFIED,
              Format.byteArray)
      };
}
origin: jitsi/libjitsi

/**
 * Constructs a new <tt>Decoder</tt>.
 */
public Decoder()
{
  super();
  this.inputFormats = new Format[]
  {
    new AudioFormat(
        AudioFormat.GSM,
        8000,
        8,
        1,
        Format.NOT_SPECIFIED,
        AudioFormat.SIGNED,
        264,
        Format.NOT_SPECIFIED,
        Format.byteArray)
  };
}
origin: jitsi/libjitsi

/**
 * The minimum and maximum values of the scale
 */
public AudioLevelEffect()
{
  supportedAudioFormats
    = new Format[]
        {
          new AudioFormat(
              AudioFormat.LINEAR,
              Format.NOT_SPECIFIED,
              16,
              1,
              AudioFormat.LITTLE_ENDIAN,
              AudioFormat.SIGNED,
              16,
              Format.NOT_SPECIFIED,
              Format.byteArray)
        };
}
origin: jitsi/libjitsi

public JavaEncoder()
{
  supportedInputFormats = new AudioFormat[] {
      new AudioFormat(AudioFormat.LINEAR, Format.NOT_SPECIFIED, 16,
          1, Format.NOT_SPECIFIED, Format.NOT_SPECIFIED),
      new AudioFormat(AudioFormat.LINEAR, Format.NOT_SPECIFIED, 16,
          2, Format.NOT_SPECIFIED, Format.NOT_SPECIFIED),
      new AudioFormat(AudioFormat.LINEAR, Format.NOT_SPECIFIED, 8, 1,
          Format.NOT_SPECIFIED, Format.NOT_SPECIFIED),
      new AudioFormat(AudioFormat.LINEAR, Format.NOT_SPECIFIED, 8, 2,
          Format.NOT_SPECIFIED, Format.NOT_SPECIFIED) }; // support
                                  // 1/2
                                  // channels
                                  // and
                                  // 8/16
                                  // bit
                                  // samples
  defaultOutputFormats = new AudioFormat[] { new AudioFormat(
      AudioFormat.ULAW, 8000, 8, 1, Format.NOT_SPECIFIED,
      Format.NOT_SPECIFIED) };
  PLUGIN_NAME = "pcm to mu-law converter";
}
origin: org.igniterealtime.smack/smackx-jingle

/**
 * Return a JMF AudioFormat for a given Jingle Payload type.
 * Return null if the payload is not supported by this jmf API.
 *
 * @param payloadtype payloadtype
 * @return correspondent audioType
 */
public static AudioFormat getAudioFormat(PayloadType payloadtype) {
  switch (payloadtype.getId()) {
    case 0:
      return new AudioFormat(AudioFormat.ULAW_RTP);
    case 3:
      return new AudioFormat(AudioFormat.GSM_RTP);
    case 4:
      return new AudioFormat(AudioFormat.G723_RTP);
    default:
      return null;
  }
}
origin: org.igniterealtime.smack/smack-jingle

/**
 * Return a JMF AudioFormat for a given Jingle Payload type.
 * Return null if the payload is not supported by this jmf API.
 *
 * @param payloadtype payloadtype
 * @return correspondent audioType
 */
public static AudioFormat getAudioFormat(PayloadType payloadtype) {
  switch (payloadtype.getId()) {
    case 0:
      return new AudioFormat(AudioFormat.ULAW_RTP);
    case 3:
      return new AudioFormat(AudioFormat.GSM_RTP);
    case 4:
      return new AudioFormat(AudioFormat.G723_RTP);
    default:
      return null;
  }
}
origin: jitsi/libjitsi

@Override
protected Format[] getMatchingOutputFormats(Format inputFormat)
{
  AudioFormat inputAudioFormat = (AudioFormat) inputFormat;
  return
    new AudioFormat[]
        {
          new AudioFormat(
              AudioFormat.LINEAR,
              inputAudioFormat.getSampleRate(),
              16,
              1,
              AudioFormat.LITTLE_ENDIAN,
              AudioFormat.SIGNED)
        };
}
origin: jitsi/libjitsi

@Override
protected Format[] getMatchingOutputFormats(Format in)
{
  AudioFormat af = (AudioFormat) in;
  double sampleRate = af.getSampleRate();
  supportedOutputFormats
    = new AudioFormat[]
        {
          new AudioFormat(
              Constants.ALAW_RTP,
              sampleRate,
              8,
              1,
              Format.NOT_SPECIFIED,
              Format.NOT_SPECIFIED,
              8,
              sampleRate,
              Format.byteArray)
        };
  return supportedOutputFormats;
}
origin: jitsi/libjitsi

/**
 * Returns the output formats according to the input.
 * @param in the input format.
 * @return the possible output formats.
 */
@Override
protected Format[] getMatchingOutputFormats(Format in)
{
  AudioFormat inFormat = (AudioFormat) in;
  int sampleRate = (int) (inFormat.getSampleRate());
  supportedOutputFormats = new AudioFormat[]
    {
    new AudioFormat(
      AudioFormat.ALAW,
      sampleRate,
      8,
      1,
      Format.NOT_SPECIFIED,
      Format.NOT_SPECIFIED
    )};
  return supportedOutputFormats;
}
origin: jitsi/libjitsi

@Override
protected Format[] getMatchingOutputFormats(Format in)
{
  AudioFormat af = (AudioFormat) in;
  supportedOutputFormats =
    new AudioFormat[]
    { new AudioFormat(AudioFormat.LINEAR, af.getSampleRate(), 16,
      af.getChannels(), AudioFormat.LITTLE_ENDIAN, // isBigEndian(),
      AudioFormat.SIGNED // isSigned());
    ) };
  return supportedOutputFormats;
}
origin: jitsi/libjitsi

/**
 * Creates an unknown <tt>MediaFormat</tt>.
 *
 * @param type <tt>MediaType</tt>
 * @return unknown <tt>MediaFormat</tt>
 */
public MediaFormat createUnknownMediaFormat(MediaType type)
{
  Format unknown = null;
  /*
   * FIXME Why is a VideoFormat instance created for MediaType.AUDIO and
   * an AudioFormat instance for MediaType.VIDEO?
   */
  if(type.equals(MediaType.AUDIO))
    unknown = new VideoFormat("unknown");
  else if(type.equals(MediaType.VIDEO))
    unknown = new AudioFormat("unknown");
  return MediaFormatImpl.createInstance(unknown);
}
javax.media.formatAudioFormat<init>

Popular methods of AudioFormat

  • getSampleRate
  • computeDuration
  • getChannels
  • getEncoding
  • getSampleSizeInBits
  • getDataType
  • getEndian
  • getFrameRate
  • getFrameSizeInBits
  • getSigned
  • intersects
  • matches
  • intersects,
  • matches

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • getContentResolver (Context)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now