/** * 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; } }
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);
try { AudioFormat af = new AudioFormat(AudioFormat.LINEAR, 44100, 16, 2); rend.setInputFormat(af);
/** * 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)); }
public JavaDecoder() { supportedInputFormats = new AudioFormat[] { new AudioFormat(AudioFormat.ULAW) }; defaultOutputFormats = new AudioFormat[] { new AudioFormat(AudioFormat.LINEAR) }; PLUGIN_NAME = "Mu-Law Decoder"; }
/** * Creates DePacketizer */ public DePacketizer() { inputFormats = new Format[]{new AudioFormat(Constants.ALAW_RTP)}; }
/** * 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)}; }
/** * 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)}; }
/** * 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) }; }
/** * 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) }; }
/** * 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) }; }
/** * 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) }; }
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"; }
/** * 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; } }
/** * 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; } }
@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) }; }
@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; }
/** * 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; }
@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; }
/** * 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); }