[go: up one dir, main page]

CN115167806B - Network audio broadcast gradual change audio processing method and server - Google Patents

Network audio broadcast gradual change audio processing method and server Download PDF

Info

Publication number
CN115167806B
CN115167806B CN202210813548.2A CN202210813548A CN115167806B CN 115167806 B CN115167806 B CN 115167806B CN 202210813548 A CN202210813548 A CN 202210813548A CN 115167806 B CN115167806 B CN 115167806B
Authority
CN
China
Prior art keywords
audio
volume
gradual change
playing
network
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
CN202210813548.2A
Other languages
Chinese (zh)
Other versions
CN115167806A (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.)
Guangdong Baolun Electronics Co ltd
Original Assignee
Guangzhou Baolun Electronics 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 Guangzhou Baolun Electronics Co Ltd filed Critical Guangzhou Baolun Electronics Co Ltd
Priority to CN202210813548.2A priority Critical patent/CN115167806B/en
Publication of CN115167806A publication Critical patent/CN115167806A/en
Application granted granted Critical
Publication of CN115167806B publication Critical patent/CN115167806B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Reverberation, Karaoke And Other Acoustics (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a network audio broadcast gradual change audio processing method and a server, wherein the method comprises the following steps: driving the system host to configure the audio information of the singlechip processing unit through the USB and distributing the audio information; s2: and driving the network playing terminal to judge whether gradual change is needed according to the voice gradual change mark, if not, taking the volume of the audio stream as the playing volume, if so, executing S3: judging whether the current playing volume meets the condition, if so, playing the audio, and if not, calling a volume ratio table to obtain a value B; s4: by the formula: and S = A × B/65536, obtaining the adjusted playing volume, storing the adjusted playing volume as the current playing volume, and returning to execute S3. In the invention, the system host drives the single chip processing unit to process the audio information through the USB, the control complexity of the system host is reduced, an application layer is not required to participate in volume control, a volume proportion table is used for carrying out floating point number removal operation on data, integer operation is used, and the operation efficiency of a computer is greatly improved.

Description

Network audio broadcast gradual change audio processing method and server
Technical Field
The invention relates to the technical field of audio transmission, in particular to a network audio broadcast gradual change audio processing method and a server.
Background
In music playing, the function of gradually fading out volume is often needed to realize the function of comfortable transition of music. That is, when the playback is started, the sound gradually rises from small to large. When the playing is closed, the sound gradually decreases from large to small. The traditional music playing is that the machine plays, and when the music playing is controlled, the volume of the machine is controlled to gradually change gradually. In the case of audio broadcasting, the audio source and the playing source are not single devices, but are composed of a system host and a plurality of playing terminals, the system host is responsible for sending audio streams to the playing terminals to play music, and the gradual fading effect of the music is controlled by the host.
The existing network audio broadcasting technology realizes the gradual fade-out function, and mainly sends an instruction to control a playing terminal through a system host computer through a network, and sends a volume control instruction to control the network playing terminal to gradually fade out the sound when the audio is played or stopped. The prior art mainly has the following problems: first, the separation of the volume control from the audio stream may cause the volume change to be out of sync with the sound; secondly, the control logic of the host is complex, and when there are multiple playing terminals, it is necessary to send control instructions to the multiple playing terminals, which is easily interfered by network packet loss, and the loss of the control instructions cannot control the terminals to gradually fade out.
Disclosure of Invention
In order to overcome the defects of the prior art, an objective of the present invention is to provide a method for processing a gradual change audio of a network audio broadcast, which can solve the problems that in the gradual change of the network audio broadcast in the prior art, volume change and sound are easily out of synchronization, network packet loss is easily interfered, and a control instruction is lost, so that a terminal cannot be controlled to gradually fade out.
The present invention aims to provide a network audio broadcast gradual change audio processing server, which can solve the problems that in the network audio broadcast gradual change in the prior art, volume change and sound are easily out of synchronization, network packet loss is easily interfered, and a control instruction is lost, so that a terminal cannot be controlled to gradually fade out.
In order to achieve one of the purposes, the technical scheme adopted by the invention is as follows:
a network audio broadcast gradual change audio processing method comprises the following steps:
s1: driving a system host to configure audio information in an audio stream in a single chip microcomputer processing unit through a USB (universal serial bus) and distribute the audio information to a network playing terminal through a network, wherein the audio information comprises an audio ID (identity), an audio stream volume, a gradual change mark and a gradual change duration field;
s2: driving the network playing terminal to judge whether the current audio stream needs to be subjected to volume gradual change according to a gradual change mark in the audio data, if not, storing the volume of the audio stream as playing volume, playing the audio, and if so, executing S3;
s3: judging whether the current playing volume meets the condition, if so, playing the audio at the current playing volume, ending the gradual change of the volume, if not, calling a volume ratio table, obtaining a value B corresponding to the current playing volume in the volume ratio table, and executing S4;
s4: by the formula: s = A × B/65536, obtaining the adjusted playing volume, storing the adjusted playing volume as the current playing volume, and returning to execute S3; wherein S is the adjusted playing volume, and A is the current playing volume.
Preferably, S1 is specifically realized by the following steps:
s11: driving the system host to configure audio information in the audio stream in the singlechip processing unit through the USB;
s12: and driving the system host to transmit the audio frames to the singlechip processing unit through the USB, forming UDP packets by the audio frames and the audio information, and distributing the UDP packets to the network playing terminal through the network.
Preferably, the step S2 is specifically realized by the following steps:
and driving the network playing terminal to unpack the UDP packet, extracting the volume, the gradual change mark and the gradual change duration of the audio stream, judging whether the current audio stream needs to be gradually changed or not according to the gradual change mark in the audio data, if not, storing the volume of the audio stream as the playing volume, playing the audio, and if so, executing S3.
Preferably, the S2 and S3 further include the steps of:
and judging whether the gradual change mark belongs to a gradual change mark, if so, storing the gradual change condition as that the current playing volume is equal to the volume of the audio stream, and if not, storing the gradual change condition as that the playing volume is 0.
Preferably, the step S4 is specifically realized by the following steps:
by the formula: s = A × B/65536, obtaining the adjusted playing volume, storing the adjusted playing volume into the current playing volume, waiting for a gradual change duration, and returning to execute S3; wherein S is the adjusted playing volume, and A is the current playing volume.
In order to achieve the second purpose, the technical scheme adopted by the invention is as follows:
a network audio broadcasting gradual change audio processing server comprises a storage and a processor;
a memory for storing program instructions;
and the processor is used for executing the program instructions to execute the network audio broadcasting gradual change audio processing method.
Compared with the prior art, the invention has the beneficial effects that: the system host drives the single chip microcomputer processing unit to process the audio information through the USB, the control complexity of the system host is reduced, an application layer is not required to participate in volume control, meanwhile, a gradual change mark and gradual change duration of volume change are controlled to be synchronously combined and transmitted with an audio frame, a volume proportion table is used for carrying out floating point number removing operation on data, integer operation is used, and the operation efficiency of a computer is greatly improved.
Drawings
Fig. 1 is a flowchart of a method for processing network audio broadcast gradual change audio according to the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplification of description, but do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in a specific case to those of ordinary skill in the art.
The invention will be further described with reference to the accompanying drawings and the detailed description below:
in the invention, the system host comprises an arm embedded platform which is connected with a single chip microcomputer processing unit through a USB interface, wherein the arm embedded platform is responsible for processing application control, the single chip microcomputer processing unit is responsible for real-time audio stream distribution, and a user can log in the system host through a network by using a computer client (APP, a webpage and the like) so as to control the broadcasting system. Preferably, the single chip microcomputer processing unit is connected with the network playing terminal through a gigabit network.
The first embodiment is as follows:
as shown in fig. 1, a method for processing network audio broadcast gradual change audio includes the following steps:
s1: driving a system host to configure audio information in an audio stream in a single chip microcomputer processing unit through a USB (universal serial bus) and distribute the audio information to a network playing terminal through a network, wherein the audio information comprises an audio ID (identity), an audio stream volume, a gradual change mark and a gradual change duration field;
specifically, by combining the gradual change flag and the audio frame, the network playing terminal can obtain the gradual change standard and the audio frame at the same time, so as to reduce the delay, in this embodiment, the S1 is specifically implemented by the following steps:
s11: driving the system host to configure audio information in the audio stream in the singlechip processing unit through the USB;
specifically, the system host configures audio information in an audio stream in the single chip microcomputer processing unit through the USB, where the audio information includes an audio ID, an audio stream volume, a gradual change flag, and a gradual change duration field, the audio ID is an audio stream identification number, the audio stream volume range is 0-100, the gradual change flag includes 0 indicating no gradual change, 1 indicating gradual change, and 2 indicating gradual change, where 1, 2, and 0 may be set by user according to actual requirements, and in this embodiment, a frame header identifier, the audio stream ID, the audio stream volume, the gradual change flag, and the gradual change duration are sequentially arranged to form the audio information.
S12: and driving the system host to transmit the audio frames to the singlechip processing unit through the USB, forming UDP packets by the audio frames and the audio information, and distributing the UDP packets to the network playing terminal through the network.
Specifically, the system host transmits audio frames to the single chip microcomputer processing unit through the USB, and the audio frames and the audio information form UDP packets, wherein UDP packet headers, audio information, audio data length and audio data form UDP packets, and further, before distribution, the single chip microcomputer processing unit forms UDP packets distributed to different target IPs into three layers of network data packets, and the three layers of network data packets are distributed to the network playing terminal through the network.
S2: driving the network playing terminal to judge whether the current audio stream needs to carry out volume gradual change or not according to the gradual change mark in the audio data, if not, storing the volume of the audio stream as the playing volume, playing the audio, and if so, executing S3;
specifically, after obtaining the network data packet, the network playing terminal parses the network data packet, so as to determine whether the current audio stream needs to be gradually changed, in this embodiment, the S2 is specifically implemented by the following steps:
and driving the network playing terminal to unpack the UDP packet, extracting the volume, the gradual change mark and the gradual change duration of the audio stream, judging whether the current audio stream needs to be gradually changed or not according to the gradual change mark in the audio data, if not, storing the volume of the audio stream as the playing volume, playing the audio, and if so, executing S3.
Specifically, when the gradual change flag in the audio data is 0, it indicates that the current audio stream does not need to perform volume gradual change, the volume of the audio stream is stored as the playing volume, the audio is played, when the gradual change flag is not 0, it is further determined whether the gradual change flag belongs to the gradual change flag, if so, the gradual change condition is stored as that the current playing volume is equal to the volume of the audio stream, and if not, the gradual change condition is stored as that the playing volume is 0.
S3: judging whether the current playing volume meets the condition, if so, playing the audio at the current playing volume, otherwise, calling a volume ratio table to obtain a B value corresponding to the current playing volume in the volume ratio table, and executing S4;
specifically, when the gradual change mark is the gradual change mark, whether the current playing volume is equal to the volume of the audio stream is judged, if yes, the audio is played at the current playing volume, the gradual change of the volume is finished, and if not, a volume ratio table is called, and the volume gradual change processing is continued by obtaining a value B corresponding to the current playing volume, namely the volume ratio table.
And when the gradual change mark is a gradual change mark, judging whether the current playing volume is equal to 0, playing the audio at the current playing volume, ending the gradual change of the volume, if not, calling a volume ratio table, and obtaining a value B corresponding to the current playing volume, namely the volume ratio table, and continuing the volume gradual change process.
Preferably, the volume adjustment of each stage is set to-0.2 db by the formula: 20lg (Vo/Vi) =0.2db, obtain Vo/Vi =0.977, namely when each level attenuates 0.2db, the ratio of audio output to audio input is 0.977, wherein Vo is audio output, vi is audio input, therefore, obtain, vo/Vi =0.977^ (100-X), according to Vo/Vi =0.977^ (100-X), and Vi =65536 (because the system audio uses 16 bit data, use 65536 as the benchmark), calculate Vo value corresponding to each level of volume, form the volume proportion table, in order to realize the floating point removing operation, can calculate the digital audio after the volume adjustment at a high speed. The volume ratio table is as follows:
[0,6706,6862,7022,7185,7353,7524,7699,7879,8062,8250,
8442,8639,8840,9046,9257,9472,9693,9919,10150,10386,
10628,10876,11129,11388,11654,11925,12203,12487,12778,13076,
13380,13692,14011,14337,14671,15013,15363,15720,16087,16461,
16845,17237,17639,18050,18470,18900,19341,19791,20252,20724,
21207,21701,22206,22723,23253,23794,24348,24916,25496,26090,
26698,27319,27956,28607,29273,29955,30653,31367,32098,32845,
33610,34393,35194,36014,36853,37712,38590,39489,40409,41350,42313,43299,44307,45339,46395,47476,48582,49714,50872,52057,53269,54510,55780,57079,58409,59769,61161,62586,64044,65536]
s4: by the formula: s = A × B/65536, obtaining the adjusted playing volume, storing the adjusted playing volume as the current playing volume, and returning to execute S3; wherein S is the adjusted playing volume, and A is the current playing volume.
Specifically, by the formula: s = A × B/65536, obtaining the adjusted playing volume, storing the adjusted playing volume into the current playing volume, playing for a gradual change duration according to the current playing volume, and then returning to execute S3; wherein S is the adjusted playing volume, and A is the current playing volume.
In the present embodiment, when the current playback volume is 100, then 100 is the corresponding B value bit 65536, so S =100, i.e., when the current playback volume is 100, there is no attenuation. When the current playing volume is 50, s =50 × b/65536=50 × 0.31, which corresponds to 2/3 of the volume attenuation, the attenuation rate is about-10.1 db.
Example two:
a network audio broadcasting gradual change audio processing server comprises a storage and a processor;
a memory for storing program instructions;
a processor, configured to execute the program instructions to perform the network audio broadcast gradual change audio processing method according to the first embodiment.
Various other modifications and changes may be made by those skilled in the art based on the above-described technical solutions and concepts, and all such modifications and changes should fall within the scope of the claims of the present invention.

Claims (4)

1. A gradual change audio processing method for network audio broadcasting is characterized by comprising the following steps:
s1: driving a system host to configure audio information in an audio stream in a single chip microcomputer processing unit through a USB (universal serial bus) and distribute the audio information to a network playing terminal through a network, wherein the audio information comprises an audio ID (identity), an audio stream volume, a gradual change mark and a gradual change duration field;
s2: driving the network playing terminal to judge whether the current audio stream needs to be subjected to volume gradual change according to a gradual change mark in the audio data, if not, storing the volume of the audio stream as playing volume, playing the audio, and if so, executing S3;
s3: judging whether the current playing volume meets the condition, if so, playing the audio at the current playing volume, ending the gradual change of the volume, if not, calling a volume ratio table, obtaining a value B corresponding to the current playing volume in the volume ratio table, and executing S4;
s4: by the formula: s = A × B/65536, obtaining the adjusted playing volume, storing the adjusted playing volume into the current playing volume, waiting for a gradual change duration, and returning to execute S3; wherein S is the adjusted playing volume, and A is the current playing volume;
wherein, the S1 is realized by the following steps:
s11: driving the system host to configure audio information in the audio stream in the singlechip processing unit through the USB;
s12: and driving the system host to transmit the audio frames to the singlechip processing unit through the USB, forming UDP packets by the audio frames and the audio information, and distributing the UDP packets to the network playing terminal through the network.
2. The method for processing audio gradually changed in network audio broadcasting according to claim 1, wherein the step S2 is specifically implemented by the following steps:
and driving the network playing terminal to unpack the UDP packet, extracting the volume, the gradual change mark and the gradual change duration of the audio stream, judging whether the current audio stream needs to be gradually changed or not according to the gradual change mark in the audio data, if not, storing the volume of the audio stream as the playing volume, playing the audio, and if so, executing S3.
3. The network audio broadcast gradual audio processing method of claim 2, wherein the S2 and S3 further comprise the steps of:
and judging whether the gradual change mark belongs to a gradual change mark, if so, storing the gradual change condition as that the current playing volume is equal to the volume of the audio stream, and if not, storing the gradual change condition as that the playing volume is 0.
4. A network audio broadcast gradual change audio processing server, characterized by: comprises a storage and a processor;
a memory for storing program instructions;
a processor for executing the program instructions to perform the network audio broadcast gradual audio processing method according to any one of claims 1 to 3.
CN202210813548.2A 2022-07-11 2022-07-11 Network audio broadcast gradual change audio processing method and server Active CN115167806B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210813548.2A CN115167806B (en) 2022-07-11 2022-07-11 Network audio broadcast gradual change audio processing method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210813548.2A CN115167806B (en) 2022-07-11 2022-07-11 Network audio broadcast gradual change audio processing method and server

Publications (2)

Publication Number Publication Date
CN115167806A CN115167806A (en) 2022-10-11
CN115167806B true CN115167806B (en) 2023-03-24

Family

ID=83493689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210813548.2A Active CN115167806B (en) 2022-07-11 2022-07-11 Network audio broadcast gradual change audio processing method and server

Country Status (1)

Country Link
CN (1) CN115167806B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117765839B (en) * 2023-12-25 2024-07-16 广东保伦电子股份有限公司 Indoor intelligent navigation method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385888A (en) * 2010-09-03 2012-03-21 索尼公司 Control terminal apparatus and control method
CN104685908A (en) * 2012-09-28 2015-06-03 三星电子株式会社 User terminal apparatus, electronic device, and method for controlling the same

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI528777B (en) * 2012-12-28 2016-04-01 鴻海精密工業股份有限公司 Volume adjustment method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102385888A (en) * 2010-09-03 2012-03-21 索尼公司 Control terminal apparatus and control method
CN104685908A (en) * 2012-09-28 2015-06-03 三星电子株式会社 User terminal apparatus, electronic device, and method for controlling the same

Also Published As

Publication number Publication date
CN115167806A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
CN104254007B (en) A kind of audio-frequency processing method and device
US9270784B2 (en) Peer-to-peer communications
US9549023B2 (en) Communications adaptable to mobile devices
CN103888818B (en) A kind of television program playing method, equipment and system
CN105161121B (en) To the control method and audio transfer control of audio peripheral hardware transmission audio
CN102739661B (en) Method and system for network audio sync output on basis of data statistics
JP7476327B2 (en) AUDIO DATA PROCESSING METHOD, DELAY TIME ACQUISITION METHOD, SERVER, AND COMPUTER PROGRAM
CN104934050A (en) Audio networking playing method and system based on wireless network
CN115167806B (en) Network audio broadcast gradual change audio processing method and server
CN107333163A (en) A kind of method for processing video frequency and device, a kind of terminal and storage medium
CN105451071A (en) Video stream processing method, device and system
US20230364513A1 (en) Audio processing method and apparatus
CN104065401B (en) Based on HID bluetooth module voice transmission method and HID blue tooth voice communicator
CN108738007B (en) Audio transmission method, equipment and system
CN106303754A (en) A kind of audio data play method and device
CN109379168A (en) A kind of smooth playback method of voice for the chat of front end real-time voice
CN112105005B (en) Method and device for controlling Bluetooth equipment to play
CN108494702B (en) Transmission control method and apparatus, storage medium, and electronic apparatus
US20240388866A1 (en) Audio processing method and terminal
WO2020082710A1 (en) Voice interaction control method, apparatus and system for bluetooth speaker
CN114416013B (en) Data transmission method, device, electronic device and computer readable storage medium
CN103744505B (en) Information processing method and electronic equipment
CN113556320A (en) Ethernet multi-channel audio real-time transmission method and equipment
WO2024199055A1 (en) Audio processing method and apparatus, electronic device and computer-readable storage medium
CN209982711U (en) Intelligent sound box with multi-room music playing function through local area network

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: No. 56 Nanli East Road, Shiqi Town, Panyu District, Guangzhou City, Guangdong Province, 510000

Patentee after: Guangdong Baolun Electronics Co.,Ltd.

Address before: No.19 Chuangyuan Road, Zhongcun street, Panyu District, Guangzhou, Guangdong 510000

Patentee before: GUANGZHOU ITC ELECTRONIC TECHNOLOGY Co.,Ltd.