Git Product home page Git Product logo

asdlei99 / audiolive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anyrtc-usecase/audiolive

0.0 0.0 0.0 15.01 MB

AudioLive 是anyRTC 所做的语音连麦的示例项目,演示了如何通过anyRTC云服务,并配合anyRTC RTC SDK、anyRTC RTM SDK、anyRTC本地推流插件、anyRTC播放插件,快速实现语音连麦的场景。

Java 63.70% Swift 32.38% Objective-C 3.82% Ruby 0.10%

audiolive's Introduction

项目概述

AudioLive 是anyRTC 所做的语音连麦的示例项目,演示了如何通过anyRTC云服务,并配合anyRTC RTC SDK、anyRTC RTM SDK、anyRTC本地推流插件、anyRTC播放插件,快速实现语音连麦的场景。

  • 实时语音连麦
  • 本地音视频合流转推CDN
  • 服务器合流转推CDN

代码下载

Github代码下载慢,请移步至码云下载。

产品架构

native_to_cdn

主播端调用时序图

image-20210202145553237

主播RTC使用的方法:

方法 描述
create 创建RTC
setChannelProfile:LiveBroadcasting 设置频道场景为直播模式
setClientRole:Broadcaster 设置直播场景下的角色为主播
setAudioProfile 设置音频属性,建议码率不要超过48kbps
joinChannel 加入频道
leaveChannel 离开频道
destory 释放引擎

主播本地合流类使用的方法:

方法 描述
init 创建本地合流类
setRtcEngine 传入RTC句柄
pushStream:AudioMix 设置推流地址和推流模式,该案例中使用音频合流模式
unPushStream 停止推流

游客端调用时序图

image-20210202145843720

游客RTC使用的方法:

方法 描述
create 创建RTC
setChannelProfile:LiveBroadcasting 设置频道场景为直播模式
setClientRole:Broadcaster 设置直播场景下的角色为主播
setAudioProfile 设置音频属性,建议码率不要超过48kbps
joinChannel 加入频道
leaveChanel 离开频道
destory 释放引擎

主播本地合流类使用的方法:

方法 描述
init 创建本地合流类
setRtcEngine 传入RTC句柄
pushStream:AudioMix 设置推流地址和推流模式,该案例中使用音频合流模式
unPushStream 停止推流

**流程:**游客初始化RTC后,初始化播放器,播放RTMP,申请连麦通过后,调用加入频道方法,加入频道成功后,停止播放RTMP。下麦后,调用leaveChannel,并调用播放器的播放进行播放RTMP流:

RESTful API 说明

该demo有配套RESTful API进行开发,主要模拟用户注册、登录、获取大厅列表、创建直播间、进入直播间、等一些信息。用户参考demo逻辑,配套服务端信息可按照自身业务逻辑去做。

大厅列表除了调用RESTful API 作为主入口,服务上也做了跟RTC服务做了对接,可以实时跟踪异常信息,优化大厅列表。具体查看服务端对接文档

运行示例项目

参考以下文档在对应的平台编译及运行示例项目:

联系我们

联系电话:021-65650071

QQ咨询群:580477436

咨询邮箱:[email protected]

技术问题:开发者论坛

加微信入技术群交流:

获取更多帮助前往:www.anyrtc.io

audiolive's People

Contributors

dync-boyuan avatar insider-my avatar jhdync avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.