CN104426832A - Multi-terminal multichannel independent playing method and device - Google Patents
Multi-terminal multichannel independent playing method and device Download PDFInfo
- Publication number
- CN104426832A CN104426832A CN201310360513.9A CN201310360513A CN104426832A CN 104426832 A CN104426832 A CN 104426832A CN 201310360513 A CN201310360513 A CN 201310360513A CN 104426832 A CN104426832 A CN 104426832A
- Authority
- CN
- China
- Prior art keywords
- terminal
- audio data
- data stream
- playback
- audio
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/18—Self-organising networks, e.g. ad-hoc networks or sensor networks
- H04W84/20—Leader-follower arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
Abstract
本发明公开了一种多终端多声道独立播放方法及装置,涉及无线通信技术领域,其方法包括以下步骤:建立主终端与一个或多个从终端的连接;主终端获取待播放的音频数据流,并通过主终端播放端口分别向主终端音频播放模块和所述一个或多个从终端音频播放模块发送所述音频数据流;主终端音频播放模块和所述一个或多个从终端音频播放模块通过分别播放所接收的音频数据流,实现同一音频数据流的多终端多声道独立播放。本发明利用终端强大的无线互联能力,以独立声道的方式播放多声道立体声音频,极大方便人们体验立体多媒体音效。
The invention discloses a multi-terminal multi-channel independent playing method and device, which relate to the technical field of wireless communication, and the method comprises the following steps: establishing a connection between a master terminal and one or more slave terminals; the master terminal acquiring audio data to be played stream, and send the audio data stream to the master terminal audio playback module and the one or more slave terminal audio playback modules respectively through the master terminal playback port; the master terminal audio playback module and the one or more slave terminal audio playback modules The module realizes multi-terminal multi-channel independent playback of the same audio data stream by playing the received audio data streams respectively. The invention uses the powerful wireless interconnection capability of the terminal to play multi-channel stereo audio in an independent channel mode, which greatly facilitates people to experience stereo multimedia sound effects.
Description
技术领域technical field
本发明涉及无线通信技术领域,尤其涉及一种多终端多声道独立播放方法及装置。The present invention relates to the technical field of wireless communication, in particular to a multi-terminal multi-channel independent playback method and device.
背景技术Background technique
目前Android智能手机和MID(Mobile Internet Device,移动互联网设备)等终端已经非常普及,此类终端上有丰富的软件,可以播放离线和在线的高品质的音视频文件。但是智能终端受到本身体积尺寸的限制,播放多声道音乐难以体现多声道的优势,主要表现在如下:At present, terminals such as Android smart phones and MID (Mobile Internet Device, mobile Internet devices) have become very popular. There are rich software on such terminals, which can play high-quality audio and video files offline and online. However, the smart terminal is limited by its own size, and it is difficult to play multi-channel music to reflect the advantages of multi-channel, mainly as follows:
1、低端的智能终端往往只设计一个扬声器用于音乐播放,等于播放时必须把多声道混合成单声道播放,因此无论音源的多声道分离度做的多么优秀,用户从任何位置来聆听到的音乐都是类似单声道收音机一样的单声道发出的声音。1. Low-end smart terminals often only design one speaker for music playback, which means that multi-channel must be mixed into mono-channel playback during playback. Therefore, no matter how good the multi-channel separation of the audio source is, users can listen to music from any location. The music to be listened to is the same monophonic sound as a monophonic radio.
2、有高端智能终端虽然设计两个扬声器置于机身两侧,但因为扬声器之间的距离依然过于狭小,当用户凑近终端两个扬声器中间,双耳分别聆听左右两个扬声器播放的音乐时,用户可以感觉到一定的立体声的效果,但是当用户距离智能终端超过一定范围后,听到的多声道的音乐依然感觉是从一个点发出来的,感觉不到立体声和多声道带来的空间感。2. Although there are high-end smart terminals designed to place two speakers on both sides of the fuselage, the distance between the speakers is still too narrow. , the user can feel a certain stereo effect, but when the user's distance from the smart terminal exceeds a certain range, the multi-channel music he hears still feels that it is sent from one point, and he cannot feel the stereo and multi-channel music. sense of space.
3、几乎没有智能终端播放音乐的扬声器超过两个的,所以智能终端不能以独立声道的方式播放多声道音频。3. Almost no smart terminal has more than two speakers for playing music, so the smart terminal cannot play multi-channel audio in an independent channel mode.
发明内容Contents of the invention
本发明的目的在于提供一种多终端多声道独立播放方法及装置,解决了现有技术中终端不能以独立的声道方式播放多声道音频的问题。The purpose of the present invention is to provide a multi-terminal multi-channel independent playback method and device, which solves the problem in the prior art that terminals cannot play multi-channel audio in an independent channel mode.
根据本发明的一个方面,提供了一种多终端多声道独立播放方法,包括以下步骤:According to one aspect of the present invention, a multi-terminal multi-channel independent playback method is provided, comprising the following steps:
建立主终端与一个或多个从终端的连接;Establish a connection between the master terminal and one or more slave terminals;
主终端获取待播放的音频数据流,并通过主终端播放端口分别向主终端音频播放模块和所述一个或多个从终端音频播放模块发送所述音频数据流;The master terminal obtains the audio data stream to be played, and sends the audio data stream to the master terminal audio playback module and the one or more slave terminal audio playback modules respectively through the master terminal playback port;
主终端音频播放模块和所述一个或多个从终端音频播放模块通过分别播放所接收的音频数据流,实现同一音频数据流的多终端多声道独立播放。The audio playing module of the master terminal and the one or more audio playing modules of the slave terminals respectively play the received audio data streams, so as to realize the multi-terminal multi-channel independent playing of the same audio data stream.
优选地,所述建立主终端与一个或多个从终端的连接的具体步骤包括:Preferably, the specific steps of establishing a connection between the master terminal and one or more slave terminals include:
通过WIFI网络所述一个或多个从终端连接管理器客户端向所述主终端连接管理器服务端发送连接请求;The one or more slave terminal connection manager clients send a connection request to the master terminal connection manager server through the WIFI network;
所述主终端连接管理器服务端根据接收到的连接请求,建立主终端与一个或多个从终端的连接。The master terminal connection manager server establishes a connection between the master terminal and one or more slave terminals according to the received connection request.
优选地,所述主终端获取待播放的音频数据流的步骤包括:Preferably, the step of the master terminal acquiring the audio data stream to be played includes:
所述主终端通过音频播放器获取待播放的音频数据流;The main terminal obtains the audio data stream to be played through the audio player;
所述主终端将所获得的音频数据流分成多个大小相等的音频数据流单元,并给所述多个大小相等的音频数据流单元前加上ID信息;The master terminal divides the obtained audio data stream into multiple audio data stream units of equal size, and adds ID information before the multiple audio data stream units of equal size;
所述主终端将所述加上ID信息的音频数据流单元保存到虚拟声卡驱动中,并发送到音频广播服务中。The main terminal saves the audio data stream unit with the ID information in the virtual sound card driver, and sends it to the audio broadcast service.
优选地,所述通过主终端播放端口分别向主终端音频播放模块和所述一个或多个从终端音频播放模块发送所述音频数据流的步骤包括:Preferably, the step of sending the audio data stream to the master terminal audio playback module and the one or more slave terminal audio playback modules respectively through the master terminal playback port includes:
所述主终端音频播放模块直接通过主终端播放端口来发送所述音频数据流;The main terminal audio playback module directly sends the audio data stream through the main terminal playback port;
所述一个或多个从终端音频播放模块通过WIFI网络获得主终端播放端口来发送所述音频数据流。The one or more slave terminal audio playback modules obtain the master terminal playback port through the WIFI network to send the audio data stream.
优选地,所述主终端音频播放模块和所述一个或多个从终端音频播放模块通过分别播放所接收的音频数据流,实现同一音频数据流的多终端多声道独立播放的步骤包括:Preferably, the master terminal audio playback module and the one or more slave terminal audio playback modules respectively play the received audio data streams, and the step of realizing the multi-terminal multi-channel independent playback of the same audio data stream includes:
所述主终端音频播放模块从所述主终端播放端口获得当前播放的加上ID信息的音频数据流单元;The main terminal audio playback module obtains the currently played audio data stream unit with ID information from the main terminal playback port;
所述一个或多个从终端音频播放模块通过主终端播放端口,接收并播放所述主终端当前播放的加上ID信息的音频数据流单元,实现同一音频数据流的多终端多声道独立播放。The one or more slave terminal audio playback modules receive and play the audio data stream unit with ID information currently played by the master terminal through the master terminal playback port, so as to realize multi-terminal multi-channel independent playback of the same audio data stream .
根据本发明的另一方面,提供了一种多终端多声道独立播放装置,包括:According to another aspect of the present invention, a multi-terminal multi-channel independent playback device is provided, including:
建立连接模块,用于建立主终端与一个或多个从终端的连接;Establish a connection module, used to establish a connection between the master terminal and one or more slave terminals;
发送音频数据流模块,用于主终端获取待播放的音频数据流,并通过主终端播放端口分别向主终端音频播放模块和所述一个或多个从终端音频播放模块发送所述音频数据流;The audio data stream sending module is used for the master terminal to obtain the audio data stream to be played, and send the audio data stream to the master terminal audio player module and the one or more slave terminal audio player modules respectively through the master terminal playback port;
播放模块,用于主终端音频播放模块和所述一个或多个从终端音频播放模块通过分别播放所接收的音频数据流,实现同一音频数据流的多终端多声道独立播放。The playback module is used for the master terminal audio playback module and the one or more slave terminal audio playback modules to respectively play the received audio data streams to realize the multi-terminal multi-channel independent playback of the same audio data stream.
优选地,所述建立连接模块包括:Preferably, the connection establishment module includes:
发送单元,用于通过WIFI网络所述一个或多个从终端连接管理器客户端向所述主终端连接管理器服务端发送连接请求;A sending unit, configured to send a connection request to the main terminal connection manager server through the one or more slave terminal connection manager clients through the WIFI network;
建立连接单元,用于所述主终端连接管理器服务端根据接收到的连接请求,建立主终端与一个或多个从终端的连接。The connection establishment unit is used for the master terminal connection manager server to establish a connection between the master terminal and one or more slave terminals according to the received connection request.
优选地,所述发送音频数据流模块包括:Preferably, the sending audio data stream module includes:
获取单元,用于所述主终端通过音频播放器获取待播放的音频数据流;An acquisition unit, configured for the master terminal to acquire the audio data stream to be played through the audio player;
处理单元,用于所述主终端将所获得的音频数据流分成多个大小相等的音频数据流单元,并给所述多个大小相等的音频数据流单元前加上ID信息;The processing unit is used for the master terminal to divide the obtained audio data stream into multiple audio data stream units of equal size, and add ID information before the multiple audio data stream units of equal size;
保存单元,用于所述主终端将所述加上ID信息的音频数据流单元保存到虚拟声卡驱动中,并发送到音频广播服务中。The saving unit is used for the main terminal to save the audio data stream unit with the ID information in the virtual sound card driver, and send it to the audio broadcasting service.
优选地,所述发送音频数据流模块还包括:Preferably, the sending audio data stream module also includes:
发送单元,用于所述主终端音频播放模块直接通过主终端播放端口来发送所述音频数据流,以及所述一个或多个从终端音频播放模块通过WIFI网络获得主终端播放端口来发送所述音频数据流。The sending unit is used for the master terminal audio playback module to directly send the audio data stream through the master terminal playback port, and the one or more slave terminal audio playback modules obtain the master terminal playback port through the WIFI network to send the Audio data stream.
优选地,所述播放模块包括:Preferably, the playback module includes:
获得播放数据流及播放单元,用于所述主终端音频播放模块从所述主终端播放端口获得当前播放的加上ID信息的音频数据流单元,以及所述一个或多个从终端音频播放模块通过主终端播放端口,接收并播放所述主终端当前播放的加上ID信息的音频数据流单元,实现同一音频数据流的多终端多声道独立播放。Obtain a playback data stream and a playback unit, for the master terminal audio playback module to obtain the currently played audio data stream unit with ID information from the master terminal playback port, and the one or more slave terminal audio playback modules The audio data stream unit with ID information currently played by the main terminal is received and played through the playing port of the main terminal, so as to realize the multi-terminal multi-channel independent playback of the same audio data stream.
与现有技术相比较,本发明的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:
本发明以零成本将终端转换为多声道立体声播放功能的多媒体系统,相对于现有的外接多媒体音箱实现的立体声而言,本发明具有无成本,便携等特点。The invention converts the terminal into a multimedia system with multi-channel stereo playback function at zero cost. Compared with the existing stereo sound realized by external multimedia speakers, the invention has the characteristics of no cost, portability and the like.
附图说明Description of drawings
图1是本发明提供的一种多终端多声道独立播放方法的流程图;Fig. 1 is a flow chart of a multi-terminal multi-channel independent playback method provided by the present invention;
图2是本发明提供的一种多终端多声道独立播放装置的示意图;Fig. 2 is a schematic diagram of a multi-terminal multi-channel independent playback device provided by the present invention;
图3是本发明实施例提供的两个终端实现立体声播放示意图;FIG. 3 is a schematic diagram of two terminals implementing stereo playback provided by an embodiment of the present invention;
图4是本发明实施例提供的一种多终端多声道独立播放系统流程图;Fig. 4 is a flow chart of a multi-terminal multi-channel independent playback system provided by an embodiment of the present invention;
图5是本发明实施例提供的一种多终端多声道独立播放系统框架图;5 is a frame diagram of a multi-terminal multi-channel independent playback system provided by an embodiment of the present invention;
图6是本发明实施例提供的主终端连接管理界面图;Fig. 6 is a main terminal connection management interface diagram provided by an embodiment of the present invention;
图7是本发明实施例提供的音频数据流分段处理的示意图。Fig. 7 is a schematic diagram of audio data stream segmentation processing provided by an embodiment of the present invention.
具体实施方式Detailed ways
以下结合附图对本发明的优选实施例进行详细说明,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described below are only used to illustrate and explain the present invention, and are not intended to limit the present invention.
图1显示了本发明提供的一种多终端多声道独立播放方法的流程图,如图1所示,包括以下步骤:Fig. 1 has shown the flow chart of a kind of multi-terminal multi-channel independent playing method provided by the present invention, as shown in Fig. 1, comprises the following steps:
步骤S101:建立主终端与一个或多个从终端的连接;Step S101: establishing a connection between the master terminal and one or more slave terminals;
步骤S102:主终端获取待播放的音频数据流,并通过主终端播放端口分别向主终端音频播放模块和所述一个或多个从终端音频播放模块发送所述音频数据流;Step S102: the master terminal obtains the audio data stream to be played, and sends the audio data stream to the master terminal audio playback module and the one or more slave terminal audio playback modules respectively through the master terminal playback port;
步骤S103:主终端音频播放模块和所述一个或多个从终端音频播放模块通过分别播放所接收的音频数据流,实现同一音频数据流的多终端多声道独立播放。Step S103: The audio playback module of the master terminal and the one or more audio playback modules of the slave terminals respectively play the received audio data streams, so as to realize independent playback of the same audio data stream by multiple terminals and multiple channels.
其中,所述建立主终端与一个或多个从终端的连接的具体步骤包括:通过WIFI网络所述一个或多个从终端连接管理器客户端向所述主终端连接管理器服务端发送连接请求;所述主终端连接管理器服务端根据接收到的连接请求,建立主终端与一个或多个从终端的连接。Wherein, the specific steps of establishing the connection between the master terminal and one or more slave terminals include: sending a connection request to the master terminal connection manager server through the one or more slave terminal connection manager clients through the WIFI network ; The master terminal connection manager server establishes a connection between the master terminal and one or more slave terminals according to the received connection request.
其中,所述主终端获取待播放的音频数据流的步骤包括:所述主终端通过音频播放器获取待播放的音频数据流;所述主终端将所获得的音频数据流分成多个大小相等的音频数据流单元,并给所述多个大小相等的音频数据流单元前加上ID信息;所述主终端将所述加上ID信息的音频数据流单元保存到虚拟声卡驱动中,并发送到音频广播服务中。Wherein, the step of the master terminal obtaining the audio data stream to be played comprises: the master terminal obtains the audio data stream to be played through an audio player; the master terminal divides the obtained audio data stream into multiple equal-sized audio data stream unit, and add ID information before the multiple audio data stream units of equal size; the master terminal saves the audio data stream unit with ID information in the virtual sound card driver, and sends it to audio broadcasting service.
其中,所述通过主终端播放端口分别向主终端音频播放模块和所述一个或多个从终端音频播放模块发送所述音频数据流的步骤包括:所述主终端音频播放模块直接通过主终端播放端口来发送所述音频数据流;所述一个或多个从终端音频播放模块通过WIFI网络获得主终端播放端口来发送所述音频数据流。Wherein, the step of sending the audio data stream to the master terminal audio playback module and the one or more slave terminal audio playback modules respectively through the master terminal playback port includes: the master terminal audio playback module directly plays the audio data stream through the master terminal port to send the audio data stream; the one or more slave terminal audio playback modules obtain the master terminal playback port through the WIFI network to send the audio data stream.
具体地说,所述主终端音频播放模块和所述一个或多个从终端音频播放模块通过分别播放所接收的音频数据流,实现同一音频数据流的多终端多声道独立播放的步骤包括:所述主终端音频播放模块从所述主终端播放端口获得当前播放的加上ID信息的音频数据流单元;所述一个或多个从终端音频播放模块通过主终端播放端口,接收并播放所述主终端当前播放的加上ID信息的音频数据流单元,实现同一音频数据流的多终端多声道独立播放。Specifically, the master terminal audio playback module and the one or more slave terminal audio playback modules respectively play the received audio data streams, and realize the steps of multi-terminal multi-channel independent playback of the same audio data stream including: The master terminal audio playback module obtains the currently played audio data stream unit with ID information from the master terminal playback port; the one or more slave terminal audio playback modules receive and play the audio data stream unit through the master terminal playback port. The audio data stream unit with ID information currently played by the main terminal realizes independent playback of the same audio data stream by multiple terminals and multiple channels.
图2显示了本发明提供的一种多终端多声道独立播放装置的示意图,如图2所示,包括:建立连接模块201,用于建立主终端与一个或多个从终端的连接;发送音频数据流模块202,用于主终端获取待播放的音频数据流,并通过主终端播放端口分别向主终端音频播放模块和所述一个或多个从终端音频播放模块发送所述音频数据流;播放模块203,用于主终端音频播放模块和所述一个或多个从终端音频播放模块通过分别播放所接收的音频数据流,实现同一音频数据流的多终端多声道独立播放。Fig. 2 shows a schematic diagram of a multi-terminal multi-channel independent playback device provided by the present invention, as shown in Fig. 2, including: establishing a connection module 201, which is used to establish a connection between the master terminal and one or more slave terminals; The audio data stream module 202 is used for the master terminal to obtain the audio data stream to be played, and send the audio data stream to the master terminal audio playback module and the one or more slave terminal audio playback modules respectively through the master terminal playback port; The playback module 203 is used for the master terminal audio playback module and the one or more slave terminal audio playback modules to respectively play the received audio data streams to realize independent multi-terminal multi-channel playback of the same audio data stream.
所述建立连接模块201包括:发送单元,用于通过WIFI网络所述一个或多个从终端连接管理器客户端向所述主终端连接管理器服务端发送连接请求;建立连接单元,用于所述主终端连接管理器服务端根据接收到的连接请求,建立主终端与一个或多个从终端的连接。The connection establishment module 201 includes: a sending unit for sending a connection request from the one or more slave terminal connection manager clients to the main terminal connection manager server through the WIFI network; a connection establishment unit for the The master terminal connection manager server establishes a connection between the master terminal and one or more slave terminals according to the received connection request.
所述发送音频数据流模块202包括:获取单元,用于所述主终端通过音频播放器获取待播放的音频数据流;处理单元,用于所述主终端将所获得的音频数据流分成多个大小相等的音频数据流单元,并给所述多个大小相等的音频数据流单元前加上ID信息;保存单元,用于所述主终端将所述加上ID信息的音频数据流单元保存到虚拟声卡驱动中,并发送到音频广播服务;发送单元,用于所述主终端音频播放模块直接通过主终端播放端口来发送所述音频数据流,以及所述一个或多个从终端音频播放模块通过WIFI网络获得主终端播放端口来发送所述音频数据流。The sending audio data stream module 202 includes: an acquisition unit, used for the main terminal to obtain the audio data stream to be played through an audio player; a processing unit, used for the main terminal to divide the obtained audio data stream into multiple Audio data stream units of equal size, and add ID information before the plurality of audio data stream units of equal size; a storage unit, used for the main terminal to store the audio data stream units with ID information in The virtual sound card is driven and sent to the audio broadcast service; the sending unit is used for the master terminal audio playback module to directly send the audio data stream through the master terminal playback port, and the one or more slave terminal audio playback modules Obtain the playback port of the main terminal through the WIFI network to send the audio data stream.
所述播放模块203包括:获得播放数据流及播放单元,用于所述主终端音频播放模块从所述主终端播放端口获得当前播放的加上ID信息的音频数据流单元,以及所述一个或多个从终端音频播放模块通过主终端播放端口,接收并播放所述主终端当前播放的加上ID信息的音频数据流单元,实现同一音频数据流的多终端多声道独立播放。The playback module 203 includes: obtaining a playback data stream and a playback unit, used for the main terminal audio playback module to obtain the currently played audio data stream unit with ID information from the main terminal playback port, and the one or Multiple slave terminal audio playback modules receive and play the audio data stream unit with ID information currently played by the master terminal through the master terminal playback port, so as to realize multi-terminal multi-channel independent playback of the same audio data stream.
图3显示了本发明实施例提供的两个终端实现立体声播放示意图,如图3所示,左边是主终端Master,右边是从终端Client,两部终端通过WIFI网络连接,主终端通过网络广播音频PCM数据给从终端,从终端解码右声道的声音,主终端解码左声道声音。Figure 3 shows a schematic diagram of stereo playback of two terminals provided by the embodiment of the present invention. As shown in Figure 3, the left side is the master terminal Master, and the right side is the slave terminal Client. The two terminals are connected through the WIFI network, and the master terminal broadcasts audio through the network. The PCM data is sent to the slave terminal, the slave terminal decodes the sound of the right channel, and the master terminal decodes the sound of the left channel.
下面结合图4和图5以两部Android终端来说明本发明实施例提供的一种多终端多声道独立播放方法。A multi-terminal multi-channel independent playback method provided by an embodiment of the present invention is described below with reference to FIG. 4 and FIG. 5 using two Android terminals.
步骤1,主终端和从终端建立WIFI连接;Step 1, the master terminal and the slave terminal establish a WIFI connection;
所述主终端与所述从终端建立连接的互联,互联的传输介质可以是WIFIDirect(一种两个终端直接对联的WIFI技术),Hostpot/Station(热点/终端),BT(bluetooth蓝牙)等。本发明实施例是主终端打开WIFI热点,然后从终端连接主终端WIFI热点建立局域网,并且主终端和从终端的ip地址分别是IPA和IPB。The master terminal establishes a connection with the slave terminal, and the interconnection transmission medium can be WIFIDirect (a WIFI technology in which two terminals are directly connected), Hostpot/Station (hot spot/terminal), BT (bluetooth) and so on. In the embodiment of the present invention, the master terminal turns on the WIFI hotspot, and then the slave terminal connects to the master terminal's WIFI hotspot to establish a local area network, and the ip addresses of the master terminal and the slave terminal are IPA and IPB respectively.
步骤2,主终端的连接管理器服务端和从终端的连接管理器客户端分别启动;Step 2, start the connection manager server of the master terminal and the connection manager client of the slave terminal respectively;
所述主终端连接管理服务端负责打开WIFI热点服务并打开特定UDP(UserDatagram Protocol,用户数据报协议)端口供从终端查询;所述从终端的连接管理器客户端负责搜寻主终端的WIFI热点并连接。The main terminal connection management server is responsible for opening the WIFI hotspot service and opening a specific UDP (UserDatagram Protocol, User Datagram Protocol) port for querying from the terminal; the connection manager client of the slave terminal is responsible for searching for the WIFI hotspot of the main terminal and connect.
步骤3,从终端连接管理器客户端连接主终端连接管理器服务端提供的UDP端口,建立C/S(客户/服务)模式的连接;Step 3, connect the UDP port provided by the main terminal connection manager server from the terminal connection manager client, and establish a C/S (client/service) mode connection;
当从终端连上主终端的WIFI热点后,查看主终端特定的UDP端口是否打开,若打开则从终端将主动通过UDP端口和主终端建立握手连接,从终端向主终端发起播放请求,主终端收到连接请求后,判断连接的从终端是否允许连接,允许后注册从终端为播放客户端。When the slave terminal is connected to the WIFI hotspot of the master terminal, check whether the specific UDP port of the master terminal is open. If it is opened, the slave terminal will actively establish a handshake connection with the master terminal through the UDP port, and initiate a playback request from the master terminal to the master terminal. After receiving the connection request, judge whether the connected slave terminal is allowed to connect, and register the slave terminal as the playback client after allowing it.
步骤4,从终端连接管理器客户端和主终端连接管理器服务端成功建立连接,设置连接成功标志,并设定主终端和从终端播放的声道;Step 4, successfully establish a connection between the client terminal connection manager client and the master terminal connection manager server end, set the connection success flag, and set the sound channels played by the master terminal and the slave terminal;
步骤5,主终端的音频播放器进行播放,播放的PCM音频数据流解码后通过Android媒体服务发送到AudioFlinger进行判断,判断后发送到虚拟声卡驱动中进行保存;Step 5, the audio player of the main terminal plays, and the PCM audio data stream played is decoded and sent to AudioFlinger through the Android media service for judgment, and then sent to the virtual sound card driver for saving after judgment;
其中,AudioFlinger用于判断当前的播放模式和主终端与从终端的连接状态。如果主终端与从终端已经连接并处于分离声道播放模式,则将PCM音频数据流发送给虚拟声卡驱动,虚拟声卡驱动把音频数据放入自己的FIFO(First-InFirst-Out先入先出)缓冲池,并对外提供FIFO缓冲池的读取接口。其中,所述虚拟声卡驱动仅在主终端上使用,将主终端播放的音频PCM(Pulse CodeModulation)码流截获,按照设置通过互联网络分发给协同播放的从终端。Among them, AudioFlinger is used to judge the current playback mode and the connection status between the master terminal and the slave terminal. If the master terminal and the slave terminal have been connected and are in separate channel playback mode, then the PCM audio data stream will be sent to the virtual sound card driver, and the virtual sound card driver will put the audio data into its own FIFO (First-InFirst-Out) buffer pool, and provide a read interface for the FIFO buffer pool. Wherein, the virtual sound card driver is only used on the master terminal, intercepts the audio PCM (Pulse Code Modulation) stream played by the master terminal, and distributes it to the slave terminals for cooperative playback through the Internet according to the settings.
步骤6,音频广播服务从FIFO缓冲池的读取接口中读取PCM音频数据流,并把收到的PCM音频数据流分成88200字节的大小相等的PCM音频数据流单元,并给每个单元进行等分编号;Step 6, the audio broadcast service reads the PCM audio data stream from the read interface of the FIFO buffer pool, and divides the received PCM audio data stream into PCM audio data stream units of equal size of 88200 bytes, and sends each unit Carry out equal numbering;
步骤7,音频广播服务在主终端的ip地址IPA上绑定一个TCP(TransferControl Protocol传输控制协议)端口portA,并把PCM音频数据流在IPA:portA上广播出去;Step 7, the audio broadcast service binds a TCP (TransferControl Protocol) port portA on the ip address IPA of the main terminal, and broadcasts the PCM audio data stream on IPA:portA;
主终端的音频广播服务提供PCM音频数据流的广播,该音频广播服务可以为用户态进程,启动后绑定主终端的某个TCP端口提供服务,当从终端连接到此TCP端口读取数据时,音频广播服务把从虚拟声卡驱动的FIFO缓冲池读取数据转发给从终端。The audio broadcasting service of the main terminal provides broadcasting of PCM audio data streams. This audio broadcasting service can provide services for a user-mode process, which is bound to a TCP port of the main terminal after startup. When the slave terminal connects to this TCP port to read data , the audio broadcast service forwards the data read from the FIFO buffer pool driven by the virtual sound card to the slave terminal.
步骤8,音频广播服务从绑定的TCP端口获得PCM音频数据流;Step 8, the audio broadcast service obtains the PCM audio data stream from the bound TCP port;
主终端音频播放模块直接从IPA上绑定TCP端口的portA中获取音频数据流,从终端音频播放模块通过WIFI等网络连接获得IPA上绑定TCP端口的portB获取音频数据流。The main terminal audio playback module directly obtains the audio data stream from portA bound to the TCP port on the IPA, and obtains the audio data stream from portB bound to the TCP port on the IPA through a network connection such as WIFI from the terminal audio playback module.
步骤9,解码所获取的PCM音频数据流,单独拆出所需要的声道数据组成新的PCM音频数据流;Step 9, decoding the acquired PCM audio data stream, and separately extracting the required channel data to form a new PCM audio data stream;
主终端音频播放模块从连接管理服务端获取音频声道信息,并根据音频声道信息从新的PCM音频数据流中获取对应的声道,播放对应声道的音频数据;从终端音频播放模块从连接管理客户端中获取音频声道信息,并根据音频声道信息从新的PCM音频数据流中获取对应的声道,播放对应声道的音频数据。The master terminal audio playback module obtains the audio channel information from the connection management server, and obtains the corresponding channel from the new PCM audio data stream according to the audio channel information, and plays the audio data of the corresponding channel; The management client acquires the audio channel information, and acquires the corresponding channel from the new PCM audio data stream according to the audio channel information, and plays the audio data of the corresponding channel.
其中,PCM音频数据流也可以在主终端中就事先将多个声道分开保存,通过不同的TCP端口发送给不同的终端进行播放,这种情况下终端就不需要再分离立体声数据。Among them, the PCM audio data stream can also be stored separately in advance in the main terminal, and sent to different terminals through different TCP ports for playback. In this case, the terminal does not need to separate the stereo data.
步骤10,将所述新的PCM音频数据流发送到真实声卡驱动中进行播放。Step 10, sending the new PCM audio data stream to a real sound card driver for playing.
主终端和从终端的音频播放模块通过UDP连接建立通讯信道,主终端的音频播放模块从音频广播服务的端口获得加入了ID信息的PCM数据,每当播放一段PCM码流前,先将获得的ID号通过UDP端口通知到从终端的音频播放模块,从终端的音频播放模块根据主终端的音频播放模块发送的ID号可以知道主终端在什么时候在播放ID号为多少的PCM数据,从终端根据网络延时调整播放下一个ID号的PCM码流的播放时间,并时刻和主终端保持同步,使主从终端播放的音频保持一致。The audio playback module of the master terminal and the slave terminal establish a communication channel through a UDP connection. The audio playback module of the master terminal obtains the PCM data with ID information added from the port of the audio broadcast service. The ID number is notified to the audio playback module of the slave terminal through the UDP port. The audio playback module of the slave terminal can know when the master terminal is playing the PCM data with the ID number according to the ID number sent by the audio playback module of the master terminal. Adjust the playing time of the PCM stream with the next ID number according to the network delay, and keep synchronized with the master terminal at all times, so that the audio played by the master and slave terminals is consistent.
在播放过程中,主终端和从终端之间要建立控制连接,以控制播放过程中的开始,暂停,结束,同步等事件。During the playback process, a control connection should be established between the master terminal and the slave terminal to control events such as start, pause, end, and synchronization during the playback process.
本发明为了实现左右声道的同步播放需要做如下工作:音频广播服务在数据发送时,在广播PCM数据过程中将PCM音频数据分成若干个等分,PCM码流以44.1KHz采用率,16bit的采样为例,每秒钟会产生88200字节PCM数据,我们可以以88200字节为单位划等分,然后在每一个等分前加入ID(identification的缩写)信息,如图7所示。The present invention needs to do the following work in order to realize the synchronous playback of the left and right channels: when the audio broadcasting service sends data, the PCM audio data is divided into several equal parts in the process of broadcasting PCM data, and the PCM code stream is adopted at a rate of 44.1KHz, 16bit Taking sampling as an example, 88200 bytes of PCM data will be generated every second. We can divide the data into equal parts by 88200 bytes, and then add ID (abbreviation for identification) information before each equal part, as shown in Figure 7.
图6显示了本发明实施例提供的主终端连接管理界面图,如图6所示,:提供UI(User Interface用户界面)系统,可以让用户设置手机工作在主从模式,声道设置,建立和断开连接等操作。Fig. 6 has shown the main terminal connection management interface diagram that the embodiment of the present invention provides, as shown in Fig. 6,: provide UI (User Interface user interface) system, can allow the user to set mobile phone to work in master-slave mode, sound channel is set, establishes and disconnection operations.
综上所述,本发明具有以下技术效果:In summary, the present invention has the following technical effects:
本发明利用终端强大的无线互联能力,在目前终端普及的情况下零成本建立一个真正的多声道独立播放的多媒体音频系统。这种多声道音频系统可以随时组建随时断开,可以在室内也可以在户外,极大方便人们体验立体多媒体音效。The invention utilizes the powerful wireless interconnection capability of the terminal to establish a real multi-channel independent playing multimedia audio system at zero cost under the current popularization of the terminal. This multi-channel audio system can be set up at any time and disconnected at any time, either indoors or outdoors, which greatly facilitates people to experience stereo multimedia sound effects.
尽管上文对本发明进行了详细说明,但是本发明不限于此,本技术领域技术人员可以根据本发明的原理进行各种修改。因此,凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。Although the present invention has been described in detail above, the present invention is not limited thereto, and various modifications can be made by those skilled in the art based on the principle of the present invention. Therefore, any modifications made according to the principles of the present invention should be understood as falling within the protection scope of the present invention.
Claims (10)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310360513.9A CN104426832A (en) | 2013-08-19 | 2013-08-19 | Multi-terminal multichannel independent playing method and device |
| PCT/CN2013/086556 WO2014166243A1 (en) | 2013-08-19 | 2013-11-05 | Multi-terminal multi-channel independent play method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310360513.9A CN104426832A (en) | 2013-08-19 | 2013-08-19 | Multi-terminal multichannel independent playing method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN104426832A true CN104426832A (en) | 2015-03-18 |
Family
ID=51688914
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310360513.9A Pending CN104426832A (en) | 2013-08-19 | 2013-08-19 | Multi-terminal multichannel independent playing method and device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN104426832A (en) |
| WO (1) | WO2014166243A1 (en) |
Cited By (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105072299A (en) * | 2015-08-07 | 2015-11-18 | 河北远东通信系统工程有限公司 | Method for realizing two-path calls by utilizing single sound card |
| CN105611480A (en) * | 2015-08-28 | 2016-05-25 | 宇龙计算机通信科技(深圳)有限公司 | Audio playing method and terminal |
| CN105611381A (en) * | 2015-12-29 | 2016-05-25 | 深圳市民展科技开发有限公司 | Multi-device audio synchronous playing system and method based on wireless network |
| CN105635798A (en) * | 2015-12-29 | 2016-06-01 | 福州瑞芯微电子股份有限公司 | Stereo realization method and system based on heterogeneous wireless audio |
| CN106340301A (en) * | 2016-09-13 | 2017-01-18 | 广州酷狗计算机科技有限公司 | Audio play method and apparatus thereof |
| CN107277691A (en) * | 2017-08-03 | 2017-10-20 | 四川长虹电器股份有限公司 | Multichannel audio player method, system and audio frequency net gate way apparatus based on cloud |
| CN109511082A (en) * | 2017-09-14 | 2019-03-22 | 晨星半导体股份有限公司 | Video control device and method thereof |
| US10652681B2 (en) | 2016-07-06 | 2020-05-12 | Jrd Communication (Shenzhen) Ltd | Processing method and system of audio multichannel output speaker, and mobile phone |
| CN111464850A (en) * | 2020-03-13 | 2020-07-28 | 深圳传音控股股份有限公司 | A master-slave mode switching method, device and computer storage medium |
| CN111880845A (en) * | 2020-07-24 | 2020-11-03 | 西安万像电子科技有限公司 | Method, system and device for controlling target application |
| CN112489666A (en) * | 2020-11-26 | 2021-03-12 | 北京百瑞互联技术有限公司 | Bluetooth LE audio propagation data processing method and device and storage medium |
| CN113473319A (en) * | 2021-07-14 | 2021-10-01 | 斑马网络技术有限公司 | Bluetooth multi-channel audio playing method, device and system |
| CN113709528A (en) * | 2020-05-20 | 2021-11-26 | 阿里巴巴集团控股有限公司 | Play control method, play configuration device, electronic equipment and storage medium |
| CN113973259A (en) * | 2020-07-22 | 2022-01-25 | 阿里巴巴集团控股有限公司 | Audio processing method, device, computing equipment and medium |
| CN114374453A (en) * | 2021-11-17 | 2022-04-19 | 伟乐视讯科技股份有限公司 | Emergency broadcast multi-terminal audio synchronization method and emergency broadcast system |
| CN114501296A (en) * | 2022-01-28 | 2022-05-13 | 联想(北京)有限公司 | Audio processing method and vehicle-mounted multimedia equipment |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105682002A (en) * | 2014-11-20 | 2016-06-15 | 深圳Tcl数字技术有限公司 | Communication connection establishment method, data communication method and system |
| CN104732979A (en) * | 2015-03-24 | 2015-06-24 | 无锡天脉聚源传媒科技有限公司 | Processing method and device of audio data |
| FR3076154B1 (en) * | 2017-12-21 | 2021-04-23 | Appi Tech | WIRELESS LOCAL TELECOMMUNICATION PROCESS |
| CN108495234B (en) * | 2018-04-19 | 2020-01-07 | 北京微播视界科技有限公司 | Multi-channel audio processing method, apparatus and computer-readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101132474A (en) * | 2006-08-25 | 2008-02-27 | 联想(北京)有限公司 | Method and system for implementing audio-visual contents playing by multiple mobile terminals |
| CN101547245A (en) * | 2008-03-25 | 2009-09-30 | 中兴通讯股份有限公司 | Method for playing multitrack audio file through a mobile phone |
| US20100113148A1 (en) * | 2008-11-04 | 2010-05-06 | Quado Media Inc. | Multi-player, multi-screens, electronic gaming platform and system |
| CN201733428U (en) * | 2010-05-17 | 2011-02-02 | 青岛海信移动通信技术股份有限公司 | Audio output circuit and mobile terminal with the same |
-
2013
- 2013-08-19 CN CN201310360513.9A patent/CN104426832A/en active Pending
- 2013-11-05 WO PCT/CN2013/086556 patent/WO2014166243A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101132474A (en) * | 2006-08-25 | 2008-02-27 | 联想(北京)有限公司 | Method and system for implementing audio-visual contents playing by multiple mobile terminals |
| CN101547245A (en) * | 2008-03-25 | 2009-09-30 | 中兴通讯股份有限公司 | Method for playing multitrack audio file through a mobile phone |
| US20100113148A1 (en) * | 2008-11-04 | 2010-05-06 | Quado Media Inc. | Multi-player, multi-screens, electronic gaming platform and system |
| CN201733428U (en) * | 2010-05-17 | 2011-02-02 | 青岛海信移动通信技术股份有限公司 | Audio output circuit and mobile terminal with the same |
Cited By (23)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105072299A (en) * | 2015-08-07 | 2015-11-18 | 河北远东通信系统工程有限公司 | Method for realizing two-path calls by utilizing single sound card |
| CN105072299B (en) * | 2015-08-07 | 2017-12-26 | 河北远东通信系统工程有限公司 | A kind of method that two-way call is realized using monophone card |
| CN105611480A (en) * | 2015-08-28 | 2016-05-25 | 宇龙计算机通信科技(深圳)有限公司 | Audio playing method and terminal |
| CN105611381A (en) * | 2015-12-29 | 2016-05-25 | 深圳市民展科技开发有限公司 | Multi-device audio synchronous playing system and method based on wireless network |
| CN105635798A (en) * | 2015-12-29 | 2016-06-01 | 福州瑞芯微电子股份有限公司 | Stereo realization method and system based on heterogeneous wireless audio |
| CN105635798B (en) * | 2015-12-29 | 2019-05-31 | 福州瑞芯微电子股份有限公司 | A kind of stereo realization method and system based on isomery wireless audio |
| US10652681B2 (en) | 2016-07-06 | 2020-05-12 | Jrd Communication (Shenzhen) Ltd | Processing method and system of audio multichannel output speaker, and mobile phone |
| CN106340301B (en) * | 2016-09-13 | 2020-01-24 | 广州酷狗计算机科技有限公司 | Audio playing method and device |
| CN106340301A (en) * | 2016-09-13 | 2017-01-18 | 广州酷狗计算机科技有限公司 | Audio play method and apparatus thereof |
| CN107277691A (en) * | 2017-08-03 | 2017-10-20 | 四川长虹电器股份有限公司 | Multichannel audio player method, system and audio frequency net gate way apparatus based on cloud |
| CN107277691B (en) * | 2017-08-03 | 2021-04-27 | 四川长虹电器股份有限公司 | Multi-channel audio playing method and system based on cloud and audio gateway device |
| CN109511082A (en) * | 2017-09-14 | 2019-03-22 | 晨星半导体股份有限公司 | Video control device and method thereof |
| CN111464850A (en) * | 2020-03-13 | 2020-07-28 | 深圳传音控股股份有限公司 | A master-slave mode switching method, device and computer storage medium |
| CN113709528B (en) * | 2020-05-20 | 2024-01-12 | 阿里巴巴集团控股有限公司 | Play control method, play configuration device, electronic equipment and storage medium |
| CN113709528A (en) * | 2020-05-20 | 2021-11-26 | 阿里巴巴集团控股有限公司 | Play control method, play configuration device, electronic equipment and storage medium |
| CN113973259A (en) * | 2020-07-22 | 2022-01-25 | 阿里巴巴集团控股有限公司 | Audio processing method, device, computing equipment and medium |
| CN111880845A (en) * | 2020-07-24 | 2020-11-03 | 西安万像电子科技有限公司 | Method, system and device for controlling target application |
| CN112489666A (en) * | 2020-11-26 | 2021-03-12 | 北京百瑞互联技术有限公司 | Bluetooth LE audio propagation data processing method and device and storage medium |
| CN112489666B (en) * | 2020-11-26 | 2024-05-28 | 北京百瑞互联技术股份有限公司 | Bluetooth LE audio propagation data processing method, device and storage medium |
| CN113473319A (en) * | 2021-07-14 | 2021-10-01 | 斑马网络技术有限公司 | Bluetooth multi-channel audio playing method, device and system |
| CN114374453A (en) * | 2021-11-17 | 2022-04-19 | 伟乐视讯科技股份有限公司 | Emergency broadcast multi-terminal audio synchronization method and emergency broadcast system |
| CN114374453B (en) * | 2021-11-17 | 2024-01-12 | 伟乐视讯科技股份有限公司 | Emergency broadcasting multi-terminal audio synchronization method and emergency broadcasting system |
| CN114501296A (en) * | 2022-01-28 | 2022-05-13 | 联想(北京)有限公司 | Audio processing method and vehicle-mounted multimedia equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2014166243A1 (en) | 2014-10-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104426832A (en) | Multi-terminal multichannel independent playing method and device | |
| US9479584B2 (en) | Synchronous media rendering of demuxed media components across multiple devices | |
| CN102456347B (en) | Realization system and method for split-type multi-channel synchronous play for multimedia file based on wireless transmission technology | |
| CN114697733B (en) | Screen-throwing audio and video data transmission method and related equipment | |
| CN102387171B (en) | The multiterminal of music work in coordination with player method, multiterminal work in coordination with music playing system | |
| EP2640099B1 (en) | Method, system and apparatus for providing stream media service | |
| US12120582B2 (en) | Method, apparatus and computer program for broadcast discovery service in wireless communication system, and recording medium therefor | |
| US20090088208A1 (en) | Apparatus having mobile terminal as input/output device of computer and related system and method | |
| US9780894B2 (en) | Systems for synchronous playback of media using a hybrid bluetooth™ and Wi-Fi network | |
| CN115942288A (en) | Multimedia device for controlling connection | |
| CN105611381A (en) | Multi-device audio synchronous playing system and method based on wireless network | |
| CN103037086A (en) | Microphone achievement method as well as method, device and system for audio playing for mobile devices | |
| CN107277691B (en) | Multi-channel audio playing method and system based on cloud and audio gateway device | |
| US20170104550A1 (en) | System for media rebroadcasting for synchronized rendering across multiple devices | |
| CN103888488A (en) | A method of data sharing based on WIFI | |
| CN101516057B (en) | Method for realizing streaming media through mobile terminal | |
| CN103414783A (en) | Method and device for data transmission | |
| CN106095132B (en) | Method and device for setting key function of playing equipment | |
| CN111049709B (en) | Bluetooth-based interconnected loudspeaker box control method, equipment and storage medium | |
| CN105812185A (en) | A communication connection method for a playback device | |
| CN202772917U (en) | Multimedia-file split-type multi-channel synchronized broadcast implement system based on wireless transmission technology | |
| EP4287586A1 (en) | Media playback method and apparatus and electronic device | |
| CN116017312A (en) | A data processing method and electronic device | |
| US12273840B2 (en) | Bluetooth voice communication system and related computer program product for generating stereo voice effect | |
| CN115398947A (en) | Method, apparatus and computer program for cloud authentication pairing in wireless communication system and recording medium thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150318 |