CN108170399A - A kind of two-channel processing method and terminal - Google Patents
A kind of two-channel processing method and terminal Download PDFInfo
- Publication number
- CN108170399A CN108170399A CN201711441440.0A CN201711441440A CN108170399A CN 108170399 A CN108170399 A CN 108170399A CN 201711441440 A CN201711441440 A CN 201711441440A CN 108170399 A CN108170399 A CN 108170399A
- Authority
- CN
- China
- Prior art keywords
- sample value
- value
- difference
- sample
- time point
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/16—Sound input; Sound output
- G06F3/165—Management of the audio stream, e.g. setting of volume, audio stream path
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)
- Circuits Of Receivers In General (AREA)
- Stereophonic System (AREA)
Abstract
The embodiment of the invention discloses a kind of two-channel processing method and terminal, wherein method includes:Terminal obtains the first sample value and the second sample value in audio-frequency information, first sample value is sampled value of the left channel information in first time point of the audio-frequency information, second sample value is sampled value of the right channel information in first time point of the audio-frequency information, which is any one play time of the audio-frequency information;If first sample value and second sample value meet preset condition, which determines third sample value, opposite number of the third sample value for a sample value in second sample value and second sample value;The terminal determines the broadcasting sample value of the first time point, and the broadcasting sample value of the first time is the average value of another sample value and the third sample value in first sample value and second sample value, which is the audio information values for broadcasting.The embodiment of the present invention can be to avoid the useless audio-frequency information of acquisition.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of two-channel processing methods and terminal.
Background technology
Music is prevalent in daily life, fast development and terminal with computer technology
It is universal, more and more users can carry out music by terminal.The audio-frequency information of terminal plays is usually constructed with two sound
Road, i.e. L channel and right channel.But for certain terminals (for example, mobile phone), to believe audio there is usually one loudspeaker
Breath plays out.Since a loudspeaker cannot play left channel information and right channel information simultaneously, terminal is needed to two-channel
Audio-frequency information is handled, and after obtaining mono audio information, could successfully play the music.
At present, the processing mode of the audio-frequency information of terminal-pair two-channel is:Being averaging after left and right acoustic channels linear superposition,
I.e.:Mix (N)=(L (N)+R (N))/2.Wherein, N represents the n-th sampled point of L channel and right channel, and L (N) represents L channel
N-th sampled point value, R (N) represent right channel n-th sampled point value, Mix (N) represent audio mixing after monophonic N
The value of a sampled point.Using this processing mode, sound be likely to appear in a period of time be zero situation, that is, there is nothing
Audio-frequency information.How to avoid the problem that it is that those skilled in the art are studying to obtain useless audio-frequency information.
Invention content
The embodiment of the present invention provides a kind of two-channel processing method and terminal, can avoid obtaining useless audio letter
Breath.
In a first aspect, an embodiment of the present invention provides a kind of two-channel processing method, this method includes:
Terminal obtains the first sample value and the second sample value in audio-frequency information, which is a left side for the audio-frequency information
Channel information first time point sampled value, second sample value for the audio-frequency information right channel information this at the first time
The sampled value of point, the first time point are any one play time of the audio-frequency information;
If first sample value and second sample value meet preset condition, which determines third sample value, this
Opposite number of three sample values for a sample value in second sample value and second sample value;
The terminal determines the broadcasting sample value of the first time point, and the broadcasting sample value of the first time is first sampling point
The average value of another sample value and the third sample value in value and second sample value, the broadcasting sample value are for broadcasting
Audio information values.
Second aspect, an embodiment of the present invention provides a kind of terminal, which includes:
Acquiring unit, for obtaining the first sample value and the second sample value in audio-frequency information, which is the sound
In the sampled value of first time point, which exists the left channel information of frequency information for the right channel information of the audio-frequency information
The sampled value of first time point, the first time point are any one play time of the audio-frequency information;
First determination unit, in the case of meeting preset condition in first sample value and second sample value, really
Determine third sample value, opposite number of the third sample value for a sample value in second sample value and second sample value;
Second determination unit, for determining the broadcasting sample value of the first time point, the broadcasting sample value of the first time
For the average value of another sample value in first sample value and second sample value and the third sample value, the broadcasting sample value
For the audio information values for being used to play.
The third aspect, an embodiment of the present invention provides another terminal, including processor, input equipment, output equipment and
Memory, the processor, input equipment, output equipment and memory are connected with each other, wherein, which supports eventually for storing
End performs the application code of the above method, which is configured for the method for performing above-mentioned first aspect.
Fourth aspect, an embodiment of the present invention provides a kind of computer readable storage medium, which deposits
Computer program is contained, which includes program instruction, which makes the processor when being executed by a processor
The method for performing above-mentioned first aspect.
In the embodiment of the present invention, first, terminal judges whether the first sample value and the second sample value are width in audio-frequency information
Similar, opposite in phase sample value is spent, which is sampling of the left channel information in first time point of audio-frequency information
Value, second sample value are sampled value of the right channel information in the first time point of audio-frequency information.Then, if the first sample value
It is that amplitude is similar, sample value of opposite in phase with the second sample value, then the terminal determines that third sample value is second sample value
With the opposite number of a sample value in second sample value.The terminal is by another in first sample value and second sample value
Broadcasting sample value of the average value of sample value and the third sample value as the first time point, solve the first sample value and
The problem of broadcasting sample value obtained after being averaging after second sample value linear superposition is close to zero, can avoid obtaining useless audio
Information.
Description of the drawings
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description
Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is some embodiments of the present invention, general for this field
For logical technical staff, without creative efforts, other attached drawings are can also be obtained according to these attached drawings.
Fig. 1 is a kind of flow chart of two-channel processing method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of terminal provided in an embodiment of the present invention;
Fig. 3 is another terminal schematic diagram provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is part of the embodiment of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained without making creative work
Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " comprising " and "comprising" instruction
Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded
Body, step, operation, element, component and/or its presence or addition gathered.
It is also understood that the term used in this description of the invention is merely for the sake of the mesh for describing specific embodiment
And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singulative, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is
Refer to any combinations and all possible combinations of one or more of the associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determining " or " in response to detecting ".Similarly, phrase " if it is determined that " or
" if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true
It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In the specific implementation, the terminal described in the embodiment of the present invention is including but not limited to such as with touch sensitive surface
The mobile phone, laptop computer or tablet computer of (for example, touch-screen display and/or touch tablet) etc it is other just
Portable device.It is to be further understood that in certain embodiments, which is not portable communication device, but with touch
The desktop computer of sensing surface (for example, touch-screen display and/or touch tablet).
In discussion below, the terminal including display and touch sensitive surface is described.It is, however, to be understood that
It is that terminal can include one or more of the other physical user-interface device of such as physical keyboard, mouse and/or control-rod.
Terminal supports various application programs, such as one or more of following:Drawing application program, demonstration application journey
Sequence, word-processing application, website create application program, disk imprinting application program, spreadsheet applications, game application
Program, telephony application, videoconference application, email application, instant messaging applications, exercise
Support application program, photo management application program, digital camera application program, digital camera application program, web-browsing application
Program, digital music player application and/or video frequency player application program.
The various application programs that can be performed in terminal can use at least one public of such as touch sensitive surface
Physical user-interface device.It can adjust and/or change among applications and/or in corresponding application programs and touch sensitive table
The corresponding information shown in the one or more functions and terminal in face.In this way, the public physical structure of terminal is (for example, touch
Sensing surface) it can support the various application programs with user interface intuitive and transparent for a user.
Terminal in the embodiment of the present application can include the handheld device with music playing function (for example, mobile phone, tablet
Computer, palm PC etc.), mobile unit (for example, automobile, bicycle, electric vehicle, aircraft, ship etc.), wearable device (example
Such as smartwatch (such as iWatch), Intelligent bracelet, pedometer), intelligent robot, workshop appliance, can play music its
Its processing equipment and various forms of user equipmenies (User Equipment, UE), mobile station (Mobile station,
MS), etc..For convenience of description, terminal is referred to as in the embodiment of the present invention.
It is that the embodiment of the present invention provides a kind of schematic flow diagram of two-channel processing method, this method includes referring to Fig. 1:
S101, terminal obtain the first sample value and the second sample value in audio-frequency information.
Wherein, which is the left channel information of the audio-frequency information in the sampled value of first time point, this second
Sample value is sampled value of the right channel information in the first time point of the audio-frequency information, which is the audio-frequency information
Any one play time.
S102, the terminal determine third sample value.
If specifically, first sample value and second sample value meet preset condition, which determines third sample value,
Opposite number of the third sample value for a sample value in first sample value and second sample value.
Optionally, preset condition can be:The product of first sample value and second sample value is less than zero, and this first
The difference of the absolute value of sample value and second sample value is less than the first predetermined threshold value.If it is to be appreciated that first sample value
Meet the preset condition with second sample value, then illustrate first sample value and second sample value for amplitude is similar, phase
Opposite sample value.In this case, it is if average again using the first sample value and the second sample value are carried out linear superposition
Processing method, obtained monophonic audio signal will get useless audio signal close to zero after may be such that processing.
Optionally, which falls into 0.01 to 1 decibel of section.It is it is to be appreciated that default first
In the case that threshold value falls into 0.01 to 1 decibel of section, show the difference of first sample value and the second sample value absolute value very
Small, i.e., first sample value is similar with the second sample value amplitude.
Optionally, which can also determine third sample value by other means, below will to one way in which into
Row description.Which includes:The terminal compares the size of the first difference and the second difference, which is first sample value
With the absolute value of the difference of reference value, absolute value of second difference for second sample value and the difference of the reference value;It if should
First difference is less than second difference, then the terminal takes the opposite number of second sample value as the third sample value;If this
One difference is not less than second difference, then the terminal takes the opposite number of first sample value as three sample value.
It should be noted that the reference value plays sample value to be preferable, for reference pair ratio.It is preferable when playing sample value
When playing sample value, audio-frequency information can obtain preferable result of broadcast, and can more match user listens song demand.Therefore,
When playing sample value closer to reference value, the audio-frequency information of broadcasting get over can match user listen song demand.It is to be appreciated that
First difference shows the similarity degree of the first sample value and reference value, and the first difference is smaller, illustrates the first sample value and reference
The similarity degree of value is higher;Second difference shows the similarity degree of the second sample value and reference value, and the second difference is smaller, explanation
The similarity degree of second sample value and reference value is higher.By comparing the size of the first difference and the second difference, the can be obtained
The size of the similarity degree and the similarity degree of the second sample value and reference value of one sample value and reference value.Then, terminal retains
The higher sample value with reference value similarity degree takes the opposite number of the sample value relatively low with reference value similarity degree as third sample
Point value so that the broadcasting sample value finally obtained is closer to reference value.Therefore, this method can avoid obtaining garbage
Simultaneously so that the audio-frequency information of broadcasting more matched user listens song demand.
Optionally, which is preset preferable broadcasting sample value.Optionally, it can be solid which, which plays sample value,
A fixed value, such as 40 decibels.For example, if the first sample value is 60 decibels, the second sample value is -30 decibels.That
, absolute value of first difference for the difference of 40 decibels of 60 decibels of first sample value and reference value, as 20 decibels, second is poor
It is worth the absolute value of the difference for 40 decibels of -30 decibels of first sample value and reference value, as 70 decibels.First difference 20 is divided
Shellfish is less than 70 decibels of second difference, illustrates that the similarity degree of the first sample value and reference value is more than the second sample value and reference value
Similarity degree.Therefore, which takes the opposite number of second sample value as the third sample value, i.e. third sample value is should
30 decibels of the opposite number of second -30 decibels of sample value.
Optionally, average value of the reference value for the broadcasting sample value at least one time point, at least one time
Point and the interval of the first time point are less than predetermined threshold value.It should be noted that the predetermined threshold value is between a smaller time
Every, such as 1 second.At least one time point and the interval of the first time point are represented less than predetermined threshold value, when this is at least one
Between time point for closing on for the first time point of point.It is to be appreciated that the reference value is the broadcasting at least one time point
The average value of sample value shows that the reference value represents being averaged for the broadcasting sample value at the time point that the first time point is closed on
Value.Using the setting means of this reference value, can cause the broadcasting sample value of the first time point as close possible to this
The broadcasting sample value at the time point that one time point closed on, so that according to the audio-frequency information of broadcasting sample value broadcasting more
Smoothness, the impression of user's audition music are more comfortable.
Optionally, before the size for comparing the first difference and the second difference in the terminal, which obtains residing for itself
The volume value of environment;The terminal determines the local environment according to the volume value and default correspondence of the terminal local environment
The corresponding relating value of volume value, for the relating value determined as above-mentioned reference value, the default correspondence is multiple volume values
With the correspondence of multiple relating values, each volume value is corresponding with respective relating value in multiple volume value.Need what is illustrated
It is that the volume value of local environment is one of important factor in order of volume value of music of terminal plays.In most cases, when
When ambient enviroment is more noisy, the volume value of the music of terminal plays is higher, when ambient enviroment is more quiet, terminal plays
The volume value of music is relatively low.It, can be while avoiding obtaining garbage so that play using the setting means of the reference value
Audio-frequency information more adapt to environment residing for user, match user listens song demand.
S103, the terminal determine the broadcasting sample value of the first time point.
Wherein, the broadcasting sample value of the first time is another sample value in first sample value and second sample value
With the average value of the third sample value.Specifically, the broadcasting sample value is the audio information values for broadcasting.
Next, the side of broadcasting sample value is obtained according to the mode of three kinds of different selection third sample values by illustrating
Case.It should be noted that below in institute's illustrated example, the first sample value and the second sample value meet preset condition.
The first scheme, the mode of the selection third sample value are:The third sample value for first sample value and this
The opposite number of a sample value in two sample values.For example, first sample value is 30 decibels, which is -32 decibels,
Then opposite number of the third sample value for a sample value in first sample value and second sample value.Assuming that choose third sample
Point value is the opposite number of 30 decibels of first sample value, i.e., third sample value is -30 decibels.The broadcasting sample value of the first time
For the average value of another sample value in first sample value and second sample value and the third sample value, the i.e. first time
Average value of the broadcasting sample value for second sample value and the third sample value, obtain the broadcasting sample value of first time for-
31 decibels.It is another it is assumed that choosing the opposite number that third sample value is -32 decibels of second sample value, i.e. third sample value is 32
Decibel.The broadcasting sample value of the first time is another sample value in first sample value and second sample value and the third
Average value of the broadcasting sample value of the average value of sample value, the i.e. first time for first sample value and the third sample value,
The broadcasting sample value for obtaining first time is 31 decibels.As can be seen that choose what third sampling point was worth to using first way
Play sample value can relatively the first sample value or the second sample value, can be to avoid obtaining useless audio-frequency information.
Second scheme, the mode of the selection third sample value include:The terminal compares the first difference and the second difference
Size, absolute value of first difference for first sample value and the difference of reference value, second difference are second sample value
With the absolute value of the difference of the reference value;If first difference is less than second difference, which takes second sample value
Opposite number is as the third sample value;If first difference is not less than second difference, which takes first sample value
Opposite number is as three sample value.Wherein, which is preset fixed preferable broadcasting sample value.
Assuming that reference value is 45 decibels, the first sample value is 50 decibels, and the second sample value is -35 decibels.So, first is poor
Be worth the absolute value of the difference for 45 decibels of 50 decibels of first sample value and reference value, as 5 decibels, the second difference for this first
The absolute value of the difference of 45 decibels of -35 decibels of sample value and reference value, as 80 decibels.5 decibels of first difference be less than this
Two 80 decibels of differences, therefore, which takes the opposite number of second sample value, and as the third sample value, i.e. third sample value is
35 decibels of the opposite number of -35 decibels of second sample value.The broadcasting sample value of the first time for first sample value and this
The average value of another sample value and the third sample value in two sample values, i.e. the broadcasting sample value of the first time for this first
The average value of 35 decibels of 50 decibels of sample value and third sample value, the broadcasting sample value for obtaining first time is 42.5 decibels.
As can be seen that using the second way choose the broadcasting sample value that is worth to of third sampling point can relatively reference value, due to ginseng
It examines and plays sample value for ideal, this method can be while avoiding obtaining garbage so that the audio-frequency information of broadcasting is more
Matching user's listens song demand.
The third scheme, the mode of the selection third sample value include:The terminal compares the first difference and the second difference
Size, absolute value of first difference for first sample value and the difference of reference value, second difference are second sample value
With the absolute value of the difference of the reference value;If first difference is less than second difference, which takes second sample value
Opposite number is as the third sample value;If first difference is not less than second difference, which takes first sample value
Opposite number is as three sample value.Average value of the reference value for the broadcasting sample value at least one time point, this is at least
One time point and the interval of the first time point are less than predetermined threshold value.
Assuming that the first sample value is 80 decibels, the second sample value is -82 decibels, and at least one time point of selection is somebody's turn to do
It is 75 decibels, 86 decibels, 91 decibels to play sample value.The reference value is averaged for the broadcasting sample value at least one time point
Value, the i.e. reference value are 84 decibels.So, the first difference is the difference of 84 decibels of 80 decibels of first sample value and reference value
Absolute value, as 4 decibels, absolute value of second difference for the difference of 84 decibels of -82 decibels of first sample value and reference value, i.e.,
It is 166 decibels.4 decibels of first difference is less than 166 decibels of second difference, and therefore, which takes the phase of second sample value
Anti- number is 82 decibels of the opposite number of -82 decibels of second sample value as the third sample value, i.e. third sample value.This first when
Between broadcasting sample value being averaged for another sample value in first sample value and second sample value and the third sample value
The average value that value, i.e. the broadcastings sample value of the first time are 80 decibels of first sample value with 82 decibels of the third sample value,
The broadcasting sample value for obtaining first time is 81 decibels.As can be seen that choose what third sampling point was worth to using the second way
Play sample value can relatively reference value, due to the reference value being averaged for the broadcasting sample value at least one time point
Value, the broadcasting sample at time point that the broadcasting sample value of the first time point can be caused to be closed on as close possible to the first time point
Point value, so that more smooth according to the audio-frequency information that the broadcasting sample value plays, the impression of user's audition music is more
Comfortably.
Optionally, which can also determine the broadcasting sample value by other means, below will to another way into
Row description.Which includes:The terminal compares the size of the first difference and the second difference, which is first sample value
With the absolute value of the difference of reference value, absolute value of second difference for second sample value and the difference of the reference value;It if should
First difference is less than second difference, then plays sample value M3For:
M3=M1× 70%+ (- M2) × 30%
If first difference is not less than second difference, broadcasting sample value M3For:
M3=M2× 70%+ (- M1) × 30%
Wherein, M1For first sample value, M2For second sample value.It should be noted that by comparing the first difference and
The size of second difference can obtain the similar of the similarity degree of the first sample value and reference value and the second sample value and reference value
The size of degree.Then, terminal is chosen with the 70% of the higher sample value of reference value similarity degree, with reference value similarity degree compared with
The 30% of the opposite number of low sample value, then both take and as playing sample value.Optionally, with reference value similarity degree compared with
Ratio shared by high sample value can be adjusted according to actual conditions.Which causes higher with reference value similarity degree
Sample value provides more audio-frequency informations so that obtained broadcasting sample value is more nearly reference value.Therefore, this method can be
While avoiding obtaining garbage so that the audio-frequency information of broadcasting more matched user listens song demand.
As an example it is assumed that reference value is 45 decibels, the first sample value is 50 decibels, and the second sample value is -35 decibels.That
, absolute value of first difference for the difference of 45 decibels of 50 decibels of first sample value and reference value, as 5 decibels, second is poor
It is worth the absolute value of the difference for 45 decibels of -35 decibels of first sample value and reference value, as 80 decibels.First difference 5 is divided
Shellfish is less than 80 decibels of second difference, therefore, broadcasting sample value M3For:
M3=50 × 70%+ (- (35)) × 30%=45.5
As can be seen that compared to above-mentioned second scheme, this determines to play the broadcasting sampling point that the mode of sample value obtains
The closer reference value of value.
In method shown in Fig. 1, first, terminal judge in audio-frequency information the first sample value and the second sample value whether be
Amplitude is similar, the sample value of opposite in phase, which is left channel information the adopting in first time point of audio-frequency information
Sample value, second sample value are sampled value of the right channel information in the first time point of audio-frequency information.Then, if the first sampling point
Value and the second sample value are that amplitude is similar, sample value of opposite in phase, then the terminal determines that third sample value is second sampling point
The opposite number of a sample value in value and second sample value.The terminal will be another in first sample value and second sample value
Broadcasting sample value of the average value of a sample value and the third sample value as the first time point, solves the first sample value
Be averaging after the second sample value linear superposition after obtained broadcasting sample value close to zero the problem of, can avoid obtaining useless sound
Frequency information.
The foregoing describe the method for the embodiment of the present invention, the device of the embodiment of the present invention described further below.
It is a kind of schematic diagram of terminal provided in an embodiment of the present invention referring to Fig. 2.The terminal 20 includes:
Acquiring unit 201, for obtaining the first sample value and the second sample value in audio-frequency information, first sample value is is somebody's turn to do
The left channel information of audio-frequency information is in the sampled value of first time point, right channel information of second sample value for the audio-frequency information
In the sampled value of first time point, which is any one play time of the audio-frequency information.
First determination unit 202, in the case of meeting preset condition in first sample value and second sample value,
Determine third sample value, opposite number of the third sample value for a sample value in second sample value and second sample value.
Second determination unit 203, for by another sample value in second sample value and second sample value and this
Broadcasting sample value of the average value of three sample values as the first time point, the broadcasting sample value are the audio-frequency information for output
Value.
In another optional scheme, which is less than for the product of first sample value and second sample value
Zero, and the difference of the absolute value of first sample value and second sample value is less than the first predetermined threshold value.It if it is to be appreciated that should
First sample value and second sample value meet the preset condition, then illustrate that first sample value and second sample value are amplitude
Similar, opposite in phase sample value.In this case, if linearly folded using by the first sample value and the second sample value
Add again average processing method, may be such that the monophonic audio signal obtained after processing close to zero, it is useless by getting
Audio signal.
In another optional scheme, which falls into 0.01 to 1 decibel of section.It is understood that
It is, in the case where the first predetermined threshold value falls into 0.01 to 1 decibel of section, to show first sample value and second sample value
The difference very little of absolute value, i.e. first sample value are similar with the second sample value amplitude.
In another optional scheme, which is specifically used for:Compare the first difference and the second difference
Size, absolute value of first difference for first sample value and the difference of reference value, second difference are second sample value
With the absolute value of the difference of the reference value;If first difference be less than second difference, first determination unit take this second
The opposite number of sample value is as the third sample value;If first difference is not less than second difference, first determination unit
The opposite number of first sample value is taken as three sample value.It should be noted that the reference value plays sample value to be preferable.
When playing sample value as preferable broadcasting sample value, audio-frequency information can obtain preferable result of broadcast, can more match use
Listen song demand in family.Therefore, when playing sample value closer to reference value, the audio-frequency information of broadcasting get over can match user listen song
Demand.It is to be appreciated that the first difference shows the similarity degree of the first sample value and reference value, the first difference is smaller, says
The similarity degree of bright first sample value and reference value is higher;Second difference shows the second sample value journey similar to reference value
Degree, the second difference is smaller, illustrates that the similarity degree of the second sample value and reference value is higher.It is poor by comparing the first difference and second
The size of value can obtain the similarity degree of the first sample value and reference value and the similarity degree of the second sample value and reference value
Size.Then, terminal reservation and the higher sample value of reference value similarity degree, take the sample value relatively low with reference value similarity degree
Opposite number as third sample value so that the broadcasting sample value finally obtained is closer to reference value.Therefore, this method can be
While avoiding obtaining garbage so that the audio-frequency information of broadcasting more matched user listens song demand.
In another optional scheme, average value of the reference value for the broadcasting sample value at least one time point,
At least one time point and the distance of the first time point are less than predetermined threshold value.It should be noted that the predetermined threshold value is one
A smaller time interval, such as 1 second.At least one time point and the interval of the first time point are less than predetermined threshold value generation
Table, at least one time point are the time point that the first time point is closed on.It is to be appreciated that the reference value is at least one
The average value of the broadcasting sample value at time point shows that the reference value represents the broadcasting at the time point that the first time point is closed on
The average value of sample value.Using the setting means of this reference value, the broadcasting sample value of the first time point can be caused to use up
The broadcasting sample value at the time point that the first time point is closed on is may be close to, so that being somebody's turn to do according to what the broadcasting sample value played
Audio-frequency information is more smooth, and the impression of user's audition music is more comfortable.
It should be noted that realizing for each unit can also be retouched to should refer to the corresponding of embodiment of the method shown in FIG. 1
It states.
In terminal shown in Fig. 2, first, terminal 20 judges in audio-frequency information whether are the first sample value and the second sample value
For amplitude is similar, sample value of opposite in phase, first sample value for audio-frequency information left channel information in first time point
Sampled value, second sample value are sampled value of the right channel information in the first time point of audio-frequency information.Then, if the first sample
Point value and the second sample value are that amplitude is similar, sample value of opposite in phase, then the terminal 20 determine third sample value for this second
The opposite number of a sample value in sample value and second sample value.The terminal 20 is by first sample value and second sample value
In another sample value and the third sample value broadcasting sample value of the average value as the first time point, solve first
The problem of broadcasting sample value obtained after being averaging after sample value and the second sample value linear superposition is close to zero can avoid obtaining nothing
Audio-frequency information.
It is the schematic diagram of another terminal provided in an embodiment of the present invention referring to Fig. 3.Terminal 30 in the present embodiment can be with
Including:One or more processors 301;One or more input equipments 302, one or more output equipments 303 and memory
303.Above-mentioned processor 301, input equipment 302, output equipment 303 and memory 304 are connected by bus 305.Memory 302
For storing instruction, processor 301 is used to perform the instruction of the storage of memory 302.
Wherein, processor 301 is used to call the code stored in memory 302 to perform following operation:
First, the first sample value and the second sample value in audio-frequency information are obtained, which is the audio-frequency information
Left channel information first time point sampled value, second sample value for the audio-frequency information right channel information this first when
Between the sampled value put, which is any one play time of the audio-frequency information;The input equipment 302 can be
Communication interface.
Then, if first sample value and second sample value meet preset condition, it is determined that third sample value, the third
Opposite number of the sample value for a sample value in first sample value and second sample value;
Then, it is determined that the broadcasting sample value of the first time point, the broadcasting sample value of the first time is first sampling point
The average value of another sample value and the third sample value in value and second sample value, the broadcasting sample value are for broadcasting
Audio information values.
In another optional scheme, which is less than for the product of first sample value and second sample value
Zero, and the difference of the absolute value of first sample value and second sample value is less than the first predetermined threshold value.It if it is to be appreciated that should
First sample value and second sample value meet the preset condition, then illustrate that first sample value and second sample value are amplitude
Similar, opposite in phase sample value.In this case, if linearly folded using by the first sample value and the second sample value
Add again average processing method, may be such that the monophonic audio signal obtained after processing close to zero, it is useless by getting
Audio signal.
In another optional scheme, which falls into 0.01 to 1 decibel of section.It is understood that
It is, in the case where the first predetermined threshold value falls into 0.01 to 1 decibel of section, to show first sample value and second sample value
The difference very little of absolute value, i.e. first sample value are similar with the second sample value amplitude.
In another optional scheme, which determines third sample value, specially:Compare the first difference and
The size of second difference, first difference are first sample value and the difference of reference value, which is second sampling point
The difference of value and the reference value;If first difference is less than second difference, which takes the opposite number of second sample value
As the third sample value;If first difference is not less than second difference, which takes the opposite number of first sample value
As three sample value.It should be noted that the reference value plays sample value to be preferable.It is played when playing sample value to be preferable
During sample value, audio-frequency information can obtain preferable result of broadcast, and can more match user listens song demand.Therefore, when broadcasting
When setting-out point value is closer to reference value, the audio-frequency information of broadcasting get over can match user listen song demand.It is to be appreciated that first
Difference shows the similarity degree of the first sample value and reference value, and the first difference is smaller, illustrates the first sample value and reference value
Similarity degree is higher;Second difference shows the similarity degree of the second sample value and reference value, and the second difference is smaller, illustrates second
The similarity degree of sample value and reference value is higher.By comparing the first difference and the size of the second difference, the first sample can be obtained
The size of the similarity degree and the similarity degree of the second sample value and reference value of point value and reference value.Then, terminal retains and joins
The higher sample value of value similarity degree is examined, takes the opposite number of the sample value relatively low with reference value similarity degree as third sampling point
Value so that the broadcasting sample value finally obtained is closer to reference value.Therefore, this method can avoid obtaining the same of garbage
When so that the audio-frequency information of broadcasting more matched user listens song demand.
In another optional scheme, average value of the reference value for the broadcasting sample value at least one time point,
At least one time point and the distance of the first time point are less than predetermined threshold value.It should be noted that the predetermined threshold value is one
A smaller time interval, such as 1 second.At least one time point and the interval of the first time point are less than predetermined threshold value generation
Table, at least one time point are the time point that the first time point is closed on.It is to be appreciated that the reference value is at least one
The average value of the broadcasting sample value at time point shows that the reference value represents the broadcasting at the time point that the first time point is closed on
The average value of sample value.Using the setting means of this reference value, the broadcasting sample value of the first time point can be caused to use up
The broadcasting sample value at the time point that the first time point is closed on is may be close to, so that being somebody's turn to do according to what the broadcasting sample value played
Audio-frequency information is more smooth, and the impression of user's audition music is more comfortable.
It should be noted that realizing for each operation can also be retouched to should refer to the corresponding of embodiment of the method shown in FIG. 1
It states.
In terminal shown in Fig. 3, first, terminal 30 judges in audio-frequency information whether are the first sample value and the second sample value
For amplitude is similar, sample value of opposite in phase, first sample value for audio-frequency information left channel information in first time point
Sampled value, second sample value are sampled value of the right channel information in the first time point of audio-frequency information.Then, if the first sample
Point value and the second sample value are that amplitude is similar, sample value of opposite in phase, then the terminal 30 determine third sample value for this second
The opposite number of a sample value in sample value and second sample value.The terminal 30 is by first sample value and second sample value
In another sample value and the third sample value broadcasting sample value of the average value as the first time point, solve first
The problem of broadcasting sample value obtained after being averaging after sample value and the second sample value linear superposition is close to zero can avoid obtaining nothing
Audio-frequency information.
It should be appreciated that in embodiments of the present invention, alleged processor 301 can be central processing unit (Central
Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital
Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit,
ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic
Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at
It can also be any conventional processor etc. to manage device.
Input equipment 302 can include Trackpad, fingerprint and adopt sensor (for acquiring the finger print information of user and fingerprint
Directional information), microphone, communication interface etc., output equipment 303 can include display (LCD etc.), loud speaker, communication interface
Deng.
The memory 304 can include read-only memory and random access memory, and to processor 301 provide instruction and
Data.The a part of of memory 304 can also include nonvolatile RAM.For example, memory 304 can also be deposited
Store up the information of device type.
In the specific implementation, processor 301, input equipment 302, the output equipment 303 described in the embodiment of the present invention can
Perform the realization described in the first embodiment and second embodiment of the method for two-channel processing provided in an embodiment of the present invention
Mode also can perform the realization method of the described terminal of the embodiment of the present invention, and details are not described herein.
A kind of chip system is provided in another embodiment of the invention, which includes at least one processor,
Memory and interface circuit, the memory, the transceiver and at least one processor are interconnected by circuit, this is at least one to deposit
Instruction is stored in reservoir;When the instruction is performed by the processor, the method for embodiment illustrated in fig. 1 is achieved.
A kind of computer program product is provided in another embodiment of the embodiment of the present invention, when the computer program product
When being run in terminal, the method for embodiment illustrated in fig. 1 is achieved.
A kind of computer readable storage medium is provided in another embodiment of the invention, the computer readable storage medium
Computer program is stored with, the method that embodiment illustrated in fig. 1 is realized when which is executed by processor.
The computer readable storage medium can be the internal storage unit of the terminal described in aforementioned any embodiment, example
Such as the hard disk or memory of terminal.The computer readable storage medium can also be the External memory equipment of the terminal, such as
The plug-in type hard disk being equipped in the terminal, intelligent memory card (Smart Media Card, SMC), secure digital (Secure
Digital, SD) card, flash card (Flash Card) etc..Further, the computer readable storage medium can also be wrapped both
The internal storage unit for including the terminal also includes External memory equipment.The computer readable storage medium is described for storing
Other programs and data needed for computer program and the terminal.The computer readable storage medium can be also used for temporarily
When store the data that has exported or will export.
Those of ordinary skill in the art may realize that each exemplary lists described with reference to the embodiments described herein
Member and algorithm steps can be realized with the combination of electronic hardware, computer software or the two, in order to clearly demonstrate hardware
With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This
A little functions are performed actually with hardware or software mode, specific application and design constraint depending on technical solution.Specially
Industry technical staff can realize described function to each specific application using distinct methods, but this realization is not
It is considered as beyond the scope of this invention.
It is apparent to those skilled in the art that for convenience of description and succinctly, the end of foregoing description
End and the specific work process of unit can refer to the corresponding process in preceding method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed terminal and method can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only
Only a kind of division of logic function can have other dividing mode in actual implementation, such as multiple units or component can be tied
It closes or is desirably integrated into another system or some features can be ignored or does not perform.In addition, shown or discussed phase
Coupling, direct-coupling or communication connection between mutually can be INDIRECT COUPLING or the communication by some interfaces, device or unit
Connection or electricity, the connection of mechanical or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit
The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the embodiment of the present invention
Purpose.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit is individually physically present or two or more units integrate in a unit.It is above-mentioned integrated
The form that hardware had both may be used in unit is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is independent product sale or uses
When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme of the present invention is substantially
The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products
It embodies, which is stored in a storage medium, is used including some instructions so that a computer
Equipment (can be personal computer, server or the network equipment etc.) performs the complete of each embodiment the method for the present invention
Portion or part steps.And aforementioned storage medium includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace
It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right
It is required that protection domain subject to.
Claims (10)
1. a kind of two-channel processing method, which is characterized in that including:
Terminal obtains the first sample value and the second sample value in audio-frequency information, and first sample value is a left side for the audio-frequency information
Channel information first time point sampled value, second sample value for the audio-frequency information right channel information described the
The sampled value at one time point, the first time point are any one play time of the audio-frequency information;
If first sample value and second sample value meet preset condition, the terminal determines third sample value, institute
State opposite number of the third sample value for a sample value in first sample value and second sample value;
The terminal determines the broadcasting sample value of the first time point, and the broadcasting sample value of the first time is described first
The average value of another sample value and the third sample value in sample value and second sample value, the broadcasting sample value are
For the audio information values of broadcasting.
2. according to the method described in claim 1, it is characterized in that, the preset condition includes:
The product of first sample value and second sample value is less than zero, and first sample value and second sampling point
The difference of the absolute value of value is less than the first predetermined threshold value.
3. according to the method described in claim 2, it is characterized in that, first predetermined threshold value falls into 0.01 to 1 decibel of area
In.
4. according to claim 1-3 any one of them methods, which is characterized in that the terminal determines third sample value, including:
The terminal compares the size of the first difference and the second difference, and first difference is first sample value and reference value
Difference, difference of second difference for second sample value and the reference value;
If first difference is less than second difference, the terminal is taken described in the opposite number conduct of second sample value
Third sample value;
If first difference is not less than second difference, the terminal takes the opposite number of first sample value as the
Three sample value.
5. according to the method described in claim 4, it is characterized in that, the reference value is the broadcasting at least one time point
The average value of sample value, at least one time point and the interval of the first time point are less than predetermined threshold value.
6. a kind of two-channel processing terminal, which is characterized in that including:
Acquiring unit, for obtaining the first sample value and the second sample value in audio-frequency information, first sample value is the sound
The left channel information of frequency information is in the sampled value of first time point, right channel letter of second sample value for the audio-frequency information
The sampled value in first time point is ceased, the first time point is any one play time of the audio-frequency information;
First determination unit, in the case of meeting preset condition in first sample value and second sample value, really
Determine third sample value, the third sample value in second sample value and second sample value sample value it is opposite
Number;
Second determination unit, for determining the broadcasting sample value of the first time point, the broadcasting sample value of the first time
It is described to broadcast for the average value of another sample value in first sample value and second sample value and the third sample value
Setting-out point value is the audio information values for broadcasting.
7. terminal according to claim 6, which is characterized in that the preset condition is first sample value and described the
The product of two sample values is less than zero, and the difference of the absolute value of first sample value and second sample value is less than first and presets
Threshold value.
8. the terminal described according to claim 6 or 7, which is characterized in that first determination unit is specifically used for:
Compare the size of the first difference and the second difference, first difference is the difference of first sample value and reference value
Absolute value, absolute value of second difference for second sample value and the difference of the reference value;
If first difference is less than second difference, first determination unit takes the opposite number of second sample value
As the third sample value;
If first difference is not less than second difference, first determination unit takes the opposite of first sample value
Number is as three sample value.
9. terminal according to claim 6, which is characterized in that the reference value is the broadcasting at least one time point
The average value of sample value, at least one time point and the distance of the first time point are less than predetermined threshold value.
10. a kind of computer readable storage medium, which is characterized in that the computer storage media is stored with computer program,
The computer program includes program instruction, and described program instruction makes the processor perform such as right when being executed by a processor
It is required that 1-5 any one of them methods.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711441440.0A CN108170399B (en) | 2017-12-26 | 2017-12-26 | Dual-channel processing method and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711441440.0A CN108170399B (en) | 2017-12-26 | 2017-12-26 | Dual-channel processing method and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108170399A true CN108170399A (en) | 2018-06-15 |
CN108170399B CN108170399B (en) | 2021-04-30 |
Family
ID=62521724
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711441440.0A Active CN108170399B (en) | 2017-12-26 | 2017-12-26 | Dual-channel processing method and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108170399B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1380751A (en) * | 1995-08-31 | 2002-11-20 | 新日本制铁株式会社 | Digital data coding device and method |
US20080205676A1 (en) * | 2006-05-17 | 2008-08-28 | Creative Technology Ltd | Phase-Amplitude Matrixed Surround Decoder |
CN102113315A (en) * | 2008-07-29 | 2011-06-29 | Lg电子株式会社 | Method and apparatus for processing audio signal |
CN102264026A (en) * | 2010-05-25 | 2011-11-30 | 晨星软件研发(深圳)有限公司 | audio processing device and audio processing method |
CN106303896A (en) * | 2016-09-30 | 2017-01-04 | 北京小米移动软件有限公司 | The method and apparatus playing audio frequency |
-
2017
- 2017-12-26 CN CN201711441440.0A patent/CN108170399B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1380751A (en) * | 1995-08-31 | 2002-11-20 | 新日本制铁株式会社 | Digital data coding device and method |
US20080205676A1 (en) * | 2006-05-17 | 2008-08-28 | Creative Technology Ltd | Phase-Amplitude Matrixed Surround Decoder |
CN102113315A (en) * | 2008-07-29 | 2011-06-29 | Lg电子株式会社 | Method and apparatus for processing audio signal |
CN102264026A (en) * | 2010-05-25 | 2011-11-30 | 晨星软件研发(深圳)有限公司 | audio processing device and audio processing method |
CN106303896A (en) * | 2016-09-30 | 2017-01-04 | 北京小米移动软件有限公司 | The method and apparatus playing audio frequency |
Also Published As
Publication number | Publication date |
---|---|
CN108170399B (en) | 2021-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108733342B (en) | Volume adjusting method, mobile terminal and computer readable storage medium | |
CN108521521B (en) | Volume adjusting method, mobile terminal and computer readable storage medium | |
EP2138927B1 (en) | Haptic effect provisioning for a mobile communication terminal | |
CN108174031B (en) | Volume adjusting method, terminal equipment and computer readable storage medium | |
CN106201430A (en) | A kind of method of volume adjusting and electronic equipment | |
CN107193598A (en) | One kind application startup method, mobile terminal and computer-readable recording medium | |
CN109361994A (en) | Speaker control method, mobile terminal and computer readable storage medium | |
CN107885479A (en) | A kind of method for regulation of sound volume, terminal device and computer-readable medium | |
CN105895126A (en) | Method and apparatus for indicating and controlling playing audio/audio and video data | |
CN107547748A (en) | A kind of picture management method, terminal and computer-readable recording medium | |
CN109756818A (en) | Dual microphone noise-reduction method, device, storage medium and electronic equipment | |
CN107247539A (en) | A kind of information displaying method and device, computer installation and readable storage medium storing program for executing | |
EP2846239A1 (en) | Apparatus and method for executing function in electronic device | |
CN110086941B (en) | Voice playing method and device and terminal equipment | |
US20170212876A1 (en) | Method and Apparatus for Editing Audio File | |
CN112286481A (en) | Audio output method and electronic equipment | |
CN110491419B (en) | Playing control method, system and terminal equipment | |
US20150063577A1 (en) | Sound effects for input patterns | |
CN107872573B (en) | Alarm clock setting method and terminal | |
CN106658232B (en) | The method and electric terminal of label editing | |
CN107864295A (en) | Call control method, mobile terminal and computer-readable recording medium | |
CN109040912A (en) | Plug-hole processing method and Related product | |
CN108021301A (en) | A kind of volume adjusting method, terminal device and computer-readable recording medium | |
CN111613246A (en) | Audio classification prompting method and related equipment | |
CN107302617A (en) | A kind of data managing method and terminal |
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 | ||
TR01 | Transfer of patent right |
Effective date of registration: 20221220 Address after: 201203 1st floor, building 1, Lane 36, Xuelin Road, Pudong New Area Free Trade Zone, Shanghai Patentee after: SHANGHAI TRANSSION INFORMATION TECHNOLOGY Ltd. Address before: Room 922 / 926, block a, No.1 Lane 399, shengxia Road, Pudong New Area pilot Free Trade Zone, Shanghai 201203 Patentee before: SHANGHAI SPREADRISE COMMUNICATION TECHNOLOGY Ltd. |
|
TR01 | Transfer of patent right |