当前位置: 首页>>代码示例>>Java>>正文


Java SpeexFormat类代码示例

本文整理汇总了Java中mil.jfcom.cie.media.srtp.packetizer.SpeexFormat的典型用法代码示例。如果您正苦于以下问题:Java SpeexFormat类的具体用法?Java SpeexFormat怎么用?Java SpeexFormat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SpeexFormat类属于mil.jfcom.cie.media.srtp.packetizer包,在下文中一共展示了SpeexFormat类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSession

import mil.jfcom.cie.media.srtp.packetizer.SpeexFormat; //导入依赖的package包/类
/**
 * Create a Session using Speex Codec
 *
 * @param localhost    localHost
 * @param localPort    localPort
 * @param remoteHost   remoteHost
 * @param remotePort   remotePort
 * @param eventHandler eventHandler
 * @param quality      quality
 * @param secure       secure
 * @param micOn        micOn
 * @return MediaSession
 * @throws NoProcessorException
 * @throws UnsupportedFormatException
 * @throws IOException
 * @throws GeneralSecurityException
 */
public static MediaSession createSession(String localhost, int localPort, String remoteHost, int remotePort, MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) throws NoProcessorException, UnsupportedFormatException, IOException, GeneralSecurityException {

    SpeexFormat.setFramesPerPacket(1);
    /**
     * The master key. Hardcoded for now.
     */
    byte[] masterKey = new byte[]{(byte) 0xE1, (byte) 0xF9, 0x7A, 0x0D, 0x3E, 0x01, (byte) 0x8B, (byte) 0xE0, (byte) 0xD6, 0x4F, (byte) 0xA3, 0x2C, 0x06, (byte) 0xDE, 0x41, 0x39};

    /**
     * The master salt. Hardcoded for now.
     */
    byte[] masterSalt = new byte[]{0x0E, (byte) 0xC6, 0x75, (byte) 0xAD, 0x49, (byte) 0x8A, (byte) 0xFE, (byte) 0xEB, (byte) 0xB6, (byte) 0x96, 0x0B, 0x3A, (byte) 0xAB, (byte) 0xE6};

    DatagramSocket[] localPorts = MediaSession.getLocalPorts(InetAddress.getByName(localhost), localPort);
    MediaSession session = MediaSession.createInstance(remoteHost, remotePort, localPorts, quality, secure, masterKey, masterSalt);
    session.setListener(eventHandler);

    session.setSourceDescription(new SourceDescription[]{new SourceDescription(SourceDescription.SOURCE_DESC_NAME, "Superman", 1, false), new SourceDescription(SourceDescription.SOURCE_DESC_EMAIL, "[email protected]", 1, false), new SourceDescription(SourceDescription.SOURCE_DESC_LOC, InetAddress.getByName(localhost) + " Port " + session.getLocalDataPort(), 1, false), new SourceDescription(SourceDescription.SOURCE_DESC_TOOL, "JFCOM CDCIE Audio Chat", 1, false)});
    return session;
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:38,代码来源:AudioMediaSession.java


注:本文中的mil.jfcom.cie.media.srtp.packetizer.SpeexFormat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。