The content of the invention
Support to play the problem of audio quality is not high for acquiescence, it is necessary to a kind of adaptive adjustment sample rate and sampling essence
The method of degree.
Set forth herein a kind of method that Android system improves audio recording and reproducing quality, comprise the following steps:According to current setting
Audio types, judge whether that variable sampling rate and sampling precision can be carried out, when being judged as YES, then obtain be currently needed for system change
The sample rate and sampling precision information for the audio track that sample rate and precision are supported;
Above-mentioned sample rate and sampling precision are compared with current Audio Mixing Recorder corresponding informance, if it is confirmed that differing
Cause, then destroy present video mixer, Audio Mixing Recorder is re-created according to the audio stream sample rate and sampling precision that compared,
And the post processing link before being exported;Audio output is again first then according to the sample rate and sampling precision of this output demand
The a whole set of audio output path of beginningization.
Further, the newly-built audio track of step is also included before obtaining sample rate and sampling precision makes its compatible original sound
The interface of frequency rail, audio sample rate and the sampling precision limitation originally supported are modified.
Further, if whether variable sampling rate can be carried out and sampling precision is judged as NO, audio is directly entered system
Exported after the processing of the Audio Mixing Recorder of default sample rate and sampling precision by audio hardware level of abstraction.
Further, judge whether present video output is set consistent with sampling precision information according to audio track sample rate,
Sample rate and the sampling of audio will be exported to audio output, audio hardware level of abstraction and audio mixing rail notice if inconsistent
Precision, allow audio output, audio hardware level of abstraction and audio mixing rail to adjust accordingly, pass through currently valid sound if consistent
Exported after the processing of frequency mixer.
Specifically, the post processing link is mixer mixing track and sound effect control.
A kind of device for improving Android system audio recording and reproducing quality, including following module:It is judge module, acquisition module, right
Than module, destroy creation module and output module;The judge module is used for the audio types according to current setting, judges whether
Audio system variable sampling rate and sampling precision can be carried out, acquisition module is used for whether audio system variable sampling rate can be carried out
When being judged as YES with sampling precision, sample rate and the sampling of the audio track for being currently needed for system variable sampling rate and precision support are obtained
Precision information;
Contrast module is used to above-mentioned sample rate and sampling precision be compared with current Audio Mixing Recorder corresponding informance,
Creation module is destroyed to be used to destroy present video mixer when comparing inconsistent, and according to the audio stream sample rate that compared and
Sampling precision re-creates Audio Mixing Recorder, then the post processing link before being exported;Output module is used for according to this output
The sample rate and sampling precision of demand, reinitialize a whole set of audio output path.
Further, in addition to input module, the input module make its compatible original audio for newly-built audio track
The interface of rail, audio sample rate and the sampling precision limitation originally supported are modified.
Further, the output module is additionally operable to whether variable sampling rate can be being carried out and sampling precision is judged as NO
When, allow audio to be directly entered after the Audio Mixing Recorder processing of system default sample rate and sampling precision by audio hardware level of abstraction
Exported.
Further, judge module is additionally operable to judge that present video exports according to audio track sample rate and sampling precision information
Whether consistent set;
Also include notification module, the notification module is used for when it is inconsistent that audio output, which is set, to audio output, sound
Frequency hardware abstraction layer and audio mixing rail notice will export the sample rate and sampling precision of audio;
Also include setting adjusting module, the setting adjusting module is used for audio output, audio hardware level of abstraction and mixed
Track adjusts accordingly;
Output module is additionally operable to export after handling by currently valid Audio Mixing Recorder when audio output sets consistent.
Specifically, the post processing link for destroying creation module progress is mixer mixing track and sound effect control.
Prior art is different from, the idiographic flow of scheme of the present invention is defeated by extending the music type more supported
Enter, enter the variable sampling rate and Variable sampling precision of fashionable progress dynamic self-adapting in different voice data streams, work as Audio Mixing Recorder
With present video it is inconsistent when destroy and Audio Mixing Recorder and create new Audio Mixing Recorder, then different voice data streams are synthesized
After export.The effect that Android system acquiescence supports the limitation constraint of sample rate precision of shaking off is served, has reached raising Android
The effect of system audio recording playback quality, solve the problems, such as that audio quality is not high in the prior art.
Embodiment
To describe the technology contents of technical scheme, construction feature, the objects and the effects in detail, below in conjunction with specific reality
Apply example and coordinate accompanying drawing to be explained in detail.
As shown in Figure 1, it is shown that the original audio system of android system exports block diagram, is shown in figure
AudioClient is the external interface that Android system is acquired audio signal;AudioFlinger is the sound in Android system
Frequency management service, it is the main tool for handling audio;AudioOutput is audio output, is responsible for carrying out the audio handled
Output operation.From the figure, it can be seen that Android system is by AudioClient, by different tracks (AudioTrack, and at most
32 tracks can be supported) the audio input signal collected deliver to audio frequency controller service (AudioFlinger).Then pass through
Audio Mixing Recorder (AudioMixer) carries out the links such as resampling, volume control, audio effect processing and delivers to audio output
(AudioOutPut) final digital audio domain output is carried out.And in fact, as shown in figure 3, Android system is to the audio of input
During being handled, for the sample rate in the range of original acquiescence and sampling precision (such as higher than sample rate
48KHz sampling precision 16Bit/8Bit) audio, carry out give tacit consent to 44.1KHz frequencies resampling, may result in a certain degree of
Distortion.In some practical applications, the audio for handling above-mentioned high sampling rate and high sampling precision, it can also prompt not support
Influence the generation of the unfavorable condition of Consumer's Experience.
Unlike the prior art, Fig. 4 shows that some specific embodiments of the technical program carry out one to MixerThread
A little modifications so that Android system can support the audio output of nonsystematic default sample rate.Particular flow sheet is referring to Fig. 2, this reality
Apply example and propose a kind of method for improving Android system audio recording and reproducing quality, comprise the following steps:Step S1 is according to current setting
Audio types, judge whether that variable sampling rate and sampling precision can be carried out, when being judged as YES, then carry out step S2 and obtain current need
Want the sample rate and sampling precision information of system variable sampling rate and the audio track of precision support.The audio types are to be set in Android
Fixed audio types, such as audio types are divided into MUSIC, VOIP, RING, ALARM etc., each audio in Android system
The attribute of audio types is all equipped with when being created.The wherein broadcasting of high quality audio, such as music, film high-quality sound
Frequently, all played out with MUSIC types.This method can need setting audio types according to practical application, such as at certain
In a little embodiments, the audio types (audio types for needing variable sampling rate and Variable sampling precision) currently pre-set are
During MUSIC and VOIP types, then when other audio types (such as RING) input, then need not carry out variable sampling rate and Variable sampling essence
Degree is supported, is operated without to it.When being judged as YES, then the letters such as sample rate and the sampling precision of the input audio are obtained
Breath.
Step S5 is then carried out (to sample above-mentioned sample rate and sampling precision with current Audio Mixing Recorder corresponding informance
Rate and sampling precision) be compared, if it is confirmed that inconsistent, i.e., Audio Mixing Recorder can not be directly to above-mentioned audio at
Reason, then carry out step S6 and destroy present video mixer, then carry out step S7 according to the audio sample rate and sampling essence compared
Degree re-creates Audio Mixing Recorder, that is, creates the Audio Mixing Recorder of the above-mentioned sample rate of new support and sampling precision, and carry out defeated
Post processing link before going out.Audio output then according to the sample rate and sampling precision of this output demand, reinitializes the whole series
Audio output path.Pass through above-mentioned destruction present video mixer, the step for creating Audio Mixing Recorder, initializing audio output path
Suddenly, the sample rate do not supported script Android system acquiescence has been reached and sampling precision audio is adjusted the purpose of adaptation, made
Obtaining these audios can directly be exported by Audio Mixing Recorder and audio output, be avoided to prior art to these audios
Cause the distortion of audio after progress resampling, reach the purpose for improving Android system audio recording and reproducing quality.
In other specific embodiments, if whether variable sampling rate can be carried out and sampling precision is judged as NO, enter
Row step S8 audios are taken out after being directly entered the Audio Mixing Recorder processing of system default sample rate and sampling precision by audio hardware
As layer is exported.Such as the audio types (audio types for needing variable sampling rate and Variable sampling precision) of current setting are
During MUSIC and VOIP types, if running into the audio input of RING, ALARM type, grasped without variable sampling rate sampling precision
Make so that user can be configured according to the needs of oneself, for the not high audio types of quality requirements then without improving
Tonequality operates, and has reached saving system resource, improves the effect of this method operational efficiency.
Also including the newly-built audio track of step in some specific embodiments, before obtaining sample rate and sampling precision makes it
The interface of compatible original audio track, audio sample rate and the sampling precision limitation originally supported are modified.Different audios
Input mode is also different corresponding to type, in fig. 2 it will be seen that the source of AudioClient sound intermediate frequencies has audio to regard
Frequency player, games, the source of VOIP audio types can be sound pick-up outfit, by newly-built audio track and correct its sampling
Rate sampling precision limits, and it is supported 8K~192KHz sample rate and 8bit/16bit/24bit/32bit audio input,
Reach the effect for the audio quality for supporting higher precision, solve the sound for handling high sampling rate sampling precision in the present case
The problem of Android system can prompt not support during frequency, improve the experience of user.In addition, by changing input limitation simultaneously also more
Good has reached the purpose for improving Android system inputting audio quality.
For the audio of more preferable outputting high quality, it is also necessary to which other units are carried out more effectively such as audio output
Coordinate, in some specific embodiments, in addition to step S3, judged according to audio track sample rate and sampling precision information current
Whether audio output setting is consistent, and step S4 is carried out if inconsistent to audio output, audio hardware level of abstraction and audio mixing rail
Notice will export the sample rate and sampling precision of audio, allow audio output, audio hardware level of abstraction and audio mixing rail to carry out phase
It should adjust so that audio output, audio hardware level of abstraction and audio mixing rail can support the sample rate and sampling precision of present video.
Carry out exporting after step S9 is handled by currently valid Audio Mixing Recorder if consistent.The audio hardware level of abstraction
(AudioHal) can on hardware view simulation softward control interface;The audio output is that audio stream passes through
The necessary ways exported after AudioFlinger;The audio mixing rail is used to be synthesized the audio stream of more tracks, in this method
In refer specifically to for this part of MixerThread.It is determined that after inconsistent, above-mentioned set-up procedure S3 is carried out, is played to be to be output
Audio provides the effect of output environment.It is determined that directly it can be entered when consistent using current AudioMixer and AudioOutput
Row output is, it is necessary to which explanation, what current AudioMixer referred to here can be system default sample rate and sampling precision
AudioMixer, the created AudioMixer of this method can also be used before.Exported when being determined as consistent with existing set,
It is adjusted when judging inconsistent, good processing and configuration has been carried out to audio output environment to be output, serves output more
The effect of the audio of high quality.
In other specific embodiments, the step S10 post processings link is mixer mixing track and audio
Control, i.e. mixer to audio mix the sound effect control of track and audio.Specifically, passing through AudioMixer processing
Later carry out mixing track and sound effect control again, can cause original multiple tracks to be processed audio stream broadcasting more oneself
So.And sound is allowd to export or play after post-processing link.
And inventor also provides a kind of device for improving Android system audio recording and reproducing quality, including following module:Judge
Module 102, acquisition module 103, contrast module 105, destruction creation module 107 and output module 108;The judge module 102
For the audio types according to current setting, judge whether that audio system variable sampling rate and sampling precision can be carried out, obtain mould
Block 103 is used to whether audio system variable sampling rate can be carried out and when sampling precision is judged as YES, acquisition is currently needed for system
The sample rate and sampling precision information for the audio track that variable sampling rate and precision are supported;
Contrast module 105 is used to compare above-mentioned sample rate and sampling precision with current Audio Mixing Recorder corresponding informance
It is right, destroy creation module 107 and be used to destroy present video mixer when comparing inconsistent, and adopted according to the audio stream compared
Sample rate and sampling precision re-create Audio Mixing Recorder, then the post processing link before being exported;Output module 108 is used for basis
The sample rate and sampling precision of this output demand, reinitialize a whole set of audio output path.Design the benefit of these modules
It is that having reached the sample rate for not supporting script Android system acquiescence and sampling precision audio is adjusted the purpose of adaptation, makes
Obtaining these audios can directly be exported by Audio Mixing Recorder and audio output, avoided and carried out resampling to these audios
Caused distortion, solve the problems, such as to improve Android system audio recording and reproducing quality.
Specifically, also including input module 101, the input module, which is used for newly-built audio track, makes its compatible original audio
The interface of rail, audio sample rate and the sampling precision limitation originally supported are modified.Repaiied by designing input module enforcement
The operation of positive sample rate and sampling precision, has reached the effect for the audio quality for supporting higher precision, has solved in partial picture
The problem of Android system can prompt not support during the audio of lower processing high sampling rate sampling precision, improves the experience of user.
In further embodiments, the output module 108 is additionally operable to whether variable sampling rate and sampling essence can be being carried out
When degree is judged as NO, audio is allowed to pass through audio after being directly entered the Audio Mixing Recorder processing of system default sample rate and sampling precision
Hardware abstraction layer is exported.Output module is designed as directly carrying out the audio file for not needing variable sampling rate sampling precision
Output, the operating efficiency of system is improved, save the resource of system.
Specifically, the judge module 102 is additionally operable to judge current sound according to audio track sample rate and sampling precision information
Whether frequency output sets consistent;
Also include notification module 104, the notification module be used for when it is inconsistent that audio output, which is set, to audio output,
Audio hardware level of abstraction and audio mixing rail notice will export the sample rate and sampling precision of audio;
Also include set adjusting module 106, it is described setting adjusting module be used for audio output, audio hardware level of abstraction and
Audio mixing rail adjusts accordingly;
Output module 108 is additionally operable to defeated after being handled when audio output sets consistent by currently valid Audio Mixing Recorder
Go out.
By designing above-mentioned judge module 102, notification module 104, setting between adjusting module 106 and output module 108
Interactive cooperation, serve when being determined as consistent with it is existing set export, be adjusted when judging inconsistent, to sound to be output
Frequency output environment has carried out the effect of good processing and configuration, has reached the effect for making the higher-quality audio of output, also more
Good solves the problems, such as that Android system playing quality is not high.
Specifically, the post processing link for destroying the progress of creation module 107 is mixer mixing track and audio control
System.The post processing link of creation module is destroyed by designing, the audio stream broadcasting of original multiple tracks to be processed can be caused
More naturally, sound effect control can also improve the quality for playing audio, it is not high solution Android system broadcasting audio quality has also been reached
The problem of.
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality
Body or operation make a distinction with another entity or operation, and not necessarily require or imply and deposited between these entities or operation
In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to
Nonexcludability includes, so that process, method, article or terminal device including a series of elements not only include those
Key element, but also the other element including being not expressly set out, or it is this process, method, article or end also to include
The intrinsic key element of end equipment.In the absence of more restrictions, limited by sentence " including ... " or " including ... "
Key element, it is not excluded that other key element in the process including the key element, method, article or terminal device also be present.This
Outside, herein, " being more than ", " being less than ", " exceeding " etc. are interpreted as not including this number;" more than ", " following ", " within " etc. understand
It is to include this number.
It should be understood by those skilled in the art that, the various embodiments described above can be provided as method, apparatus or computer program production
Product.These embodiments can use the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Form.All or part of step in the method that the various embodiments described above are related to can by program come instruct the hardware of correlation come
Complete, described program can be stored in the storage medium that computer equipment can be read, for performing the various embodiments described above side
All or part of step described in method.The computer equipment, include but is not limited to:Personal computer, server, general-purpose computations
It is machine, special-purpose computer, the network equipment, embedded device, programmable device, intelligent mobile terminal, intelligent home device, wearable
Smart machine, vehicle intelligent equipment etc.;Described storage medium, include but is not limited to:RAM, ROM, magnetic disc, tape, CD, sudden strain of a muscle
Deposit, USB flash disk, mobile hard disk, storage card, memory stick, webserver storage, network cloud storage etc..
The various embodiments described above are with reference to method, equipment (system) and the computer program product according to embodiment
Flow chart and/or block diagram describe.It should be understood that can be by every in computer program instructions implementation process figure and/or block diagram
One flow and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computers can be provided
Programmed instruction is to the processor of computer equipment to produce a machine so that passes through the finger of the computing device of computer equipment
Order, which produces, to be used to realize what is specified in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames
The device of function.
These computer program instructions may be alternatively stored in the computer that computer equipment can be guided to work in a specific way and set
In standby readable memory so that the instruction being stored in the computer equipment readable memory produces the manufacture for including command device
Product, the command device is realized to be referred in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames
Fixed function.
These computer program instructions can be also loaded on computer equipment so that performed on a computing device a series of
Operating procedure is to produce computer implemented processing, so as to which the instruction performed on a computing device is provided for realizing in flow
The step of function of being specified in one flow of figure or multiple flows and/or one square frame of block diagram or multiple square frames.
Although the various embodiments described above are described, those skilled in the art once know basic wound
The property made concept, then other change and modification can be made to these embodiments, so embodiments of the invention are the foregoing is only,
Not thereby the scope of patent protection of the present invention, every equivalent structure made using description of the invention and accompanying drawing content are limited
Or equivalent flow conversion, or other related technical areas are directly or indirectly used in, similarly it is included in the patent of the present invention
Within protection domain.