CN113543273B - Audio data transmission method and system - Google Patents

Audio data transmission method and system Download PDF

Info

Publication number
CN113543273B
CN113543273B CN202010299255.8A CN202010299255A CN113543273B CN 113543273 B CN113543273 B CN 113543273B CN 202010299255 A CN202010299255 A CN 202010299255A CN 113543273 B CN113543273 B CN 113543273B
Authority
CN
China
Prior art keywords
master device
wifi
slave device
hotspot
router
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.)
Active
Application number
CN202010299255.8A
Other languages
Chinese (zh)
Other versions
CN113543273A (en
Inventor
曾德钧
刘兴锴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Airsmart Technology Co Ltd
Original Assignee
Shenzhen Airsmart Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Airsmart Technology Co Ltd filed Critical Shenzhen Airsmart Technology Co Ltd
Priority to CN202010299255.8A priority Critical patent/CN113543273B/en
Publication of CN113543273A publication Critical patent/CN113543273A/en
Application granted granted Critical
Publication of CN113543273B publication Critical patent/CN113543273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Abstract

The invention provides an audio data transmission method and system, comprising the following steps: when the master device is in a mobile network mode, the master device starts a local WiFi hot spot and establishes Bluetooth connection with the slave device; the master device sends access information of the local WiFi hotspot to the slave device based on Bluetooth connection; the slave device accesses the local WiFi hotspot according to the access information of the local WiFi hotspot, and acquires the IP address of the master device; the slave device establishes first-class network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device; the master device transmits audio data to the slave device in a high compression ratio audio format based on the first type of network connection. According to the invention, even in a network environment of the WiFi hotspot which cannot be accessed to the same WiFi router, the master device and the slave device can also construct an ad hoc network based on the local WiFi hotspot started by the master device, and audio data is transmitted in an audio format with a high compression ratio, so that the transmission fluency of the audio data is ensured.

Description

Audio data transmission method and system
Technical Field
The present invention relates to the field of data transmission technologies, and in particular, to a method and a system for transmitting audio data.
Background
Along with the development of science and technology, wireless intelligent audio amplifier gets into people's life gradually. A master sound box and a plurality of slave sound boxes can be connected together through constructing an ad hoc network, and then the master sound box transmits audio data in a fixed format to the plurality of slave sound boxes so as to realize synchronous audio playing on the plurality of sound boxes.
However, the existing multi-speaker building ad hoc network needs to build the ad hoc network by means of a WiFi router, namely, the ad hoc network can only be built among the multi-speakers in a WiFi hotspot mode of the same WiFi router, and the ad hoc network cannot be built among the multi-speakers in a network environment of the WiFi hotspot mode of the same WiFi router, so that the existing multi-speaker building ad hoc network mode has a large limitation.
Disclosure of Invention
The invention mainly aims to provide an audio data transmission method and system, and aims to solve the technical problem that a mode of constructing an ad hoc network by a plurality of sound boxes in the prior art has larger limitation.
To achieve the above object, an embodiment of the present invention provides an audio data transmission method, including:
when the master device is in a mobile network mode, the master device starts a local WiFi hot spot and establishes Bluetooth connection with the slave device;
the master device sends the access information of the local WiFi hotspot and the UUID of the master device to the slave device based on the Bluetooth connection;
the slave device accesses the local WiFi hotspot according to the access information of the local WiFi hotspot, and acquires the IP address of the master device;
the slave device establishes first-class network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device;
the master device transmits audio data to the slave device in a high compression ratio audio format based on the first type of network connection.
Optionally, the audio data transmission method further includes:
when the master device is in a WiFi network mode, the master device establishes Bluetooth connection with the slave device;
the master device sends UUID of the master device, IP address of the master device and access information of a WiFi hotspot of a router to which the master device is currently connected to the slave device based on the Bluetooth connection;
the slave device accesses the router WiFi hotspot based on the access information of the router WiFi hotspot currently connected with the master device;
the slave device establishes second-class network connection with the master device based on the WiFi network corresponding to the router WiFi hotspot, the UUID of the master device and the IP address of the master device;
the master device transmits audio data to the slave device in a low compression ratio audio format based on the second type of network connection.
Optionally, the master device transmitting the audio data to the slave device in the audio format with the low compression ratio based on the second type network connection includes:
when the master device detects that the signal intensity of the WiFi hotspot of the router is larger than or equal to the first signal intensity and smaller than the second signal intensity, the master device transmits the audio data to the slave device in a lossless audio compression coding FLAC format based on the second-class network connection;
and when the master device detects that the signal intensity of the WiFi hotspot of the router is greater than or equal to the second signal intensity, the master device transmits the audio data to the slave device in a Pulse Code Modulation (PCM) format based on the second type network connection.
Optionally, after the master device transmits the audio data to the slave device in the audio format with the low compression ratio based on the second type network connection, the method further comprises:
when the master device detects that the signal strength of the router WiFi hotspot is smaller than that of the first signal, the master device transmits the audio data to the slave device in an audio format with high compression ratio based on the second-class network connection.
In addition, to achieve the above object, an embodiment of the present invention further provides an audio data transmission system, where the audio data transmission system includes a master device and a slave device:
the master device is used for starting a local WiFi hot spot when in a mobile network mode, and establishing Bluetooth connection with the slave device; transmitting access information of the local WiFi hotspot and UUID of the master device to the slave device based on the Bluetooth connection;
the slave device is used for accessing the local WiFi hotspot according to the access information of the local WiFi hotspot and acquiring the IP address of the master device; establishing a first type of network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device;
and the master device is used for transmitting the audio data to the slave device in an audio format with high compression ratio based on the first type network connection.
Optionally, the master device is configured to establish a bluetooth connection with the slave device when in the WiFi network mode; based on the Bluetooth connection, sending UUID of the master device, IP address of the master device and access information of a WiFi hotspot of a router to which the master device is currently connected to the slave device;
the slave device is used for accessing the router WiFi hotspot based on the access information of the router WiFi hotspot currently connected with the master device; establishing second-class network connection with the main equipment based on the WiFi network corresponding to the WiFi hotspot of the router, the UUID of the main equipment and the IP address of the main equipment;
and the master device is used for transmitting the audio data to the slave device in an audio format with a low compression ratio based on the second type network connection.
Optionally, the master device is configured to transmit, when detecting that the signal strength of the WiFi hotspot of the router is greater than or equal to the first signal strength and less than the second signal strength, the audio data to the slave device in a lossless audio compression encoding FLAC format based on the second type network connection; and when the signal strength of the WiFi hotspot of the router is detected to be greater than or equal to the second signal strength, transmitting the audio data to the slave device in a Pulse Code Modulation (PCM) format based on the second type network connection.
Optionally, the master device is configured to transmit the audio data to the slave device in an audio format with a high compression ratio based on the second type network connection when the signal strength of the router WiFi hotspot is detected to be smaller than the first signal.
In the invention, when the master device is in a mobile network mode, the master device starts a local WiFi hot spot and establishes Bluetooth connection with the slave device; the master device sends the access information of the local WiFi hotspot and the UUID of the master device to the slave device based on the Bluetooth connection; the slave device accesses the local WiFi hotspot according to the access information of the local WiFi hotspot, and acquires the IP address of the master device; the slave device establishes first-class network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device; the master device transmits audio data to the slave device in a high compression ratio audio format based on the first type of network connection. According to the invention, even in a network environment where WiFi hot spots of the same WiFi router cannot be accessed, the master device and the slave device can also construct an ad hoc network based on the local WiFi hot spot started by the master device, and the master device transmits audio data to the slave device in an audio format with a high compression ratio based on the network type of the current ad hoc network, so that the transmission smoothness of the audio data is ensured.
Drawings
FIG. 1 is a flow chart of an embodiment of an audio data transmission method according to the present invention;
FIG. 2 is a schematic diagram of a networking scenario of a master device and a slave device according to an embodiment;
fig. 3 is a schematic diagram of a networking scenario of a master device and a slave device in another embodiment.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
An embodiment of the present invention provides an audio data transmission method, referring to fig. 1, fig. 1 is a flowchart of an embodiment of the audio data transmission method of the present invention. In one embodiment, an audio data transmission method includes:
step S10, when the master device is in a mobile network mode, the master device starts a local WiFi hot spot and establishes Bluetooth connection with the slave device;
step S20, the master device sends the access information of the local WiFi hotspot and the UUID of the master device to the slave device based on the Bluetooth connection;
in this embodiment, a device may be optionally set as the master device through key operation, and the mobile network of the master device is turned on to be in the mobile network mode. When the master device is in the mobile network mode, the master device starts a local WiFi hotspot and establishes a Bluetooth connection with the slave device. The specific process of establishing a bluetooth connection may be: the master starts a bluetooth broadcast with a bluetooth name of airsfrart_cast and provides a read service with UUID 0000aac2-0000-1000-8000-00805f9b34fb waiting for the slave to connect. After another device is started, the key makes it a slave device.
The slave device starts Bluetooth scanning, scans to Bluetooth device with Bluetooth name AIrSMArT_CAST, performs Bluetooth connection, inquires of UUID of 0000aac2-0000-1000-8000-00805f9b34fb after connection, and initiates a read request. After the slave device is connected with the Bluetooth of the master device and initiates a read request, the master device sequentially sends the ssid and the psk of the hotspot mode of the slave device and the UUID of the master device.
Step S30, the slave device accesses the local WiFi hotspot according to the access information of the local WiFi hotspot, and acquires the IP address of the master device;
in this embodiment, the slave device connects to the local hotspot opened by the master device according to the access information of the local WiFi hotspot, and after connecting, it estimates the IP address of the master device (the IP address of the master device is fixed).
Step S40, the slave device establishes a first type of network connection with the master device based on the WiFi network corresponding to the local WiFi hotspot, the UUID of the master device and the IP address of the master device;
in this embodiment, the slave device may establish a first type of network connection with the master device based on the WiFi network corresponding to the local WiFi hotspot, the UUID of the master device, and the IP address of the master device. Referring to fig. 2, fig. 2 is a schematic diagram of a networking scenario of a master device and a slave device in an embodiment. As shown in fig. 2, the slave device accesses to the local WiFi hotspot opened by the master device, and establishes a first type of network connection with the master device based on the WiFi network corresponding to the local WiFi hotspot, the UUID of the master device, and the IP address of the master device, so that networking between the master device and the slave device is completed, that is, networking between the master device and the slave device can be completed without a WiFi router. Although only one slave device is shown in fig. 2, it is readily understood that the number of slave devices may be plural. The slave device may be an intelligent sound box, and the master device may also be an intelligent sound box.
In step S50, the master device transmits the audio data to the slave device in an audio format with a high compression ratio based on the first type of network connection.
In this embodiment, since the first type of network connection is a WiFi hotspot opened based on the master device, the data transmission capability of the first type of network connection is not strong enough, so that the master device transmits the audio data to the slave device in an audio format with a high compression ratio, thereby ensuring the smoothness of data transmission. Wherein, the audio format of the high compression ratio includes: OGG (collectively referred to as OGGVobis, an audio compression format, a music format similar to MP3 and the like), MP 2.
In this embodiment, when the master device is in the mobile network mode, the master device opens a local WiFi hotspot and establishes a bluetooth connection with the slave device; the master device sends the access information of the local WiFi hotspot and the UUID of the master device to the slave device based on the Bluetooth connection; the slave device accesses the local WiFi hotspot according to the access information of the local WiFi hotspot, and acquires the IP address of the master device; the slave device establishes first-class network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device; the master device transmits audio data to the slave device in a high compression ratio audio format based on the first type of network connection. According to the embodiment, even in a network environment where WiFi hot spots of the same WiFi router cannot be accessed, the master device and the slave device can also construct an ad hoc network based on the local WiFi hot spot started by the master device, and the master device transmits audio data to the slave device in an audio format with a high compression ratio based on the network type of the current ad hoc network, so that the transmission smoothness of the audio data is ensured.
Further, in an embodiment, the master device may detect whether the network mode currently located is a mobile network mode or a WiFi network mode according to the location of the master device or the slave device or a WiFi hotspot of a WiFi router accessible to the master device or the slave device.
Optionally, before step S10, the method further includes:
the method comprises the steps that a master device obtains a first hotspot name set corresponding to a slave device, wherein the first hotspot name set is a WiFi hotspot name set of a WiFi router which can be accessed by the slave device; the method comprises the steps that a master device detects whether at least one identical WiFi hotspot name exists in a first hotspot name set and a second hotspot name set, wherein the second hotspot name set is a WiFi hotspot name set of a WiFi router which can be accessed by the master device; if at least one identical name of the WiFi hotspot exists, the network mode in which the user is currently located is a WiFi network mode; if the same name of the WiFi hotspot does not exist, the network mode in which the user is currently located is a mobile network mode.
The slave device searches WiFi hot spots of WiFi routers around the slave device, selects connectable WiFi hot spots from the searched WiFi hot spots to obtain a first hot spot name set, and sends the first hot spot name set to the master device, and particularly can send information to the master device in a Bluetooth communication mode. For example, the slave device searches for WiFi hotspots of surrounding WiFi routers, searches for WiFi hotspot 1, wiFi hotspot 2 and WiFi hotspot 3, and further detects that WiFi hotspot 2 and WiFi hotspot 3 are connected WiFi hotspots, and then the name of WiFi hotspot 2 is given by: name 2, and name of WiFi hotspot 3: and 3, forming a first hotspot name set, and transmitting the first hotspot name set to the master device in a Bluetooth communication mode.
And the master device also searches WiFi hot spots of WiFi routers around the master device, and selects connectable WiFi hot spots from the searched WiFi hot spots to obtain a second hot spot name set. For example, the master device searches for WiFi hotspots of surrounding WiFi routers, searches for WiFi hotspot 1 and WiFi hotspot 3, and further detects that WiFi hotspot 3 is a connected WiFi hotspot, and then uses the name of WiFi hotspot 3: name 3, constitutes a second set of hotspot names. And then further detecting whether at least one identical name of the WiFi hotspot exists in the first hotspot name set and the second hotspot name set. As the first hotspot name set includes the name 2 and the name 3, and the second hotspot name set includes the name 3, it may be detected that at least one identical WiFi hotspot exists in the first hotspot name set and the second hotspot name set, that is, the name 3. I.e. the master device and the slave device can access to the WiFi hotspots of the same WiFi router corresponding to the name 3, i.e. the master device and the slave device can access to the WiFi hotspots of the same WiFi router, the network mode in which the master device and the slave device are currently located is a WiFi network mode. In contrast, if the same WiFi hotspot name does not exist in the first hotspot name set and the second hotspot name set, the master device and the slave device cannot access the WiFi hotspot of the same WiFi router, that is, the same WiFi hotspot name does not exist, and the network mode in which the master device and the slave device are currently located is the mobile network mode.
Optionally, before step S10, the method further includes:
the method comprises the steps that a master device detects whether the coordinate position of the master device and the coordinate position of a slave device are in the signal radiation range of WiFi hot spots of the same accessible WiFi router; if the network modes are not in the signal radiation range of the WiFi hot spot of the same accessible WiFi router, the network mode in which the network mode is currently located is a mobile network mode; if the network modes are in the signal radiation range of the WiFi hot spot of the same accessible WiFi router, the network mode in which the network mode is currently located is a WiFi network mode.
Considering that the WiFi router is generally disposed indoors, a location range can be set in the area where the accessible WiFi router is located, and if the location of the master device and the location of the slave device are both within the location range by detecting whether the location of the master device and the location of the slave device are both within the location range, it is determined that the master device and the slave device can access the WiFi hotspot of the same router. Specifically, the WiFi hotspots of the WiFi routers that can be accessed by the master device and the slave device are determined, for example, the WiFi hotspot of the WiFi router 1, the WiFi hotspot of the WiFi router 2, and the WiFi hotspot of the WiFi router 3 are determined to be the WiFi hotspots that can be accessed by both the master device and the slave device. The corresponding location ranges are set according to the signal radiation ranges according to the WiFi hotspots of each WiFi router. For example, if the WiFi hotspot signal radiation range of the WiFi router 1 is the area 1, the area 1 is taken as the location range 1, and when the location of the master device and the location of the slave device are detected to be within the location range 1, it is indicated that the master device and the slave device can access to the WiFi hotspot of the same WiFi router (i.e. the WiFi router 1), and it is determined that the current indoor network environment is present. Similarly, if the signal radiation range of the WiFi hotspot of the WiFi router 2 is the area 2, the area 2 is taken as the position range 2, and when the position of the master device and the position of the slave device are detected to be in the position range 2, it is indicated that the master device and the slave device can access the WiFi hotspot of the same WiFi router (i.e. the WiFi router 2), and then the current WiFi network mode is determined. When the master device and the slave device are not in the signal radiation range of the WiFi hot spot of the same WiFi router, the fact that the master device and the slave device cannot access the WiFi hot spot of the same WiFi router is indicated, and the fact that the mobile network mode is currently in the mobile network mode is determined.
Further, in an embodiment, the audio data transmission method further includes:
when the master device is in a WiFi network mode, the master device establishes Bluetooth connection with the slave device; the master device sends UUID of the master device, IP address of the master device and access information of a WiFi hotspot of a router to which the master device is currently connected to the slave device based on the Bluetooth connection; the slave device accesses the router WiFi hotspot based on the access information of the router WiFi hotspot currently connected with the master device; the slave device establishes second-class network connection with the master device based on the WiFi network corresponding to the router WiFi hotspot, the UUID of the master device and the IP address of the master device; the master device transmits audio data to the slave device in a low compression ratio audio format based on the second type of network connection.
In this embodiment, when the master device is in the WiFi network mode, a bluetooth connection is established with the slave device. The process of establishing bluetooth connection between the master device and the slave device has been described in the above embodiments, and will not be described herein. And then the master device sends the UUID of the master device, the IP address of the master device and the access information of the router WiFi hotspot currently connected with the master device to the slave device through Bluetooth connection, the slave device can access the router WiFi hotspot according to the access information of the router WiFi hotspot currently connected with the master device, then a second type network connection is established with the master device based on the WiFi network corresponding to the router WiFi hotspot, the UUID of the master device and the IP address of the master device, and the master device can transmit audio data to the slave device in a low-compression-ratio audio format based on the second type network connection. Wherein the audio format of the low compression ratio includes: PCM (Pulse Code Modulation ), FLAC (lossless audio compression coding).
Referring to fig. 3, fig. 3 is a schematic diagram of a networking scenario of a master device and a slave device in another embodiment. As shown in fig. 3, both the master device and the slave device access to the WiFi hotspot of the same WiFi router, so as to realize networking between the master device and the slave device. Although only one slave device is shown in fig. 3, it is readily understood that the number of slave devices may be plural.
When the master device and the slave device complete networking in a networking mode of accessing the WiFi hot spot of the same WiFi router, the transmission efficiency of the network is high, and the master device transmits the audio data to the slave device in an audio format with a low compression ratio.
Further, in an embodiment, the master device transmitting the audio data to the slave device in the audio format with the low compression ratio based on the second type network connection comprises:
when the master device detects that the signal intensity of the WiFi hotspot of the router is larger than or equal to the first signal intensity and smaller than the second signal intensity, the master device transmits the audio data to the slave device in a lossless audio compression coding FLAC format based on the second-class network connection; and when the master device detects that the signal intensity of the WiFi hotspot of the router is greater than or equal to the second signal intensity, the master device transmits the audio data to the slave device in a Pulse Code Modulation (PCM) format based on the second type network connection.
In this embodiment, even though networking is completed by a networking manner of WiFi hotspots accessing the same WiFi router, the signal strength of different WiFi hotspots has a strong or weak score. Therefore, in this networking manner, it is further required to determine which audio format with a low compression ratio is selected according to the signal strength of the WiFi hotspot of the same WiFi router that is accessed. Specifically, the intensity of signal intensity is measured by the size of data quantity which can be transmitted to each slave device in each second by the master device, when the master device and the slave devices access to the WiFi hot spot of the same WiFi router, if the size of data quantity which can be transmitted to each slave device in each second by the master device is larger than or equal to 200kb (second signal intensity), the master device transmits audio data to the slave devices in a PCM format; if the amount of data transmittable by the master device to each slave device at the same time is greater than or equal to 100kb (first signal strength) and less than 200kb, the master device transmits the audio data to the slave device in FLAC format. Wherein PCM is Pulse Code Modulation, pulse code modulation, and FLAC is lossless audio compression coding.
Further, in an embodiment, after the master device transmits the audio data to the slave device in the audio format with the low compression ratio based on the second type network connection, the method further includes:
when the master device detects that the signal strength of the router WiFi hotspot is smaller than that of the first signal, the master device transmits the audio data to the slave device in an audio format with high compression ratio based on the second-class network connection.
In this embodiment, even if the WiFi network corresponding to the router WiFi hotspot has poor network quality, when the master device detects that the signal strength of the router WiFi hotspot is smaller than the first signal, for example, when the data amount that can be transmitted to each slave device per second by the master device is smaller than 100kb, in order to ensure the smoothness of data transmission, the master device needs to adjust the audio format, and at this time, the master device transmits the audio data to the slave device in the audio format with a high compression ratio based on the second type network connection.
The embodiment of the invention also provides an audio data transmission system, which comprises a master device and a slave device:
the master device is used for starting a local WiFi hot spot when in a mobile network mode, and establishing Bluetooth connection with the slave device; transmitting access information of the local WiFi hotspot and UUID of the master device to the slave device based on the Bluetooth connection;
the slave device is used for accessing the local WiFi hotspot according to the access information of the local WiFi hotspot and acquiring the IP address of the master device; establishing a first type of network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device;
and the master device is used for transmitting the audio data to the slave device in an audio format with high compression ratio based on the first type network connection.
Further, in an embodiment, the master device is configured to establish a bluetooth connection with the slave device when in the WiFi network mode; based on the Bluetooth connection, sending UUID of the master device, IP address of the master device and access information of a WiFi hotspot of a router to which the master device is currently connected to the slave device; the slave device is used for accessing the router WiFi hotspot based on the access information of the router WiFi hotspot currently connected with the master device; establishing second-class network connection with the main equipment based on the WiFi network corresponding to the WiFi hotspot of the router, the UUID of the main equipment and the IP address of the main equipment; and the master device is used for transmitting the audio data to the slave device in an audio format with a low compression ratio based on the second type network connection.
Further, in an embodiment, the master device is configured to transmit the audio data to the slave device in a lossless audio compression encoding FLAC format based on the second type network connection when the signal strength of the router WiFi hotspot is detected to be greater than or equal to the first signal strength and less than the second signal strength; and when the signal strength of the WiFi hotspot of the router is detected to be greater than or equal to the second signal strength, transmitting the audio data to the slave device in a Pulse Code Modulation (PCM) format based on the second type network connection.
Further, in an embodiment, the master device is configured to transmit the audio data to the slave device in an audio format with a high compression ratio based on the second network connection when the signal strength of the router WiFi hotspot is detected to be smaller than the first signal.
The specific embodiments of the audio data transmission system of the present invention are substantially the same as the embodiments of the audio data transmission method described above, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising several instructions for causing a terminal device to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (6)

1. An audio data transmission method, characterized in that the audio data transmission method comprises:
the master device detects whether the current network mode is a mobile network mode or a WiFi network mode according to the positions of the master device and the slave device or WiFi hot spots of WiFi routers accessible to the master device and the slave device;
the method comprises the steps that a master device obtains a first hotspot name set corresponding to a slave device, wherein the first hotspot name set is a WiFi hotspot name set of a WiFi router which can be accessed by the slave device; the method comprises the steps that a master device detects whether at least one identical WiFi hotspot name exists in a first hotspot name set and a second hotspot name set, wherein the second hotspot name set is a WiFi hotspot name set of a WiFi router which can be accessed by the master device; if at least one identical name of the WiFi hotspot exists, the network mode in which the user is currently located is a WiFi network mode; if the same name of the WiFi hotspot does not exist, the network mode in which the WiFi hotspot is currently located is a mobile network mode;
the method comprises the steps that a master device detects whether the coordinate position of the master device and the coordinate position of a slave device are in the signal radiation range of WiFi hot spots of the same accessible WiFi router; if the network modes are not in the signal radiation range of the WiFi hot spot of the same accessible WiFi router, the network mode in which the network mode is currently located is a mobile network mode; if the network modes are in the signal radiation range of the WiFi hot spot of the same accessible WiFi router, the network mode in which the network mode is currently located is a WiFi network mode;
when the master device is in a mobile network mode, the master device starts a local WiFi hot spot and establishes Bluetooth connection with the slave device;
the master device sends the access information of the local WiFi hotspot and the UUID of the master device to the slave device based on the Bluetooth connection;
the slave device accesses the local WiFi hotspot according to the access information of the local WiFi hotspot, and acquires the IP address of the master device;
the slave device establishes first-class network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device;
the master device transmitting audio data to the slave device in an audio format with a high compression ratio based on the first type of network connection;
when the master device is in a WiFi network mode, the master device establishes Bluetooth connection with the slave device;
the master device sends UUID of the master device, IP address of the master device and access information of a WiFi hotspot of a router to which the master device is currently connected to the slave device based on the Bluetooth connection;
the slave device accesses the router WiFi hotspot based on the access information of the router WiFi hotspot currently connected with the master device;
the slave device establishes second-class network connection with the master device based on the WiFi network corresponding to the router WiFi hotspot, the UUID of the master device and the IP address of the master device;
the master device transmits audio data to the slave device in a low compression ratio audio format based on the second type of network connection.
2. The audio data transmission method of claim 1, wherein the master device transmitting audio data to the slave device in a low compression ratio audio format based on the second type of network connection comprises:
when the master device detects that the signal intensity of the WiFi hotspot of the router is larger than or equal to the first signal intensity and smaller than the second signal intensity, the master device transmits the audio data to the slave device in a lossless audio compression coding FLAC format based on the second-class network connection;
and when the master device detects that the signal intensity of the WiFi hotspot of the router is greater than or equal to the second signal intensity, the master device transmits the audio data to the slave device in a Pulse Code Modulation (PCM) format based on the second type network connection.
3. The audio data transmission method of claim 2, further comprising, after the master device transmits audio data to the slave device in a low compression ratio audio format based on the second type network connection:
when the master device detects that the signal strength of the router WiFi hotspot is smaller than that of the first signal, the master device transmits the audio data to the slave device in an audio format with high compression ratio based on the second-class network connection.
4. An audio data transmission system, comprising a master device and a slave device:
the master device detects whether the current network mode is a mobile network mode or a WiFi network mode according to the positions of the master device and the slave device or WiFi hot spots of WiFi routers accessible to the master device and the slave device;
the method comprises the steps that a master device obtains a first hotspot name set corresponding to a slave device, wherein the first hotspot name set is a WiFi hotspot name set of a WiFi router which can be accessed by the slave device; the method comprises the steps that a master device detects whether at least one identical WiFi hotspot name exists in a first hotspot name set and a second hotspot name set, wherein the second hotspot name set is a WiFi hotspot name set of a WiFi router which can be accessed by the master device; if at least one identical name of the WiFi hotspot exists, the network mode in which the user is currently located is a WiFi network mode; if the same name of the WiFi hotspot does not exist, the network mode in which the WiFi hotspot is currently located is a mobile network mode;
the method comprises the steps that a master device detects whether the coordinate position of the master device and the coordinate position of a slave device are in the signal radiation range of WiFi hot spots of the same accessible WiFi router; if the network modes are not in the signal radiation range of the WiFi hot spot of the same accessible WiFi router, the network mode in which the network mode is currently located is a mobile network mode; if the network modes are in the signal radiation range of the WiFi hot spot of the same accessible WiFi router, the network mode in which the network mode is currently located is a WiFi network mode;
the master device is used for starting a local WiFi hot spot when in a mobile network mode, and establishing Bluetooth connection with the slave device; transmitting access information of the local WiFi hotspot and UUID of the master device to the slave device based on the Bluetooth connection;
the slave device is used for accessing the local WiFi hotspot according to the access information of the local WiFi hotspot and acquiring the IP address of the master device; establishing a first type of network connection with the master device based on a WiFi network corresponding to the local WiFi hotspot, a UUID of the master device and an IP address of the master device;
a master device for transmitting audio data to a slave device in an audio format of high compression ratio based on the first type of network connection;
the master device is used for establishing Bluetooth connection with the slave device when the master device is in a WiFi network mode; based on the Bluetooth connection, sending UUID of the master device, IP address of the master device and access information of a WiFi hotspot of a router to which the master device is currently connected to the slave device;
the slave device is used for accessing the router WiFi hotspot based on the access information of the router WiFi hotspot currently connected with the master device; establishing second-class network connection with the main equipment based on the WiFi network corresponding to the WiFi hotspot of the router, the UUID of the main equipment and the IP address of the main equipment;
and the master device is used for transmitting the audio data to the slave device in an audio format with a low compression ratio based on the second type network connection.
5. The audio data transmission system of claim 4, wherein the master device is configured to transmit audio data to the slave device in a lossless audio compression encoded FLAC format based on the second type network connection when the signal strength of the router WiFi hotspot is detected to be greater than or equal to the first signal strength and less than the second signal strength; and when the signal strength of the WiFi hotspot of the router is detected to be greater than or equal to the second signal strength, transmitting the audio data to the slave device in a Pulse Code Modulation (PCM) format based on the second type network connection.
6. The audio data transmission system of claim 5, wherein the master device is configured to transmit audio data to the slave device in a high compression ratio audio format based on the second type network connection when the router WiFi hotspot is detected to have a signal strength less than the first signal.
CN202010299255.8A 2020-04-15 2020-04-15 Audio data transmission method and system Active CN113543273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010299255.8A CN113543273B (en) 2020-04-15 2020-04-15 Audio data transmission method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010299255.8A CN113543273B (en) 2020-04-15 2020-04-15 Audio data transmission method and system

Publications (2)

Publication Number Publication Date
CN113543273A CN113543273A (en) 2021-10-22
CN113543273B true CN113543273B (en) 2023-12-01

Family

ID=78120206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010299255.8A Active CN113543273B (en) 2020-04-15 2020-04-15 Audio data transmission method and system

Country Status (1)

Country Link
CN (1) CN113543273B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115396408B (en) * 2022-08-24 2023-11-03 恒玄科技(上海)股份有限公司 Wireless audio/video device and wireless communication method
CN115426211B (en) * 2022-08-24 2023-11-03 恒玄科技(上海)股份有限公司 Method for communication between wireless sound box and intelligent device and wireless sound box
CN115396407B (en) * 2022-08-24 2024-01-12 恒玄科技(上海)股份有限公司 Wireless audio/video device and wireless communication method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2301936A1 (en) * 1999-06-18 2000-12-18 Nortel Networks Corporation Method and apparatus for controlling the transition of an audio signal converter between two operative modes based on a certain characteristic of the audio input signal
CN104735814A (en) * 2015-04-10 2015-06-24 三星电子(中国)研发中心 Access method, system and related device for automatically getting access to WiFi network
CN104797004A (en) * 2015-03-19 2015-07-22 四川长虹电器股份有限公司 Method for implementation of automatic networking between master and slave devices
CN106528017A (en) * 2016-10-31 2017-03-22 努比亚技术有限公司 Information processing method and terminal
WO2018113086A1 (en) * 2016-12-24 2018-06-28 华为技术有限公司 Wireless connection switching method and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2301936A1 (en) * 1999-06-18 2000-12-18 Nortel Networks Corporation Method and apparatus for controlling the transition of an audio signal converter between two operative modes based on a certain characteristic of the audio input signal
CN104797004A (en) * 2015-03-19 2015-07-22 四川长虹电器股份有限公司 Method for implementation of automatic networking between master and slave devices
CN104735814A (en) * 2015-04-10 2015-06-24 三星电子(中国)研发中心 Access method, system and related device for automatically getting access to WiFi network
CN106528017A (en) * 2016-10-31 2017-03-22 努比亚技术有限公司 Information processing method and terminal
WO2018113086A1 (en) * 2016-12-24 2018-06-28 华为技术有限公司 Wireless connection switching method and terminal

Also Published As

Publication number Publication date
CN113543273A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
CN113543273B (en) Audio data transmission method and system
US9877181B2 (en) Device discovery method and communication device thereof
KR101424293B1 (en) Mechanism to convey discovery information in a wireless network
CN103491569B (en) Method, device and the computer program disconnecting for wireless short-range communication
US8804655B2 (en) Wireless LAN network, and mobile station, base station and method of controlling handoff in wireless LAN network to prevent packet loss during handoff
US20180139690A1 (en) System and Method for Efficient Communications System Scanning
US20130316705A1 (en) Method, apparatus, and computer program product for efficient network discovery
US20120113971A1 (en) Efficient wlan discovery and association
KR102167933B1 (en) Method and apparatus for scanning access point in wileless system
CN104770020A (en) System and method for common attributes in HESSID and the associated queries
CN104272809A (en) Active scanning method and apparatus
US20100278165A1 (en) Radio terminal and radio communication method
CN106465251B (en) System and method for utilizing stored high-level information
US9877328B2 (en) Method, apparatus, and computer program product for efficient use of frequency bands and channels in wireless environment
US20110151861A1 (en) Smart all-in-one base station and operation method thereof
JP2007104600A (en) Information processing apparatus and control method thereof, information processing system, computer program and storage medium
WO2012162976A1 (en) Method and device for acquiring wifi access point information
KR102424844B1 (en) Device supporting wireless p2p communication with external device and communication method thereof
US7450597B2 (en) Wireless network device and method for reassociation between wireless networks using the wireless network device
CN103052142A (en) Network selection method, mobile terminal and base station
US8126998B2 (en) Information processing apparatus and method of controlling thereof
WO2015008714A1 (en) Control device and communication terminal
US20090238139A1 (en) Apparatus and Method for Providing Service for Media Independent Handover
US11057770B2 (en) Method and apparatus for dynamically changing connection in wireless LAN
JP2008193207A (en) Wireless lan system, and handover method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant