CN107105307B - A kind for the treatment of method and apparatus of audio - Google Patents
A kind for the treatment of method and apparatus of audio Download PDFInfo
- Publication number
- CN107105307B CN107105307B CN201710300898.8A CN201710300898A CN107105307B CN 107105307 B CN107105307 B CN 107105307B CN 201710300898 A CN201710300898 A CN 201710300898A CN 107105307 B CN107105307 B CN 107105307B
- Authority
- CN
- China
- Prior art keywords
- data
- judging
- unit
- volume
- pcm material
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/232—Content retrieval operation locally within server, e.g. reading video streams from disk arrays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/233—Processing of audio elementary streams
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/239—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
- H04N21/2393—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
Abstract
This application provides a kind for the treatment of method and apparatus of audio, pre-encoded file has pre-generated in the present invention, when the corresponding pre-encoded file of audio request that set-top box is sent is present in the memory of the server, the frame data corresponding with the audio request found in the pre-encoded file are sent to the set-top box, after this programme receives audio request, no longer encoded, therefore the more computing resource of background server will not be occupied, reduces the work load of background server.
Description
Technical field
The present invention relates to field of audio processing, more specifically, being related to a kind for the treatment of method and apparatus of audio.
Background technique
Currently, user is watched TV or played game using digital broadcast television has become a kind of entertainment way.
For user when using digital broadcast television viewing TV or object for appreciation game, set-top box sends the audio request of user
To background server, background server encodes corresponding audio file, and then the audio file that will be encoded according to audio request
It is sent to set-top box, makes audio normal play.It is more that background server can occupy background server in encoded audio file
Computing resource, and then cause the work load of background server heavier.
Summary of the invention
In view of this, the present invention provides a kind for the treatment of method and apparatus of audio, to solve background server in coding sound
Background server more computing resource can be occupied when frequency file, and then causes the work load of background server is heavier to ask
Topic.
In order to solve the above technical problems, present invention employs following technical solutions:
A kind of processing method of audio is applied to server, comprising:
The audio request that receiving set up box is sent;
Judge that the corresponding pre-encoded file of the audio request whether there is in the memory of the server;Wherein, institute
Pre-encoded file is stated to have pre-generated;
When judging that the corresponding pre-encoded file of the audio request is present in the memory of the server, described pre-
It encodes and searches frame data corresponding with the audio request in file;
The frame data are sent to the set-top box.
Preferably, when judging that the corresponding pre-encoded file of the audio request do not exist in the memory of the server
Afterwards, further includes:
Judge the pre-encoded file whether is preserved in the hard disk of the server;
When preserving the pre-encoded file in the hard disk for judging the server, the pre-encoded file is saved to institute
State memory;
Analyze depositing for the level of sound volume type and the corresponding frame data of each level of sound volume for including in the pre-encoded file
Storage space is set;
Return to the lookup frame data corresponding with the audio request in the pre-encoded file;
When not preserving the pre-encoded file in the hard disk for judging the server, judge whether protect in the memory
There is the corresponding pulse code modulation PCM material of the audio request;
When judging to preserve the corresponding PCM material of the audio request in the memory, by the PCM material with institute
Corresponding first data conversion of audio request is stated into the second data for meeting preset format;
The set-top box is sent by second data.
Preferably, after judging not preserve the corresponding PCM material of the audio request in the memory, further includes:
Judge the PCM material whether is preserved in the hard disk of the server;
When preserving the PCM material in the hard disk for judging the server, the PCM material is saved to described interior
It deposits;
Return it is described by the first data conversion corresponding with the audio request in the PCM material at meeting preset format
The second data.
Preferably, the generating process of the pre-encoded file includes:
Obtain the corresponding PCM material of the audio request;
Whether the parameter value for judging the audio frequency characteristics parameter of the PCM material is default value;
When the parameter value for the audio frequency characteristics parameter for judging the PCM material is default value, acquisition precoding volume
List;It wherein, include multiple level of sound volume in the precoding volume list;
The volume in the PCM material is adjusted according to the linear transformation algorithm of volume multiple, obtains the precoding volume
The corresponding new PCM material of i-th of level of sound volume in list;
It is corresponding to obtain i-th of level of sound volume for the format for converting the corresponding new PCM material of i-th of level of sound volume
The multiple frame data for meeting preset format;
Count the size of data of the corresponding multiple frame data for meeting preset format of i-th of level of sound volume;
Judge whether to count in the precoding volume list that the last one described level of sound volume is corresponding to meet default lattice
The size of data of multiple frame data of formula;
If judge not count the last one described level of sound volume in the precoding volume list it is corresponding meet it is default
The size of data of multiple frame data of format makes i=i+1, and returns according to the adjustment of the linear transformation algorithm of volume multiple
Volume in PCM material obtains in the precoding volume list the corresponding new PCM material of i-th of level of sound volume;Its
In, i is positive integer;
If judge to have counted the last one described level of sound volume in the precoding volume list it is corresponding meet it is default
The size of data of multiple frame data of format, according to pre-encoded file template, the precoding volume list, each volume
Corresponding multiple frame data for meeting preset format of grade and each level of sound volume is corresponding meets the more of preset format
The size of data of a frame data generates the pre-encoded file.
Preferably, by the first data conversion corresponding with the audio request in the PCM material at meeting preset format
The second data before, further includes:
Judge whether there is the data to be sent of the set-top box;
When the data to be sent for judging no set-top box, execute it is described by the PCM material with
Corresponding first data conversion of the audio request is at the second data for meeting preset format;
When the data to be sent for judging to have the set-top box, by the data to be sent and first number
According to being integrated, the data after being integrated;
Data after the integration are converted to the third data for meeting preset format;
The set-top box is sent by the third data.
A kind of processing unit of audio is applied to server, comprising:
Receiving unit, the audio request sent for receiving set up box;
First judging unit, for judging that the corresponding pre-encoded file of the audio request whether there is in the server
Memory in;Wherein, the pre-encoded file has pre-generated;
Searching unit, for judging that the corresponding pre-encoded file of the audio request exists when first judging unit
In the memory of the server, frame data corresponding with the audio request are searched in the pre-encoded file;
First transmission unit, for the frame data to be sent to the set-top box.
Preferably, further includes:
Second judgment unit, for judging the corresponding pre-encoded file of the audio request when first judging unit
After not existing in the memory of the server, judge the pre-encoded file whether is preserved in the hard disk of the server;
First storage unit, for described when being preserved in the hard disk that the second judgment unit judges the server
Pre-encoded file saves the pre-encoded file to the memory;
Analytical unit, it is corresponding for analyzing the level of sound volume type for including in the pre-encoded file and each level of sound volume
Frame data storage location;
The searching unit is also used to the analytical unit and analyzes the level of sound volume type for including in the pre-encoded file
After the storage location of frame data corresponding with each level of sound volume, searched and the audio request pair in the pre-encoded file
The frame data answered;
Third judging unit, for judging not saving in the hard disk of the server when the second judgment unit
Pre-encoded file is stated, judges whether preserve the corresponding pulse code modulation PCM material of the audio request in the memory;
First converting unit, for judging to preserve the audio request in the memory when the third judging unit
Corresponding PCM material, by the first data conversion corresponding with the audio request in the PCM material at meeting preset format
Second data;
Second transmission unit, for sending the set-top box for second data.
Preferably, further includes:
4th judging unit, for judging that not preserving the audio in the memory asks when the third judging unit
After seeking corresponding PCM material, judge the PCM material whether is preserved in the hard disk of the server;
Second storage unit, for described when being preserved in the hard disk that the 4th judging unit judges the server
PCM material saves the PCM material to the memory;
First converting unit will after being also used to the second storage unit preservation PCM material to the memory
The first data conversion corresponding with the audio request is at the second data for meeting preset format in the PCM material.
Preferably, further includes:
First acquisition unit, for obtaining the corresponding PCM material of the audio request;
5th judging unit, for judging whether the parameter value of audio frequency characteristics parameter of the PCM material is present count
Value;
Second acquisition unit, for judging the audio frequency characteristics parameter of the PCM material when the 5th judging unit
Parameter value is default value, obtains the list of precoding volume;Wherein, multiple volumes etc. are included in the precoding volume list
Grade;
Adjustment unit adjusts the volume in the PCM material for the linear transformation algorithm according to volume multiple, obtains institute
State in precoding volume list the corresponding new PCM material of i-th of level of sound volume;
Second converting unit obtains i-th for converting the format of the corresponding new PCM material of i-th of level of sound volume
The corresponding multiple frame data for meeting preset format of the level of sound volume;
Statistic unit, for counting the number of the corresponding multiple frame data for meeting preset format of i-th of level of sound volume
According to size;
6th judging unit, for judging whether to count the last one described level of sound volume in the precoding volume list
The size of data of the corresponding multiple frame data for meeting preset format;
Control unit, if judging not count last in the precoding volume list for the 6th judging unit
The size of data of the corresponding multiple frame data for meeting preset format of a level of sound volume, makes i=i+1;
The adjustment unit is also used to after described control unit makes i=i+1, according to the linear transformation algorithm of volume multiple
The volume in the PCM material is adjusted, the corresponding new PCM of i-th of level of sound volume is obtained in the precoding volume list
Material;Wherein, i is positive integer;
Generation unit, if judging to have counted last in the precoding volume list for the 6th judging unit
The size of data of the corresponding multiple frame data for meeting preset format of a level of sound volume, according to pre-encoded file template, institute
State the list of precoding volume, corresponding multiple frame data for meeting preset format of each level of sound volume and each described
The size of data of the corresponding multiple frame data for meeting preset format of level of sound volume, generates the pre-encoded file.
Preferably, further includes:
7th judging unit, for judging whether there is the data to be sent of the set-top box;
First converting unit is also used to judge no set-top box when the 7th judging unit
Data to be sent, by the first data conversion corresponding with the audio request in the PCM material at meeting preset format
Second data;
Data Integration unit, for judging there be the to be sent of the set-top box when the 7th judging unit
Data are integrated the data to be sent and first data, the data after being integrated;
Third converting unit, for the data after the integration to be converted to the third data for meeting preset format;
Third transmission unit, for sending the set-top box for the third data.
Compared to the prior art, the invention has the following advantages:
The present invention provides a kind for the treatment of method and apparatus of audio, pre-encoded file has been pre-generated in the present invention,
It, will be described when the corresponding pre-encoded file of audio request that set-top box is sent is present in the memory of the server
The frame data corresponding with the audio request found in pre-encoded file are sent to the set-top box, and this programme receives sound
After frequency is requested, it is no longer necessary to be encoded, therefore the more computing resource of background server will not be occupied, reduce background server
Work load.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of method flow diagram of the processing method of audio provided by the invention;
Fig. 2 is the method flow diagram of the processing method of another audio provided by the invention;
Fig. 3 is the method flow diagram of the processing method of another audio provided by the invention;
Fig. 4 is the method flow diagram of the processing method of another audio provided by the invention;
Fig. 5 is a kind of structural schematic diagram of the processing unit of audio provided by the invention;
Fig. 6 is the structural schematic diagram of the processing unit of another audio provided by the invention;
Fig. 7 is the structural schematic diagram of the processing unit of another audio provided by the invention;
Fig. 8 is the structural schematic diagram of the processing unit of another audio provided by the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of processing methods of audio, referring to Fig.1, are applied to server, comprising:
The audio request that S101, receiving set up box are sent;
Specifically, audio request is that user is generated by the key on pressing remote controler.
S102, judge that the corresponding pre-encoded file of audio request whether there is in the memory of server;When judging sound
Frequency requests corresponding pre-encoded file to be present in the memory of server, executes step S103.
Wherein, pre-encoded file has pre-generated.
S103, frame data corresponding with audio request are searched in pre-encoded file.
Wherein, multiple frame data are preserved in pre-encoded file, the quantity for the frame data that this step is searched is one.
S104, frame data are sent to set-top box.
Specifically, frame data are sent to set-top box, specifically include:
Frame data are multiplexed into transport stream TS stream, and then TS stream is sent to set-top box.
A kind of processing method of audio is present embodiments provided, pre-encoded file has pre-generated in the present embodiment, when
When the corresponding pre-encoded file of audio request that set-top box is sent is present in the memory of server, it will be looked into pre-encoded file
The frame data corresponding with audio request found are sent to set-top box, after this programme receives audio request, it is no longer necessary to carry out
Coding, therefore the more computing resource of background server will not be occupied, reduce the work load of background server.
Optionally, in another embodiment of the present invention, referring to Fig. 2, when judging the corresponding pre-encoded file of audio request
After not existing in the memory of server, step S105 is executed.
S105, judge whether preserve pre-encoded file in the hard disk of server;When being protected in the hard disk for judge server
There is pre-encoded file, executes step S106, when not preserving pre-encoded file in the hard disk for judge server, executes step
S108。
S106, pre-encoded file is saved to memory.
S107, depositing for the level of sound volume type and the corresponding frame data of each level of sound volume for including in pre-encoded file is analyzed
Storage space is set;After executing the step S107, step S103 is executed.
Specifically, including at least one level of sound volume and at least one corresponding frame number of level of sound volume in pre-encoded file
According to, wherein the storage location of the corresponding frame data of analysis level of sound volume as analyzes position of the frame data in pre-encoded file
It sets.
It should be noted that the level of sound volume and the corresponding frame data of each level of sound volume that include in analysis pre-encoded file
Storage location, be to be able to after receiving audio request, quickly find the corresponding frame data of audio request.
S108, judge the corresponding pulse code modulation PCM material of audio request whether is preserved in memory;In judging
It preserves the corresponding pulse code modulation PCM material of audio request in depositing, executes step S109, when judging not save in memory
There is the corresponding pulse code modulation PCM material of audio request, executes step S111.
S109, by the first data conversion corresponding with audio request in PCM material at the second data for meeting preset format;
Specifically, preset format includes the formats such as MPEG-1layer II, MP3, Advanced Audio Coding AAC.
Step S109 is the conversion of format, and a kind of format is converted into another format.
S110, set-top box is sent by the second data.
Specifically, the second data-reusing is flowed at TS, and TS stream is sent to set-top box.
S111, judge PCM material whether is preserved in the hard disk of server;When being preserved in the hard disk for judge server
PCM material executes step S112,
S112, PCM material is saved to memory.
Optionally, after step S112, further includes:
Establish the mapping relations of PCM material and pre-encoded file.
Specifically, establishing the mapping relations of PCM material and pre-encoded file, i.e., PCM material and pre-encoded file are bound
Together.
It should be noted that each music has corresponding PCM material and pre-encoded file, and each music has only
One mark when binding together PCM material and pre-encoded file, also ties up corresponding mark with PCM material, pre-encoded file
It is scheduled on together, the corresponding PCM material of the music and precoding text can be quickly found out in the corresponding file of a certain music of lookup
Part reduces the time needed due to temporarily searching for.
It should be noted that returning to step S109 and S110 after executing step S112.
In the present embodiment, when not preserving the corresponding pre-encoded file of audio request in hard disk, audio has been searched whether
Corresponding PCM material is requested, when there is corresponding PCM material, by the first data conversion corresponding with audio request in PCM material
It is sent to set-top box at the second data for meeting preset format, and by the second data, and then can satisfy user to the need of audio
It asks.
It should be noted that a few level of sound volume is only defined in pre-encoded file, as original sound volume, volume reduce
One times, volume double, two times, four times etc..When audio request is that request volume increases by 1.5 times, at this time in precoding text
It can not find corresponding frame data in part, coding PCM material can only be passed through by searching for the corresponding PCM material of the audio request
Mode obtains the data of 1.5 times of volumes.
Optionally, in another embodiment of the present invention, the generating process of pre-encoded file includes:
S301, the corresponding PCM material of audio request is obtained;
Wherein, when PCM material tail portion deficiency audio coding whole frame, with one frame of quiet samples point auto-complete;Guarantee number
It can be completely aligned according to frame.Specifically, currently employed audio coding is (frame) processing as unit of 1152 sample points, if
When PCM material tail portion residue sample points are less than 1152 sample points (frame), by increasing quiet samples point completion into 1152 samples
This points (frame).
Whether S302, the parameter value for judging the audio frequency characteristics parameter of PCM material are default value;When judge PCM element
The parameter value of the audio frequency characteristics parameter of material is default value, executes step S303.
Specifically, the audio frequency characteristics parameter that can generate the PCM material of pre-encoded file needs to meet preset regulation, i.e.,
The parameter value of audio frequency characteristics parameter is default value, and if coded format is MPEG-1layer II, coded audio frame sign is
1152 sample points, bit rate output 64Kbps, sample rate 44100Hz, channel number is two-channel, sampling precision is 16bit etc..
S303, the list of precoding volume is obtained;
It wherein, include multiple level of sound volume in the list of precoding volume.Precoding volume list be it is generated in advance, in advance
The coding volume list level of sound volume that includes include original sound volume, volume reduce by one times, volume double, two times, four times etc..
S304, the volume in PCM material is adjusted according to the linear transformation algorithm of volume multiple, obtains precoding volume list
In the corresponding new PCM material of i-th of level of sound volume;
Wherein, the volume in PCM material is original sound volume, when i-th of level of sound volume is original sound volume, volume multiple
Linear transformation algorithm is one times, that is, does not need the volume in adjustment PCM material, and obtained new PCM material is identical as PCM material.
When i-th of level of sound volume is not original sound volume, when for example volume doubles, according to the linear change of volume multiple
Volume adjustment in PCM material is the volume doubled by scaling method, obtains new PCM material.
The format of S305, the corresponding new PCM material of i-th of level of sound volume of conversion, obtain the corresponding symbol of i-th of level of sound volume
Close multiple frame data of preset format;
Wherein, preset format includes the formats such as MPEG-1layer II, MP3, Advanced Audio Coding AAC.
The size of data of S306, the corresponding multiple frame data for meeting preset format of i-th of level of sound volume of statistics;
S307, judge whether to count the corresponding preset format that meets of the last one level of sound volume in precoding volume list
The size of data of multiple frame data;When judging not count in precoding volume list, the last one level of sound volume is corresponding to be met
The size of data of multiple frame data of preset format executes step S308;When judging to have counted in precoding volume list most
The size of data of the corresponding multiple frame data for meeting preset format of the latter level of sound volume executes step S309.
It should be noted that ought count in precoding volume list, the last one level of sound volume is corresponding to meet default lattice
The size of data of multiple frame data of formula illustrates the encoded completion of the corresponding frame data of each level of sound volume.
S308, make i=i+1;
Wherein, after having executed S308, return step S304.Wherein, i is positive integer.
S309, according to pre-encoded file template, the list of precoding volume, each level of sound volume is corresponding meets preset format
Multiple frame data and the corresponding multiple frame data for meeting preset format of each level of sound volume size of data, generate pre-
Encode file.
Specifically, pre-encoded file format encapsulation format is as follows:
1) top of file identifies four byte IAPS;(full capitalization)
2) retain 8 bytes for purposes in other in future;(being initially set to 0xFF)
3) two bytes: the quantity for the level of sound volume that description pre-encoded file includes (upper byte is preceding);
4) the level of sound volume quantity for including according to pre-encoded file, sequentially lists the attribute of every kind of level of sound volume:
Two bytes describe level of sound volume;Upper byte is preceding;
Four bytes describe the size of data (byte number) of frame data;
Four bytes retain 4 bytes and are used for purposes in future (initial value 0xFF);
5) after be successively 4) described in the corresponding multiple frame data for meeting preset format of each level of sound volume.
Wherein, each frame data include four parts:
<1>two byte describes data and starts, and is fixed as character E and S;
<2>two bytes describe present frame actual coding data word joint number: a high position is preceding;
It<3>is the actual frame coded data size of<2>description after;
<4>byte of padding (0xFF) is until filling up entire frame data.
Optionally, the sequence of step S302 and step S303 can exchange, i.e., after obtaining the list of precoding volume, going
Whether the parameter value for judging the audio frequency characteristics parameter of PCM material is default value.In addition, special in the audio for judging PCM material
Levy parameter parameter value be default value after, 1), 2) He 3) pre-encoded file the can be partially filled with.
In the present embodiment, the corresponding multiple frame data for meeting preset format of each level of sound volume, Jin Erneng are firstly generated
Enough generate pre-encoded file.
Optionally, in another embodiment of the present invention, before step S109, further includes:
S409, the not sent data to be sent to set-top box are judged whether there is;It is no not sent to set-top box when judging
Data to be sent, execute step S410, when judging there are the not sent data to be sent to set-top box, execute step S414.
Wherein, the characteristic parameter of data to be sent should be preset characteristic parameter, if sample rate is 44100Hz, bit
Number is 16bit, and channel number is two-channel etc..
It should be noted that the data to be sent in the present embodiment are the data in other PCM materials, it is to be sent finding
When data, the position of the data to be sent should be navigated in PCM material first.
S414, data to be sent and the first data are integrated, the data after being integrated;
Wherein, data amount check to be sent can be one, be also possible to multiple, and data to be sent and the first data are carried out
Integration, i.e. progress audio mixing synthesis, the data after being integrated.
It should be noted that the characteristic parameter of the first data is identical as the characteristic parameter of data to be sent.
S415, the data after integration are converted to the third data for meeting preset format;
Wherein, preset format includes the formats such as MPEG-1layer II, MP3, Advanced Audio Coding AAC.
S416, set-top box is sent by third data.
In the present embodiment, by the first data conversion corresponding with audio request in PCM material at meeting preset format
Before second data, the not sent data to be sent to set-top box are judged whether there is, it is not sent to set-top box when judging to have
Data to be sent, data to be sent and the first data are integrated, the data after being integrated, and can will be sent to machine top
Multiple Data Integrations of box are sent to set-top box at a data, i.e., send out multiple music that user requests after audio mixing synthesizes
Give set-top box.
It should be noted that be related to the switching of both of which in the present invention, i.e. real-time coding mode and pre-encoded file
The switching of mode, wherein pre-encoded file mode is only applicable to single channel audio.Handoff scenario includes:
The switching of pre-encoded file mode to real-time coding mode includes:
1) under single channel audio, increase new audio audio mixing;
I.e. when playing single music, a music is increased.
2) under single channel audio, non-precoded volume is switched to from the broadcasting of precoding volume and is played;
Wherein, precoding volume refers to the corresponding volume of the level of sound volume in above-described embodiment, non-precoded volume refer in addition to
Other volumes except the corresponding volume of level of sound volume in above-described embodiment.
3) under single channel audio, self-braking process of fading out is switched to from the broadcasting of precoding volume;
Another kind of is the switching of real-time coding to pre-encoded file:
1) under multichannel audio, multichannel broadcasting is switched to the broadcasting of precoding volume single channel;
2) under single channel audio, starting is faded in broadcasting switching precoding volume and is played;
3) under single channel audio, precoding volume is switched to from non-precoded broadcasting and is played.
Optionally, a kind of processing unit of audio is provided in another embodiment of the present invention, referring to Fig. 5, is applied to clothes
Business device, comprising:
Receiving unit 101, the audio request sent for receiving set up box;
First judging unit 102, for judging that the corresponding pre-encoded file of audio request whether there is in server
In depositing;Wherein, pre-encoded file has pre-generated;
Searching unit 103, for judging that the corresponding pre-encoded file of audio request is present in when the first judging unit 102
In the memory of server, frame data corresponding with audio request are searched in pre-encoded file;
First transmission unit 104, for frame data to be sent to set-top box.
A kind of processing unit of audio is present embodiments provided, pre-encoded file has pre-generated in the present embodiment, when
When the corresponding pre-encoded file of audio request that set-top box is sent is present in the memory of server, it will be looked into pre-encoded file
The frame data corresponding with audio request found are sent to set-top box, after this programme receives audio request, it is no longer necessary to carry out
Coding, therefore the more computing resource of background server will not be occupied, reduce the work load of background server.
It should be noted that the course of work of each unit in the present embodiment, please refers in the corresponding embodiment of Fig. 1
Illustrate, details are not described herein.
Optionally, in another embodiment of the present invention, referring to Fig. 6, further includes:
Second judgment unit 105, for judging the corresponding pre-encoded file of audio request not when the first judging unit 102
After being present in the memory of server, judge whether preserve pre-encoded file in the hard disk of server;
First storage unit 106, for judging to preserve precoding in the hard disk of server when second judgment unit 105
File saves pre-encoded file to memory;
Analytical unit 107, it is corresponding for analyzing the level of sound volume type for including in pre-encoded file and each level of sound volume
Frame data storage location;
Searching unit 103 is also used to analytical unit 107 and analyzes the level of sound volume type for including in pre-encoded file and each
After the storage location of the corresponding frame data of level of sound volume, frame data corresponding with audio request are searched in pre-encoded file;
Third judging unit 108, for prelisting when second judgment unit 105 is judged not preserve in the hard disk of server
Code file, judges the corresponding pulse code modulation PCM material of audio request whether is preserved in memory;
First converting unit 109, for when third judging unit 108 judge to preserve audio request in memory it is corresponding
PCM material, by the first data conversion corresponding with audio request in PCM material at the second data for meeting preset format;
Second transmission unit 110, for sending set-top box for the second data;
4th judging unit 111, for judging that not preserving audio request in memory corresponds to when third judging unit 108
PCM material after, judge PCM material whether is preserved in the hard disk of server;
Second storage unit 112, for judging to preserve PCM element in the hard disk of server when the 4th judging unit 111
Material saves PCM material to memory;
First converting unit 109 will be in PCM material after being also used to the second storage unit 112 preservation PCM material to memory
The first data conversion corresponding with audio request is at the second data for meeting preset format.
In the present embodiment, when not preserving the corresponding pre-encoded file of audio request in hard disk, audio has been searched whether
Corresponding PCM material is requested, when there is corresponding PCM material, by the first data conversion corresponding with audio request in PCM material
It is sent to set-top box at the second data for meeting preset format, and by the second data, and then can satisfy user to the need of audio
It asks.
It should be noted that the course of work of each unit in the present embodiment, referring to figure 2. in corresponding embodiment
Illustrate, details are not described herein.
Optionally, in another embodiment of the present invention, referring to Fig. 7, further includes:
First acquisition unit 201, for obtaining the corresponding PCM material of audio request;
5th judging unit 202, for judging whether the parameter value of audio frequency characteristics parameter of PCM material is present count
Value;
Second acquisition unit 203, the ginseng of the audio frequency characteristics parameter for judging PCM material when the 5th judging unit 202
Number value is default value, obtains the list of precoding volume;It wherein, include multiple level of sound volume in the list of precoding volume;
Adjustment unit 204 obtains pre- for adjusting the volume in PCM material according to the linear transformation algorithm of volume multiple
Encode the corresponding new PCM material of i-th of level of sound volume in volume list;
Second converting unit 205 obtains i-th for converting the format of the corresponding new PCM material of i-th of level of sound volume
The corresponding multiple frame data for meeting preset format of level of sound volume;
Statistic unit 206, for counting the data of the corresponding multiple frame data for meeting preset format of i-th of level of sound volume
Size;
6th judging unit 207, it is corresponding for judging whether to count the last one level of sound volume in the list of precoding volume
The multiple frame data for meeting preset format size of data;
Control unit 208, if judging not count the last one in precoding volume list for the 6th judging unit 207
The size of data of the corresponding multiple frame data for meeting preset format of level of sound volume, makes i=i+1;
Adjustment unit 204 is also used to after control unit 208 makes i=i+1, according to the linear transformation algorithm tune of volume multiple
Volume in whole PCM material obtains the corresponding new PCM material of i-th of level of sound volume in precoding volume list;Wherein, i is positive
Integer;
Generation unit 209, if judging to have counted the last one in precoding volume list for the 6th judging unit 207
The size of data of the corresponding multiple frame data for meeting preset format of level of sound volume, according to pre-encoded file template, precoding sound
Amount list, corresponding multiple frame data for meeting preset format of each level of sound volume and each level of sound volume is corresponding meets
The size of data of multiple frame data of preset format generates pre-encoded file.
In the present embodiment, the corresponding multiple frame data for meeting preset format of each level of sound volume, Jin Erneng are firstly generated
Enough generate pre-encoded file.
It should be noted that the course of work of each unit in the present embodiment, referring to figure 3. in corresponding embodiment
Illustrate, details are not described herein.
Optionally, in another embodiment of the present invention, referring to Fig. 8, further includes:
7th judging unit 113, for judging whether there is the not sent data to be sent to set-top box;
First converting unit 109, be also used to when the 7th judging unit 113 judge it is no not sent pending to set-top box
Data are sent, by the first data conversion corresponding with audio request in PCM material at the second data for meeting preset format;
Data Integration unit 114, for judging there is the not sent number to be sent to set-top box when the 7th judging unit 113
According to data to be sent and the first data being integrated, the data after being integrated;
Third converting unit 115, for the data after integration to be converted to the third data for meeting preset format;
Third transmission unit 116, for sending set-top box for third data.
In the present embodiment, by the first data conversion corresponding with audio request in PCM material at meeting preset format
Before second data, the not sent data to be sent to set-top box are judged whether there is, it is not sent to set-top box when judging to have
Data to be sent, data to be sent and the first data are integrated, the data after being integrated, and can will be sent to machine top
Multiple Data Integrations of box are sent to set-top box at a data, i.e., send out multiple music that user requests after audio mixing synthesizes
Give set-top box.
It should be noted that the course of work of each unit in the present embodiment, referring to figure 4. in corresponding embodiment
Illustrate, details are not described herein.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (8)
1. a kind of processing method of audio, which is characterized in that be applied to server, comprising:
The audio request that receiving set up box is sent;
Judge that the corresponding pre-encoded file of the audio request whether there is in the memory of the server;Wherein, described pre-
Coding file has pre-generated;
When judging that the corresponding pre-encoded file of the audio request is present in the memory of the server, in the precoding
Frame data corresponding with the audio request are searched in file;
The frame data are sent to the set-top box;
After judging that the corresponding pre-encoded file of the audio request does not exist in the memory of the server, further includes:
Judge the pre-encoded file whether is preserved in the hard disk of the server;
When preserving the pre-encoded file in the hard disk for judging the server, the pre-encoded file is saved to described interior
It deposits;
Analyze the storage position of the level of sound volume type for including in the pre-encoded file and the corresponding frame data of each level of sound volume
It sets;
Return to the lookup frame data corresponding with the audio request in the pre-encoded file;
When not preserving the pre-encoded file in the hard disk for judging the server, judge whether preserve in the memory
The corresponding pulse code modulation PCM material of the audio request;
When judging to preserve the corresponding PCM material of the audio request in the memory, by the PCM material with the sound
Frequency requests corresponding first data conversion at the second data for meeting preset format;
The set-top box is sent by second data.
2. processing method according to claim 1, which is characterized in that when judging not preserve the sound in the memory
After frequency requests corresponding PCM material, further includes:
Judge the PCM material whether is preserved in the hard disk of the server;
When preserving the PCM material in the hard disk for judging the server, the PCM material is saved to the memory;
Return it is described by the first data conversion corresponding with the audio request in the PCM material at meeting the of preset format
Two data.
3. processing method according to claim 1, which is characterized in that the generating process of the pre-encoded file includes:
Obtain the corresponding PCM material of the audio request;
Whether the parameter value for judging the audio frequency characteristics parameter of the PCM material is default value;
When the parameter value for the audio frequency characteristics parameter for judging the PCM material is default value, acquisition precoding volume list;
It wherein, include multiple level of sound volume in the precoding volume list;
The volume in the PCM material is adjusted according to the linear transformation algorithm of volume multiple, obtains the precoding volume list
In the corresponding new PCM material of i-th of level of sound volume;
The format for converting the corresponding new PCM material of i-th of level of sound volume obtains the corresponding symbol of i-th of level of sound volume
Close multiple frame data of preset format;
Count the size of data of the corresponding multiple frame data for meeting preset format of i-th of level of sound volume;
Judge whether to count the corresponding preset format that meets of the last one described level of sound volume in the precoding volume list
The size of data of multiple frame data;
Meet preset format if judging not count the last one in the precoding volume list level of sound volume being corresponding
Multiple frame data size of data, make i=i+1, and return and the PCM element is adjusted according to the linear transformation algorithm of volume multiple
Volume in material obtains in the precoding volume list the corresponding new PCM material of i-th of level of sound volume;Wherein, i is
Positive integer;
Meet preset format if judging to have counted the last one in the precoding volume list level of sound volume being corresponding
Multiple frame data size of data, according to pre-encoded file template, the precoding volume list, each level of sound volume
The corresponding multiple frame data for meeting preset format and the corresponding multiple frames for meeting preset format of each level of sound volume
The size of data of data generates the pre-encoded file.
4. processing method according to claim 1, which is characterized in that by the PCM material with the audio request pair
Before the first data conversion answered is at the second data for meeting preset format, further includes:
Judge whether there is the data to be sent of the set-top box;
When the data to be sent for judging no set-top box, execute it is described by the PCM material with it is described
Corresponding first data conversion of audio request is at the second data for meeting preset format;
When the data to be sent for judging to have the set-top box, by the data to be sent and first data into
Row integration, the data after being integrated;
Data after the integration are converted to the third data for meeting preset format;
The set-top box is sent by the third data.
5. a kind of processing unit of audio, which is characterized in that be applied to server, comprising:
Receiving unit, the audio request sent for receiving set up box;
First judging unit, for judging that the corresponding pre-encoded file of the audio request whether there is in the server
In depositing;Wherein, the pre-encoded file has pre-generated;
Searching unit, for judging that the corresponding pre-encoded file of the audio request is present in institute when first judging unit
It states in the memory of server, frame data corresponding with the audio request is searched in the pre-encoded file;
First transmission unit, for the frame data to be sent to the set-top box;
Second judgment unit, for judging that the corresponding pre-encoded file of the audio request is not deposited when first judging unit
After being in the memory of the server, judge the pre-encoded file whether is preserved in the hard disk of the server;
First storage unit is judged to preserve described prelist in the hard disk of the server for working as the second judgment unit
Code file, saves the pre-encoded file to the memory;
Analytical unit, for analyzing the level of sound volume type for including in the pre-encoded file and the corresponding frame of each level of sound volume
The storage location of data;
The searching unit is also used to the analytical unit and analyzes the level of sound volume type for including in the pre-encoded file and every
After the storage location of the corresponding frame data of a level of sound volume, searched in the pre-encoded file corresponding with the audio request
Frame data;
Third judging unit, for when the second judgment unit judge not preserving in the hard disk of the server it is described pre-
File is encoded, judges whether preserve the corresponding pulse code modulation PCM material of the audio request in the memory;
First converting unit, for judging that preserving the audio request in the memory corresponds to when the third judging unit
PCM material, by the first data conversion corresponding with the audio request in the PCM material at meeting the second of preset format
Data;
Second transmission unit, for sending the set-top box for second data.
6. processing unit according to claim 5, which is characterized in that further include:
4th judging unit, for judging not preserving the audio request pair in the memory when the third judging unit
After the PCM material answered, judge the PCM material whether is preserved in the hard disk of the server;
Second storage unit is judged to preserve the PCM in the hard disk of the server for working as the 4th judging unit
Material saves the PCM material to the memory;
First converting unit will be described after being also used to the second storage unit preservation PCM material to the memory
The first data conversion corresponding with the audio request is at the second data for meeting preset format in PCM material.
7. processing unit according to claim 5, which is characterized in that further include:
First acquisition unit, for obtaining the corresponding PCM material of the audio request;
5th judging unit, for judging whether the parameter value of audio frequency characteristics parameter of the PCM material is default value;
Second acquisition unit, the parameter of the audio frequency characteristics parameter for judging the PCM material when the 5th judging unit
Value is default value, obtains the list of precoding volume;It wherein, include multiple level of sound volume in the precoding volume list;
Adjustment unit adjusts the volume in the PCM material for the linear transformation algorithm according to volume multiple, obtains described pre-
Encode the corresponding new PCM material of i-th of level of sound volume in volume list;
Second converting unit obtains described in i-th for converting the format of the corresponding new PCM material of i-th of level of sound volume
The corresponding multiple frame data for meeting preset format of level of sound volume;
Statistic unit, the data for counting the corresponding multiple frame data for meeting preset format of i-th of level of sound volume are big
It is small;
6th judging unit, for judging whether that counting the level of sound volume of the last one in the precoding volume list corresponds to
The multiple frame data for meeting preset format size of data;
Control unit, if judging not count the last one institute in the precoding volume list for the 6th judging unit
The size of data for stating the corresponding multiple frame data for meeting preset format of level of sound volume, makes i=i+1;
The adjustment unit is also used to after described control unit makes i=i+1, is adjusted according to the linear transformation algorithm of volume multiple
Volume in the PCM material obtains in the precoding volume list the corresponding new PCM material of i-th of level of sound volume;
Wherein, i is positive integer;
Generation unit, if judging to have counted the last one institute in the precoding volume list for the 6th judging unit
The size of data for stating the corresponding multiple frame data for meeting preset format of level of sound volume, according to pre-encoded file template, described pre-
Encode volume list, the corresponding multiple frame data for meeting preset format of each level of sound volume and each volume
The size of data of the corresponding multiple frame data for meeting preset format of grade, generates the pre-encoded file.
8. processing unit according to claim 5, which is characterized in that further include:
7th judging unit, for judging whether there is the data to be sent of the set-top box;
First converting unit, be also used to when the 7th judging unit judge no set-top box to
Data are sent, by the first data conversion corresponding with the audio request in the PCM material at meeting the second of preset format
Data;
Data Integration unit, for judging the number to be sent for having the set-top box when the 7th judging unit
According to the data to be sent and first data being integrated, the data after being integrated;
Third converting unit, for the data after the integration to be converted to the third data for meeting preset format;
Third transmission unit, for sending the set-top box for the third data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710300898.8A CN107105307B (en) | 2017-05-02 | 2017-05-02 | A kind for the treatment of method and apparatus of audio |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710300898.8A CN107105307B (en) | 2017-05-02 | 2017-05-02 | A kind for the treatment of method and apparatus of audio |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107105307A CN107105307A (en) | 2017-08-29 |
CN107105307B true CN107105307B (en) | 2019-11-05 |
Family
ID=59657521
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710300898.8A Active CN107105307B (en) | 2017-05-02 | 2017-05-02 | A kind for the treatment of method and apparatus of audio |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107105307B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108965426B (en) * | 2018-07-11 | 2021-11-02 | 深圳市东微智能科技股份有限公司 | Data processing method and device for audio system, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1867970A (en) * | 2003-10-17 | 2006-11-22 | 皇家飞利浦电子股份有限公司 | Signal encoding |
CN101707623A (en) * | 2009-11-11 | 2010-05-12 | 中兴通讯股份有限公司 | Method and device for sending files in small memory system |
CN102571757A (en) * | 2011-12-16 | 2012-07-11 | 北京视博云科技有限公司 | Method and system for providing web services |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8695053B2 (en) * | 2009-09-10 | 2014-04-08 | Jeffrey Huang | Apparatus and method for multimedia data reception, processing, routing, storage, and access using a web / cloud-computing synchronization of personal multimedia data |
CN103686210B (en) * | 2013-12-17 | 2017-01-25 | 广东威创视讯科技股份有限公司 | Method and system for achieving audio and video transcoding in real time |
-
2017
- 2017-05-02 CN CN201710300898.8A patent/CN107105307B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1867970A (en) * | 2003-10-17 | 2006-11-22 | 皇家飞利浦电子股份有限公司 | Signal encoding |
CN101707623A (en) * | 2009-11-11 | 2010-05-12 | 中兴通讯股份有限公司 | Method and device for sending files in small memory system |
CN102571757A (en) * | 2011-12-16 | 2012-07-11 | 北京视博云科技有限公司 | Method and system for providing web services |
Also Published As
Publication number | Publication date |
---|---|
CN107105307A (en) | 2017-08-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100568966C (en) | A kind of network transfer method of audio/video data | |
US11170791B2 (en) | Systems and methods for implementing efficient cross-fading between compressed audio streams | |
US9014261B2 (en) | Method and system for media file compression | |
CN104917671B (en) | Audio-frequency processing method and device based on mobile terminal | |
CN101321268B (en) | Personal media broadcasting system | |
US20070078954A1 (en) | Apparatus and method for providing high speed download service of multimedia contents | |
JP2009510966A (en) | Bitstream adaptive conversion apparatus and method to which scalable video coding technology is applied | |
CN101131816B (en) | Audio file generation method, device and digital player | |
RU2004119840A (en) | DEFINITION OF DISTRIBUTED TOPOLOGY FOR STREAMING DATA | |
CN108966197A (en) | Audio frequency transmission method, system, audio-frequence player device and computer readable storage medium based on bluetooth | |
CN107634930A (en) | The acquisition methods and device of a kind of media data | |
CN105992044A (en) | Method and system of transcoding HLS to RTMP live streaming | |
CN107613409A (en) | The processing method and processing device of multi-medium data | |
CN107105307B (en) | A kind for the treatment of method and apparatus of audio | |
CN100481958C (en) | System and method for performing signal synchronization of data streams | |
CN110225399A (en) | Streaming Media processing method, device, computer equipment and storage medium | |
CN104079949B (en) | Towards the data encapsulation method and apparatus and system of the scene adaptive of multi-screen | |
CN105451073B (en) | The transfer approach and device of MP4 video sources | |
KR20040080982A (en) | Apparatus and method for processing audio signal, and computer-readable recording media for storing computer program | |
CN106470350A (en) | Code check adaptive approach based on dynamic bit rate and device | |
CN105791964B (en) | cross-platform media file playing method and system | |
CN103139528B (en) | The processing method of a kind of audio, video data and device | |
CN109743643A (en) | The processing method and processing device of building conversational system | |
CN104506882B (en) | Internet stream media is converted into the server and its conversion method of IPTV forms | |
CN106792111A (en) | A kind of use FFMPEG interfaces record the method and device of webcast website's video |
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 |