CN109448676A - Audio-frequency processing method, device and storage medium - Google Patents
Audio-frequency processing method, device and storage medium Download PDFInfo
- Publication number
- CN109448676A CN109448676A CN201811334209.6A CN201811334209A CN109448676A CN 109448676 A CN109448676 A CN 109448676A CN 201811334209 A CN201811334209 A CN 201811334209A CN 109448676 A CN109448676 A CN 109448676A
- Authority
- CN
- China
- Prior art keywords
- audio
- sampling rate
- terminal
- accompaniment
- target
- 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
- 238000003672 processing method Methods 0.000 title claims abstract description 18
- 238000005070 sampling Methods 0.000 claims abstract description 153
- 238000012545 processing Methods 0.000 claims abstract description 73
- 239000002131 composite material Substances 0.000 claims abstract description 46
- 238000012952 Resampling Methods 0.000 claims abstract description 43
- 230000015572 biosynthetic process Effects 0.000 claims abstract description 35
- 238000003786 synthesis reaction Methods 0.000 claims abstract description 35
- 238000000034 method Methods 0.000 claims abstract description 32
- 230000006870 function Effects 0.000 claims description 39
- 230000033764 rhythmic process Effects 0.000 abstract description 10
- 230000010365 information processing Effects 0.000 abstract description 2
- 230000002093 peripheral effect Effects 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 230000008569 process Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000004927 fusion Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000001052 transient effect Effects 0.000 description 2
- 241001269238 Data Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/0008—Associated control or indicating means
- G10H1/0025—Automatic or semi-automatic music composition, e.g. producing random music, applying rules from music theory or modifying a musical piece
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/0033—Recording/reproducing or transmission of music for electrophonic musical instruments
- G10H1/0041—Recording/reproducing or transmission of music for electrophonic musical instruments in coded form
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/02—Means for controlling the tone frequencies, e.g. attack or decay; Means for producing special musical effects, e.g. vibratos or glissandos
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/36—Accompaniment arrangements
- G10H1/361—Recording/reproducing of accompaniment for use with an external source, e.g. karaoke systems
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H1/00—Details of electrophonic musical instruments
- G10H1/36—Accompaniment arrangements
- G10H1/40—Rhythm
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/005—Musical accompaniment, i.e. complete instrumental rhythm synthesis added to a performed melody, e.g. as output by drum machines
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/031—Musical analysis, i.e. isolation, extraction or identification of musical elements or musical parameters from a raw acoustic signal or from an encoded audio signal
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2210/00—Aspects or methods of musical processing having intrinsic musical character, i.e. involving musical theory or musical parameters or relying on musical knowledge, as applied in electrophonic musical tools or instruments
- G10H2210/155—Musical effects
- G10H2210/195—Modulation effects, i.e. smooth non-discontinuous variations over a time interval, e.g. within a note, melody or musical transition, of any sound parameter, e.g. amplitude, pitch, spectral response, playback speed
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10H—ELECTROPHONIC MUSICAL INSTRUMENTS; INSTRUMENTS IN WHICH THE TONES ARE GENERATED BY ELECTROMECHANICAL MEANS OR ELECTRONIC GENERATORS, OR IN WHICH THE TONES ARE SYNTHESISED FROM A DATA STORE
- G10H2240/00—Data organisation or data communication aspects, specifically adapted for electrophonic musical tools or instruments
- G10H2240/011—Files or data streams containing coded musical information, e.g. for transmission
- G10H2240/046—File format, i.e. specific or non-standard musical file format used in or adapted for electrophonic musical instruments, e.g. in wavetables
- G10H2240/071—Wave, i.e. Waveform Audio File Format, coding, e.g. uncompressed PCM audio according to the RIFF bitstream format method
Abstract
The invention discloses a kind of audio-frequency processing method, device and storage mediums, belong to field of information processing.The method is applied in audio client, comprising: obtains the target sampling rate of terminal;Start audio accompaniment playing function and audio recording function;After the starting of audio accompaniment playing function, if detecting, the default sample rate of audio accompaniment to be played and the target sampling rate are inconsistent, resampling processing then is carried out to audio accompaniment, obtains the target audio accompaniment data of target sampling rate, controlling terminal plays out target audio accompaniment data;After audio recording function starting, controlling terminal carries out audio recording according to target sampling rate;The audio data of broadcasting and the audio data of recording are subjected to synthesis processing, obtain Composite tone.The problem of present invention to audio accompaniment by audio client by being carried out resampling processing, avoiding the rhythm misalignment of audio accompaniment and recording audio in the delay and Composite tone of terminal plays system.
Description
Technical field
The present invention relates to field of information processing, in particular to a kind of audio-frequency processing method, device and storage medium.
Background technique
Current audio client can provide K song function, and user sings function by the K, and accompaniment not only can be used and make
Singing songs are carried out for background sound, the song of performance can also be recorded.For example, being equipped with audio when user sings
The terminal of client can play audio accompaniment on one side, be recorded on one side, then by broadcasting accompaniment with record voice into
Row synthesis, and Composite tone records result as performance.
In the related technology, audio accompaniment has a default sample rate, and terminal is passing through play system to broadcasting accompaniment tone
When playing out, play system is general first directly to sample audio accompaniment according to the sample rate of play system frequency, and to adopting
Sample data play out, in playing process, if detect play system sample rate and audio accompaniment default sample rate not
Unanimously, then the sample rate of play system is adjusted to this and presets sample rate, then preset sample rate to accompaniment tone to according to this again
Frequency is sampled, and is played out to sampled data.Similarly, recording audio also has a default sample rate, and terminal is passing through
When recording system carries out audio recording, if detecting the sample rate of recording system and default sample rate is inconsistent also will do it tune
It is whole.
Due to being carried out by system hardware to sample rate after starting to play and start recording
Judgement and adjustment, will will lead to the delay of play system and recording system in this way, and delay time be all it is uncertain, because
This, then when the audio accompaniment of broadcasting and recording audio are synthesized, it is possible that the problem of the rhythm misalignment of the two, shadow
Ring synthetic effect.
Summary of the invention
The embodiment of the invention provides a kind of audio-frequency processing method, device and storage medium, it can be used for solving related skill
In Composite tone present in art the problem of the rhythm misalignment of audio accompaniment and recording audio.The technical solution is as follows:
On the one hand, provide a kind of audio-frequency processing method, audio client the described method includes:
Obtain the target sampling rate of terminal;
Start audio accompaniment playing function and audio recording function;
After audio accompaniment playing function starting, if detecting default sample rate and the institute of audio accompaniment to be played
It is inconsistent to state target sampling rate, then resampling processing is carried out to the audio accompaniment according to the target sampling rate, obtains target
Audio accompaniment data control the terminal and play out to the target audio accompaniment data, the target audio accompaniment data
Sample rate be the target sampling rate;
After audio recording function starting, the terminal is controlled according to the target sampling rate and carries out audio recording;
The audio data of broadcasting and the audio data of recording are subjected to synthesis processing, obtain Composite tone.
Optionally, described that resampling processing is carried out to the audio accompaniment according to the target sampling rate, obtain target companion
Play audio data, comprising:
Processing is decoded to the audio accompaniment, is obtained the first PCM (Pulse Code Modulation), pulse is compiled
Code modulation audio data;
According to the target sampling rate, resampling processing is carried out to first PCM audio data, obtains the 2nd PCM sound
Frequency evidence, the sample rate of second PCM audio data are the target sampling rate;
Second PCM audio data is determined as the target audio accompaniment data.
Optionally, described according to the target sampling rate, resampling processing, packet are carried out to first PCM audio data
It includes:
If the target sampling rate is greater than the default sample rate, according to the target sampling rate, to the first PCM
Audio data is up-sampled, and second PCM audio data is obtained;
If the target sampling rate is less than the default sample rate, according to the target sampling rate, to the first PCM
Audio data carries out down-sampling, obtains second PCM audio data.
Optionally, the target sampling rate for obtaining terminal, comprising:
The system interface for calling the terminal obtains the target sampling rate of the terminal by the system interface.
Optionally, described that the audio data of broadcasting and the audio data of recording are subjected to synthesis processing, Composite tone is obtained,
Include:
The audio data of broadcasting and the audio data of recording are subjected to synthesis processing;
To synthesis, treated that audio data encodes, and obtains the Composite tone.
Optionally, described that the audio data of broadcasting and the audio data of recording are subjected to synthesis processing, obtain Composite tone
Later, further includes:
The Composite tone is played out.
Optionally, the target sampling rate is sample rate that is that the terminal is supported and being located within the scope of default sample rate,
Or the sample rate for best performance in the sample rate of terminal support.
On the one hand, a kind of apparatus for processing audio is provided, described device includes:
Module is obtained, for obtaining the target sampling rate of terminal;
Starting module, for starting audio accompaniment playing function and audio recording function;
Resampling module is used for after audio accompaniment playing function starting, if detecting audio accompaniment to be played
Default sample rate and the target sampling rate it is inconsistent, then the audio accompaniment is adopted again according to the target sampling rate
Sample processing, obtains target audio accompaniment data, and the sample rate of the target audio accompaniment data is the target sampling rate;
First playing module plays out the target audio accompaniment data for controlling the terminal;
Module is recorded, for controlling the terminal according to the target sampling rate after audio recording function starting
Carry out audio recording;
Synthesis module obtains synthesized voice for the audio data of the audio data of broadcasting and recording to be carried out synthesis processing
Frequently.
Optionally, the resampling module includes:
Decoding unit obtains the first pulse code modulation pcm audio number for being decoded processing to the audio accompaniment
According to;
Resampling unit, for being carried out at resampling to first PCM audio data according to the target sampling rate
Reason, obtains the second PCM audio data, and the sample rate of second PCM audio data is the target sampling rate;
Determination unit, for second PCM audio data to be determined as the target audio accompaniment data.
Optionally, the resampling unit is specifically used for:
If the target sampling rate is greater than the default sample rate, according to the target sampling rate, to the first PCM
Audio data is up-sampled, and second PCM audio data is obtained;
If the target sampling rate is less than the default sample rate, according to the target sampling rate, to the first PCM
Audio data carries out down-sampling, obtains second PCM audio data.
Optionally, the acquisition module is specifically used for:
The system interface for calling the terminal obtains the target sampling rate of the terminal by the system interface.
Optionally, the synthesis module is specifically used for:
The audio data of broadcasting and the audio data of recording are subjected to synthesis processing;
To synthesis, treated that audio data encodes, and obtains the Composite tone.
Optionally, described device further include:
Second playing module plays out the Composite tone for controlling the terminal.
Optionally, the target sampling rate is sample rate that is that the terminal is supported and being located within the scope of default sample rate,
Or the sample rate for best performance in the sample rate of terminal support.
On the one hand, a kind of apparatus for processing audio is provided, described device includes:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to the step of executing any of the above-described method.
On the one hand, a kind of computer readable storage medium is provided, finger is stored on the computer readable storage medium
The step of enabling, any of the above-described method realized when described instruction is executed by processor.
Technical solution provided in an embodiment of the present invention has the benefit that
In the embodiment of the present invention, by obtaining the target of terminal by audio client before terminal plays audio accompaniment
Sample rate, if detecting that the default sample rate of audio accompaniment and target sampling rate are inconsistent, according to target sampling rate to companion
Play audio and carry out resampling processing, obtain with the consistent target audio accompaniment data of target sampling rate, then played out by terminal,
Terminal is avoided in playing process to the adjustment of sample rate, and then avoids the delay of play system bring, in addition, terminal
Recording system is also directly recorded according to target sampling rate, since the sample rate for playing with recording is identical, Composite tone
Deviation would not also occur in middle audio accompaniment and recording audio, avoid the rhythm of audio accompaniment and recording audio in Composite tone
The problem of misalignment.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Fig. 1 be the present embodiments relate to a kind of implementation environment schematic diagram;
Fig. 2 is a kind of flow chart of audio-frequency processing method provided in an embodiment of the present invention;
Fig. 3 is the flow chart of another audio-frequency processing method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural block diagram of apparatus for processing audio provided in an embodiment of the present invention;
Fig. 5 is a kind of structural block diagram of terminal 500 provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Before to the embodiment of the present invention carrying out that explanation is explained in detail, first the application scenarios of the embodiment of the present invention are given
Explanation.
Audio-frequency processing method provided in an embodiment of the present invention can be applied in K song scene, for example, being applied to utilize terminal
The audio client of middle installation carries out K song, and in the scene recorded to the song of performance.But in the song sung user
When Qu Jinhang is recorded with synthesis, it often will appear the case where accompaniment in Composite tone can not be aligned with the rhythm of voice, this hair
The audio-frequency processing method that bright embodiment provides, by before audio accompaniment plays, by audio client to audio accompaniment into
Row resampling processing, solves the problems, such as that the accompaniment in Composite tone can not be aligned with the rhythm of voice.
Next, to the present embodiments relate to implementation environment be introduced.
Fig. 1 be the present embodiments relate to a kind of implementation environment schematic diagram, as shown in Figure 1, the implementation environment includes
Terminal 10, the terminal 10 can be the equipment such as mobile phone, tablet computer or computer.It include play system 11 and record in the terminal 10
System 12 processed, play system 11 refer to that the audio in terminal 10 plays hardware, and recording system 12 refers to that the audio in terminal 10 is recorded
Hardware processed.
In addition, be also equipped with audio client 20 in the terminal 10, audio client 20 can respectively with play system 11
It is connected with recording system 12, play system 11 can be controlled respectively and recording system 12 is played out and recorded, and to broadcasting sound
Frequency and recording audio carry out synthesis processing, to provide performance function for user.In addition, the audio client 20 can also be user
Multiple audio files are provided, the audio accompaniment for the needs therefrom chosen so as to user is sung as background sound.
Fig. 2 is a kind of flow chart of audio-frequency processing method provided in an embodiment of the present invention, and this method is applied to audio clients
In end, such as it can be applied in above-mentioned audio client shown in FIG. 1 20.Referring to Fig. 1, this method comprises:
Step 201: obtaining the target sampling rate of terminal.
Step 102: starting audio accompaniment playing function and audio recording function.
Step 203: after the starting of audio accompaniment playing function, if detecting the default sample rate of audio accompaniment to be played
It is inconsistent with target sampling rate, then resampling processing is carried out to the audio accompaniment according to target sampling rate, obtains target accompaniment tone
Frequency evidence, the sample rate of target audio accompaniment data are target sampling rate.
Step 204: controlling terminal plays out target audio accompaniment data.
Step 205: after audio recording function starting, controlling terminal carries out audio recording according to target sampling rate.
Step 206: the audio data of broadcasting and the audio data of recording being subjected to synthesis processing, obtain Composite tone.
In the embodiment of the present invention, by obtaining the target of terminal by audio client before terminal plays audio accompaniment
Sample rate, if detecting that the default sample rate of audio accompaniment and target sampling rate are inconsistent, according to target sampling rate to companion
Play audio and carry out resampling processing, obtain with the consistent target audio accompaniment data of target sampling rate, then played out by terminal,
Terminal is avoided in playing process to the adjustment of sample rate, and then avoids the delay of play system bring, in addition, terminal
Recording system is also directly recorded according to target sampling rate, since the sample rate for playing with recording is identical, Composite tone
Deviation would not also occur in middle audio accompaniment and recording audio, avoid the rhythm of audio accompaniment and recording audio in Composite tone
The problem of misalignment.
Optionally, resampling processing is carried out to the audio accompaniment according to target sampling rate, obtains target audio accompaniment data,
Include:
Processing is decoded to audio accompaniment, obtains the first PCM audio data;
According to target sampling rate, resampling processing is carried out to the first PCM audio data, obtains the second PCM audio data, the
The sample rate of two PCM audio datas is the target sampling rate;
Second PCM audio data is determined as target audio accompaniment data.
Optionally, according to the target sampling rate, resampling processing is carried out to the first PCM audio data, comprising:
The first PCM audio data is carried out according to target sampling rate if target sampling rate is greater than the default sample rate
Sampling, obtains the second PCM audio data;
The first PCM audio data is carried out down according to target sampling rate if target sampling rate is less than the default sample rate
Sampling, obtains the second PCM audio data.
Optionally, the target sampling rate of terminal is obtained, comprising:
The system interface for calling terminal obtains the target sampling rate of terminal by the system interface.
Optionally, the audio data of broadcasting and the audio data of recording are subjected to synthesis processing, obtain Composite tone, wrapped
It includes:
The audio data of broadcasting and the audio data of recording are subjected to synthesis processing;
To synthesis, treated that audio data encodes, and obtains the Composite tone.
Optionally, the audio data of broadcasting and the audio data of recording are subjected to synthesis processing, after obtaining Composite tone,
Further include:
The Composite tone is played out.
Optionally, target sampling rate is sample rate that is that terminal is supported and being located within the scope of default sample rate, or for eventually
Hold the sample rate of best performance in the sample rate supported.
All the above alternatives, can form alternative embodiment of the invention according to any combination, and the present invention is real
It applies example and this is no longer repeated one by one.
Fig. 3 is the flow chart of another audio-frequency processing method provided in an embodiment of the present invention, and this method is applied to audio visitor
In the end of family, such as it can be applied in above-mentioned audio client shown in FIG. 1 20.Referring to Fig. 3, this method comprises:
Step 301: obtaining the target sampling rate of terminal.
Wherein, the target sampling rate of terminal refers to the sample rate that terminal is supported, is specifically as follows that terminal is supported and is located at
Sample rate within the scope of default sample rate, or the optimum sampling rate etc. supported for terminal.
Optimum sampling rate refers to the sample rate of best performance in all sample rates of terminal support, all samplings such as supported
Maximum sample rate in rate etc..The default sample rate range can also be set in advance by terminal default setting by technical staff
It sets, it is not limited in the embodiment of the present invention.Optionally, which is to meet broadcasting for audio accompaniment to be played
The sample rate range for putting demand is configured by terminal according to the broadcasting demand of the audio accompaniment.
It specifically, can be when audio client receives performance instruction based on audio accompaniment to be played, by audio visitor
The target sampling rate of family end acquisition terminal.Wherein, audio accompaniment can be used as the background sound during user sings, specifically,
The audio accompaniment can be what user selected to obtain from multiple audios that audio client provides, be also possible to user from terminal
Selection obtains in multiple audios of storage, and it is not limited in the embodiment of the present invention.
It that is to say, in the embodiment of the present invention, before playing out and recording, audio client will first go to obtain terminal
Target sampling rate, so that the target sampling rate according to terminal plays out and records, so that playing and record will not output deviation.
Specifically, audio client can call the system interface of terminal, be adopted by the target that system interface obtains terminal
Sample rate.Wherein, which is used to obtain the target sampling rate of terminal, after the system interface is called, available terminal
Target sampling rate, and target sampling rate is returned into audio client.
Further, the system interface can also obtain terminal support multiple sample rates, then according to preset rules from
Optimum sampling rate is determined in multiple sample rates, and returns to audio client using optimum sampling rate as target sampling rate.For example,
The system interface can determine maximum sample rate from multiple sample rates, return to sound using maximum sample rate as target sampling rate
Frequency client.
It should be noted that the system interface can be provided previously by terminal, and called directly by audio client, it can also
With by technical staff in order to enable the audio client can get the target sampling rate of terminal in the process of running, for the sound
Frequency client is specially arranged, and is integrated into the audio client or terminal.
Step 302: starting audio accompaniment playing function and audio recording function.
Wherein, which has accompaniment playing function and audio recording function, in the destination sample for obtaining terminal
After rate, which can start audio accompaniment playing function and audio recording function simultaneously, to accompany simultaneously
Broadcasting and voice recording.
Wherein, which is used to handle audio accompaniment and controlling terminal broadcasts audio accompaniment
It puts, which carries out audio recording for controlling terminal.
Step 303: after the starting of audio accompaniment playing function, detecting the default sample rate and mesh of audio accompaniment to be played
Whether consistent mark sample rate.
After the starting of audio accompaniment playing function, available the default of audio accompaniment to be played of audio client is adopted
Whether sample rate, default sample rate and the target sampling rate for then detecting audio accompaniment are consistent.
Wherein, sample rate is also referred to as sample frequency or sample rate, define it is per second extracted from continuous signal and form from
The number of samples of scattered signal, popular says, sample rate refers to that computer each second acquires how many a sample of signal.
Wherein, the default sample rate of audio accompaniment is the intrinsic sample rate of the audio accompaniment, generally pre- by audio client
First it is arranged, can indicates when the audio data to audio accompaniment samples, it is per second to acquire how many a sampling points.For example,
The default sample rate of some audio accompaniment is 44k/s, is used to indicate the sample that 44k is acquired in the audio data per second from audio accompaniment
Point.In general, sample rate is higher, and the information content of the audio data sampled is more, and audio quality is better.But it samples
If rate is low, since time interval is very small, the sense of hearing of the user to audio accompaniment will not be generally influenced.
Step 304: if detecting that the default sample rate of audio accompaniment is inconsistent with target sampling rate, being adopted according to target
Sample rate carries out resampling processing to the audio accompaniment, obtains target audio accompaniment data, the sample rate of target audio accompaniment data
For target sampling rate.
It that is to say, if the default sample rate of audio accompaniment and target sampling rate are inconsistent, which is carried out
Resampling processing, with obtain with the consistent target audio accompaniment data of target sampling rate, i.e., audio accompaniment is resampled to target
Sample rate.
Resampling processing, which refers to the process of, goes out another kind of picture dot information according to the message interpolation of a kind of picture dot.By to the companion
It plays audio and carries out resampling processing, thus it is possible to vary the resolution ratio of audio accompaniment adopts it so as to adjust the sample rate of audio accompaniment
Sample rate is adjusted to the target sampling rate of terminal from original default sample rate, in this way, terminal can directly counterweight sampling processing obtain
To target audio accompaniment data play out, without being adjusted again to the sample rate of play system, so as to avoid broadcasting
The delay of place system.
Specifically, resampling processing is carried out to the audio accompaniment according to target sampling rate, obtains target audio accompaniment data
Operation include: to play audio to this to be decoded processing, obtain the first PCM audio data;According to target sampling rate, to first
PCM audio data carries out resampling processing, obtains the second PCM audio data, the sample rate of the second PCM audio data is adopted for target
Sample rate;Second PCM audio data is determined as target audio accompaniment data.
What can directly be played due to the play system of terminal is PCM audio data, therefore, it is necessary to first to audio accompaniment into
Row decoding process obtains the first PCM audio data.It, can be to the first PCM audio data after obtaining the first PCM audio data
Resampling processing is carried out, to obtain and consistent second PCM audio data of target sampling rate.
Specifically, according to target sampling rate, resampling processing is carried out to the first PCM audio data, obtains the second pcm audio
If the operation of data includes: that target sampling rate is greater than default sample rate, according to target sampling rate, to the first PCM audio data
It is up-sampled, obtains the second PCM audio data;If target sampling rate is less than the default sample rate, according to target sampling rate,
Down-sampling is carried out to the first PCM audio data, obtains the second PCM audio data.
The foundation that the mode of resampling processing generally comprises up-sampling and down-sampling, and distinguishes is new when being resampling
The comparison of the size of sample rate and former sample rate.If former sample rate is smaller, up-sampled, if former sample rate compared with
Greatly, then it needs to carry out small sampling.
Specifically, if target sampling rate is larger, and original sample rate of the first PCM audio data is smaller, then needs pair
First PCM audio data is up-sampled, its sample rate is made to become larger.The essence of up-sampling is interpolation or interpolation, i.e., in original number
According to the middle some sampled points of insertion, its resolution ratio is made to become larger.The specific method of up-sampling may include nearest neighbor algorithm, bilinear interpolation
Method and cubic convolution interpolation method etc..For example, it is assumed that the default sample rate of the first PCM audio data is 44/s, target sampling rate
48k/s, then can resampling handle during, it is per second to collect 44k sampled point, then thereafter be inserted into 4k sample
Point, the sampled point being inserted into can select to obtain from collected sampled point, or pre-set no Information Number
According to.
Specifically, if target sampling rate is smaller, and original sample rate of the first PCM audio data is larger, then needs pair
First PCM audio data carries out down-sampling, its sample rate is made to become smaller.The essence of up-sampling is to delete, i.e., deletes from initial data
Some sampled points make its resolution ratio become smaller.For example, it is assumed that the default sample rate of the first PCM audio data is 48/s, destination sample
The 44k/s of rate, then can be per second to collect 48k sampled point during resampling is handled, and is removed from it 4k sampling
Point.
Step 305: if detecting that the default sample rate of audio accompaniment is consistent with target sampling rate, by the audio accompaniment
Audio data, be determined as target audio accompaniment data.
It that is to say, if the default sample rate of audio accompaniment is consistent with target sampling rate, illustrate the sample rate of audio accompaniment
It is exactly target sampling rate, at this point, also with regard to being not necessarily to carry out resampling processing to audio accompaniment, directly by the audio data of audio accompaniment
It is determined as target audio accompaniment data.
Specifically, the audio data of audio accompaniment is determined as the operation of target audio accompaniment data includes: to accompaniment tone
Frequency is decoded, and obtains the first PCM audio data, the first PCM audio data is determined as target audio accompaniment data.
Step 306: controlling terminal plays out target audio accompaniment data.
After obtaining the target audio accompaniment data of target sampling rate, target audio accompaniment data can be sent to terminal
It plays out.Specifically, the play system that target audio accompaniment data can be sent to terminal plays out, the broadcasting of terminal
System refers to the audio hardware of terminal.
It is identical as target audio accompaniment data since the sample rate of the play system of terminal is also target sampling rate, then eventually
The play system at end also with regard to the adjustment without carrying out sample rate, can directly play out target audio accompaniment data, thus
Avoid the delay of the play system of terminal.
Step 307: after audio recording function starting, controlling terminal carries out audio recording according to target sampling rate.
Specifically, after audio recording function starting, audio client can be set the sample rate of the recording system of terminal
Be set to target sampling rate, so as to terminal recording system when being recorded, directly according to target sampling rate carry out audio recording.
Step 308: the audio data of broadcasting and the audio data of recording being subjected to synthesis processing, obtain Composite tone.
It that is to say, the track of broadcasting can be synthesized to a single-tone rail with the track of recording, include in the track of synthesis
The audio data of broadcasting also includes the audio data recorded.It specifically, can be by the audio number of the audio data of broadcasting and recording
According to synthesis processing is carried out, then to synthesis, treated that audio data encodes, and obtains the Composite tone.
Due to avoiding the delay of the play system of terminal by carrying out resampling processing to audio accompaniment, and terminal
Play system is consistent with the sample rate of recording system, and therefore, audio accompaniment in the audio data of synthesis and recording audio are also
It is not in deviation, rhythm can be consistent, and improve the K song experience of user.
Step 309: controlling terminal plays out Composite tone.
Specifically, after obtaining Composite tone, terminal can be directly controlled, Composite tone is played out, it can also be
When receiving the play instruction to Composite tone, controlling terminal plays out Composite tone, it is of course also possible to Composite tone
It is stored, it is not limited in the embodiment of the present invention.
Specifically, terminal, can be right by play system, that is, audio hardware of terminal when playing out to Composite tone
Composite tone plays out.Moreover, because audio accompaniment and the sample rate of recording audio are consistent with target sampling rate, then at synthesis
Managing the obtained sample rate of Composite tone also will be consistent with target sampling rate, therefore, terminal can also directly to Composite tone into
Row plays, and without carrying out the adjustment of sample rate, improves the playing efficiency of Composite tone.
In the embodiment of the present invention, by obtaining the target of terminal by audio client before terminal plays audio accompaniment
Sample rate, if detecting that the default sample rate of audio accompaniment and target sampling rate are inconsistent, according to target sampling rate to companion
Play audio and carry out resampling processing, obtain with the consistent target audio accompaniment data of target sampling rate, then played out by terminal,
Terminal is avoided in playing process to the adjustment of sample rate, and then avoids the delay of play system bring, in addition, terminal
Recording system is also directly recorded according to target sampling rate, since the sample rate for playing with recording is identical, Composite tone
Deviation would not also occur in middle audio accompaniment and recording audio, avoid the rhythm of audio accompaniment and recording audio in Composite tone
The problem of misalignment.
Fig. 4 is a kind of structural block diagram of apparatus for processing audio provided in an embodiment of the present invention, is integrated with audio in the device
In client.Referring to fig. 4, which includes: and obtains module 401, starting module 402, resampling module 403, first to play mould
Block 404 records module 405 and synthesis module 406.
Module 401 is obtained, for obtaining the target sampling rate of terminal;
Starting module 402, for starting audio accompaniment playing function and audio recording function;
Resampling module 403 is used for after audio accompaniment playing function starting, if detecting audio accompaniment to be played
Default sample rate and the target sampling rate it is inconsistent, then according to the target sampling rate to the audio accompaniment carry out resampling at
Reason, obtains target audio accompaniment data, and the sample rate of the target audio accompaniment data is the target sampling rate;
First playing module 404 plays out the target audio accompaniment data for controlling the terminal;
Module 405 is recorded, for the terminal being controlled and being carried out according to the target sampling rate after audio recording function starting
Audio recording;
Synthesis module 406 is synthesized for the audio data of the audio data of broadcasting and recording to be carried out synthesis processing
Audio.
In the embodiment of the present invention, by obtaining the target of terminal by audio client before terminal plays audio accompaniment
Sample rate, if detecting that the default sample rate of audio accompaniment and target sampling rate are inconsistent, according to target sampling rate to companion
Play audio and carry out resampling processing, obtain with the consistent target audio accompaniment data of target sampling rate, then played out by terminal,
Terminal is avoided in playing process to the adjustment of sample rate, and then avoids the delay of play system bring, in addition, terminal
Recording system is also directly recorded according to target sampling rate, since the sample rate for playing with recording is identical, Composite tone
Deviation would not also occur in middle audio accompaniment and recording audio, avoid the rhythm of audio accompaniment and recording audio in Composite tone
The problem of misalignment.
Optionally, which includes:
Decoding unit obtains the first pulse code modulation pcm audio number for being decoded processing to the audio accompaniment
According to;
Resampling unit, for carrying out resampling processing to first PCM audio data, obtaining according to the target sampling rate
To the second PCM audio data, the sample rate of second PCM audio data is the target sampling rate;
Determination unit, for second PCM audio data to be determined as the target audio accompaniment data.
Optionally, which is specifically used for:
If the target sampling rate is greater than the default sample rate, according to the target sampling rate, to first PCM audio data
It is up-sampled, obtains second PCM audio data;
If the target sampling rate is less than the default sample rate, according to the target sampling rate, to first PCM audio data
Down-sampling is carried out, second PCM audio data is obtained.
Optionally, which is specifically used for:
The system interface for calling the terminal obtains the target sampling rate of the terminal by the system interface.
Optionally, which is specifically used for:
The audio data of broadcasting and the audio data of recording are subjected to synthesis processing;
To synthesis, treated that audio data encodes, and obtains the Composite tone.
Optionally, the device further include:
Second playing module plays out the Composite tone for controlling the terminal.
Optionally, target sampling rate is sample rate that is that terminal is supported and being located within the scope of default sample rate, or for eventually
Hold the sample rate of best performance in the sample rate supported.
It should be understood that apparatus for processing audio provided by the above embodiment is when carrying out audio processing, only with above-mentioned each
The division progress of functional module can according to need and for example, in practical application by above-mentioned function distribution by different function
Energy module is completed, i.e., the internal structure of device is divided into different functional modules, to complete whole described above or portion
Divide function.In addition, apparatus for processing audio provided by the above embodiment and audio-frequency processing method embodiment belong to same design, have
Body realizes that process is detailed in embodiment of the method, and which is not described herein again.
Fig. 5 is a kind of structural block diagram of terminal 500 provided in an embodiment of the present invention.The terminal 500 may is that intelligent hand
(Moving Picture Experts Group Audio Layer III, dynamic image are special for machine, tablet computer, MP3 player
Family's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image
Expert's compression standard audio level 4) player, laptop or desktop computer.Terminal 500 is also possible to referred to as user and sets
Other titles such as standby, portable terminal, laptop terminal, terminal console.
In general, terminal 500 includes: processor 501 and memory 502.
Processor 501 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place
Reason device 501 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field-
Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed
Logic array) at least one of example, in hardware realize.Processor 501 also may include primary processor and coprocessor, master
Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing
Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.?
In some embodiments, processor 501 can be integrated with GPU (Graphics Processing Unit, image processor),
GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 501 can also be wrapped
AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processor is for handling related machine learning
Calculating operation.
Memory 502 may include one or more computer readable storage mediums, which can
To be non-transient.Memory 502 may also include high-speed random access memory and nonvolatile memory, such as one
Or multiple disk storage equipments, flash memory device.In some embodiments, the non-transient computer in memory 502 can
Storage medium is read for storing at least one instruction, at least one instruction performed by processor 501 for realizing this Shen
Please in embodiment of the method provide audio-frequency processing method.
In some embodiments, terminal 500 is also optional includes: peripheral device interface 503 and at least one peripheral equipment.
It can be connected by bus or signal wire between processor 501, memory 502 and peripheral device interface 503.Each peripheral equipment
It can be connected by bus, signal wire or circuit board with peripheral device interface 503.Specifically, peripheral equipment includes: radio circuit
504, at least one of touch display screen 505, camera 506, voicefrequency circuit 507, positioning component 508 and power supply 509.
Peripheral device interface 503 can be used for I/O (Input/Output, input/output) is relevant outside at least one
Peripheral equipment is connected to processor 501 and memory 502.In some embodiments, processor 501, memory 502 and peripheral equipment
Interface 503 is integrated on same chip or circuit board;In some other embodiments, processor 501, memory 502 and outer
Any one or two in peripheral equipment interface 503 can realize on individual chip or circuit board, the present embodiment to this not
It is limited.
Radio circuit 504 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal.It penetrates
Frequency circuit 504 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 504 turns electric signal
It is changed to electromagnetic signal to be sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit 504 wraps
It includes: antenna system, RF transceiver, one or more amplifiers, tuner, oscillator, digital signal processor, codec chip
Group, user identity module card etc..Radio circuit 504 can be carried out by least one wireless communication protocol with other terminals
Communication.The wireless communication protocol includes but is not limited to: Metropolitan Area Network (MAN), each third generation mobile communication network (2G, 3G, 4G and 5G), wireless office
Domain net and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some embodiments, radio circuit 504 may be used also
To include the related circuit of NFC (Near Field Communication, wireless near field communication), the application is not subject to this
It limits.
Display screen 505 is for showing UI (User Interface, user interface).The UI may include figure, text, figure
Mark, video and its their any combination.When display screen 505 is touch display screen, display screen 505 also there is acquisition to show
The ability of the touch signal on the surface or surface of screen 505.The touch signal can be used as control signal and be input to processor
501 are handled.At this point, display screen 505 can be also used for providing virtual push button and/or dummy keyboard, also referred to as soft button and/or
Soft keyboard.In some embodiments, display screen 505 can be one, and the front panel of terminal 500 is arranged;In other embodiments
In, display screen 505 can be at least two, be separately positioned on the different surfaces of terminal 500 or in foldover design;In still other reality
It applies in example, display screen 505 can be flexible display screen, be arranged on the curved surface of terminal 500 or on fold plane.Even, it shows
Display screen 505 can also be arranged to non-rectangle irregular figure, namely abnormity screen.Display screen 505 can use LCD (Liquid
Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode)
Etc. materials preparation.
CCD camera assembly 506 is for acquiring image or video.Optionally, CCD camera assembly 506 include front camera and
Rear camera.In general, the front panel of terminal is arranged in front camera, the back side of terminal is arranged in rear camera.One
In a little embodiments, rear camera at least two is main camera, depth of field camera, wide-angle camera, focal length camera shooting respectively
Any one in head, to realize that main camera and the fusion of depth of field camera realize background blurring function, main camera and wide-angle
Camera fusion realizes that pan-shot and VR (Virtual Reality, virtual reality) shooting function or other fusions are clapped
Camera shooting function.In some embodiments, CCD camera assembly 506 can also include flash lamp.Flash lamp can be monochromatic warm flash lamp,
It is also possible to double-colored temperature flash lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, can be used for not
With the light compensation under colour temperature.
Voicefrequency circuit 507 may include microphone and loudspeaker.Microphone is used to acquire the sound wave of user and environment, and will
Sound wave, which is converted to electric signal and is input to processor 501, to be handled, or is input to radio circuit 504 to realize voice communication.
For stereo acquisition or the purpose of noise reduction, microphone can be separately positioned on the different parts of terminal 500 to be multiple.Mike
Wind can also be array microphone or omnidirectional's acquisition type microphone.Loudspeaker is then used to that processor 501 or radio circuit will to be come from
504 electric signal is converted to sound wave.Loudspeaker can be traditional wafer speaker, be also possible to piezoelectric ceramic loudspeaker.When
When loudspeaker is piezoelectric ceramic loudspeaker, the audible sound wave of the mankind can be not only converted electrical signals to, it can also be by telecommunications
Number the sound wave that the mankind do not hear is converted to carry out the purposes such as ranging.In some embodiments, voicefrequency circuit 507 can also include
Earphone jack.
Positioning component 508 is used for the current geographic position of positioning terminal 500, to realize navigation or LBS (Location
Based Service, location based service).Positioning component 508 can be the GPS (Global based on the U.S.
Positioning System, global positioning system), the dipper system of China, Russia Gray receive this system or European Union
The positioning component of Galileo system.
Power supply 509 is used to be powered for the various components in terminal 500.Power supply 509 can be alternating current, direct current,
Disposable battery or rechargeable battery.When power supply 509 includes rechargeable battery, which can support wired charging
Or wireless charging.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, terminal 500 further includes having one or more sensors 510.The one or more sensors
510 include but is not limited to: acceleration transducer 511, gyro sensor 512, pressure sensor 513, fingerprint sensor 514,
Optical sensor 515 and proximity sensor 516.
The acceleration that acceleration transducer 511 can detecte in three reference axis of the coordinate system established with terminal 500 is big
It is small.For example, acceleration transducer 511 can be used for detecting component of the acceleration of gravity in three reference axis.Processor 501 can
With the acceleration of gravity signal acquired according to acceleration transducer 511, touch display screen 505 is controlled with transverse views or longitudinal view
Figure carries out the display of user interface.Acceleration transducer 511 can be also used for the acquisition of game or the exercise data of user.
Gyro sensor 512 can detecte body direction and the rotational angle of terminal 500, and gyro sensor 512 can
To cooperate with acquisition user to act the 3D of terminal 500 with acceleration transducer 511.Processor 501 is according to gyro sensor 512
Following function may be implemented in the data of acquisition: when action induction (for example changing UI according to the tilt operation of user), shooting
Image stabilization, game control and inertial navigation.
The lower layer of side frame and/or touch display screen 505 in terminal 500 can be set in pressure sensor 513.Work as pressure
When the side frame of terminal 500 is arranged in sensor 513, user can detecte to the gripping signal of terminal 500, by processor 501
Right-hand man's identification or prompt operation are carried out according to the gripping signal that pressure sensor 513 acquires.When the setting of pressure sensor 513 exists
When the lower layer of touch display screen 505, the pressure operation of touch display screen 505 is realized to UI circle according to user by processor 501
Operability control on face is controlled.Operability control includes button control, scroll bar control, icon control, menu
At least one of control.
Fingerprint sensor 514 is used to acquire the fingerprint of user, collected according to fingerprint sensor 514 by processor 501
The identity of fingerprint recognition user, alternatively, by fingerprint sensor 514 according to the identity of collected fingerprint recognition user.It is identifying
When the identity of user is trusted identity out, the user is authorized to execute relevant sensitive operation, the sensitive operation packet by processor 501
Include solution lock screen, check encryption information, downloading software, payment and change setting etc..Terminal can be set in fingerprint sensor 514
500 front, the back side or side.When being provided with physical button or manufacturer Logo in terminal 500, fingerprint sensor 514 can be with
It is integrated with physical button or manufacturer Logo.
Optical sensor 515 is for acquiring ambient light intensity.In one embodiment, processor 501 can be according to optics
The ambient light intensity that sensor 515 acquires controls the display brightness of touch display screen 505.Specifically, when ambient light intensity is higher
When, the display brightness of touch display screen 505 is turned up;When ambient light intensity is lower, the display for turning down touch display screen 505 is bright
Degree.In another embodiment, the ambient light intensity that processor 501 can also be acquired according to optical sensor 515, dynamic adjust
The acquisition parameters of CCD camera assembly 506.
Proximity sensor 516, also referred to as range sensor are generally arranged at the front panel of terminal 500.Proximity sensor 516
For acquiring the distance between the front of user Yu terminal 500.In one embodiment, when proximity sensor 516 detects use
When family and the distance between the front of terminal 500 gradually become smaller, touch display screen 505 is controlled from bright screen state by processor 501
It is switched to breath screen state;When proximity sensor 516 detects user and the distance between the front of terminal 500 becomes larger,
Touch display screen 505 is controlled by processor 501 and is switched to bright screen state from breath screen state.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal 500 of structure shown in Fig. 5, can wrap
It includes than illustrating more or fewer components, perhaps combine certain components or is arranged using different components.
In the present embodiment, terminal further includes having perhaps this or more than one journey of more than one program
Sequence is stored in memory, and is configured to be executed by one or more than one processor, the one or more
Program includes the instruction for carrying out above-mentioned audio processing method provided in an embodiment of the present invention.Wherein, one or one
It include audio client in procedure above.
In another embodiment, a kind of computer readable storage medium, the computer readable storage medium are additionally provided
On the step of being stored with instruction, above-mentioned audio-frequency processing method is realized when described instruction is executed by processor.
In another embodiment, a kind of computer program product is additionally provided, when run on a computer, makes to succeed in one's scheme
Calculation machine executes above-mentioned audio-frequency processing method.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and
Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (9)
1. a kind of audio-frequency processing method, which is characterized in that be applied in audio client, which comprises
Obtain the target sampling rate of terminal;
Start audio accompaniment playing function and audio recording function;
The audio accompaniment playing function starting after, if detect audio accompaniment to be played default sample rate and the mesh
It is inconsistent to mark sample rate, then resampling processing is carried out to the audio accompaniment according to the target sampling rate, obtains target accompaniment
Audio data controls the terminal and plays out to the target audio accompaniment data, and the target audio accompaniment data are adopted
Sample rate is the target sampling rate;
After audio recording function starting, the terminal is controlled according to the target sampling rate and carries out audio recording;
The audio data of broadcasting and the audio data of recording are subjected to synthesis processing, obtain Composite tone.
2. the method as described in claim 1, which is characterized in that it is described according to the target sampling rate to the audio accompaniment into
Row resampling processing, obtains target audio accompaniment data, comprising:
Processing is decoded to the audio accompaniment, obtains the first pulse code modulation PCM audio data;
According to the target sampling rate, resampling processing is carried out to first PCM audio data, obtains the second pcm audio number
According to the sample rate of second PCM audio data is the target sampling rate;
Second PCM audio data is determined as the target audio accompaniment data.
3. according to the method described in claim 2, it is characterized in that, described according to the target sampling rate, to the first PCM
Audio data carries out resampling processing, comprising:
If the target sampling rate is greater than the default sample rate, according to the target sampling rate, to first pcm audio
Data are up-sampled, and second PCM audio data is obtained;
If the target sampling rate is less than the default sample rate, according to the target sampling rate, to first pcm audio
Data carry out down-sampling, obtain second PCM audio data.
4. the method according to claim 1, wherein the target sampling rate for obtaining terminal, comprising:
The system interface for calling the terminal obtains the target sampling rate of the terminal by the system interface.
5. the method according to claim 1, wherein the audio data by the audio data of broadcasting and recording
Synthesis processing is carried out, Composite tone is obtained, comprising:
The audio data of broadcasting and the audio data of recording are subjected to synthesis processing;
To synthesis, treated that audio data encodes, and obtains the Composite tone.
6. -5 any method according to claim 1, which is characterized in that the sound by the audio data of broadcasting and recording
Frequency is according to synthesis processing is carried out, after obtaining Composite tone, further includes:
The terminal is controlled to play out the Composite tone.
7. -5 any method according to claim 1, which is characterized in that the target sampling rate is what the terminal was supported
And it is located at the sample rate within the scope of default sample rate, or be the sample rate of best performance in the sample rate of terminal support.
8. a kind of apparatus for processing audio, which is characterized in that described device includes:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to the step of perform claim requires any one method described in 1-7.
9. a kind of computer readable storage medium, instruction is stored on the computer readable storage medium, which is characterized in that institute
State the step of realizing any one method described in claim 1-7 when instruction is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811334209.6A CN109448676B (en) | 2018-11-09 | 2018-11-09 | Audio processing method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811334209.6A CN109448676B (en) | 2018-11-09 | 2018-11-09 | Audio processing method, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109448676A true CN109448676A (en) | 2019-03-08 |
CN109448676B CN109448676B (en) | 2024-01-19 |
Family
ID=65551976
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811334209.6A Active CN109448676B (en) | 2018-11-09 | 2018-11-09 | Audio processing method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109448676B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112017622A (en) * | 2020-09-04 | 2020-12-01 | 广州趣丸网络科技有限公司 | Audio data alignment method, device, equipment and storage medium |
WO2021120795A1 (en) * | 2019-12-19 | 2021-06-24 | 腾讯科技(深圳)有限公司 | Sampling rate processing method, apparatus and system, and storage medium and computer device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101034545A (en) * | 2006-03-08 | 2007-09-12 | 海尔集团公司 | Mobile phone for playing the mixed Kara OK music and its implementation method |
CN102710857A (en) * | 2012-05-24 | 2012-10-03 | 武汉诚迈科技有限公司 | Karaoke method suitable for android smart phone |
CN106293659A (en) * | 2015-05-21 | 2017-01-04 | 阿里巴巴集团控股有限公司 | A kind of audio frequency real-time processing method, device and intelligent terminal |
CN106528040A (en) * | 2016-11-02 | 2017-03-22 | 福建星网视易信息系统有限公司 | Method and apparatus for improving audio quality of android device |
CN107481709A (en) * | 2017-08-11 | 2017-12-15 | 腾讯音乐娱乐(深圳)有限公司 | Audio data transmission method and device |
-
2018
- 2018-11-09 CN CN201811334209.6A patent/CN109448676B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101034545A (en) * | 2006-03-08 | 2007-09-12 | 海尔集团公司 | Mobile phone for playing the mixed Kara OK music and its implementation method |
CN102710857A (en) * | 2012-05-24 | 2012-10-03 | 武汉诚迈科技有限公司 | Karaoke method suitable for android smart phone |
CN106293659A (en) * | 2015-05-21 | 2017-01-04 | 阿里巴巴集团控股有限公司 | A kind of audio frequency real-time processing method, device and intelligent terminal |
CN106528040A (en) * | 2016-11-02 | 2017-03-22 | 福建星网视易信息系统有限公司 | Method and apparatus for improving audio quality of android device |
CN107481709A (en) * | 2017-08-11 | 2017-12-15 | 腾讯音乐娱乐(深圳)有限公司 | Audio data transmission method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021120795A1 (en) * | 2019-12-19 | 2021-06-24 | 腾讯科技(深圳)有限公司 | Sampling rate processing method, apparatus and system, and storage medium and computer device |
US11729236B2 (en) | 2019-12-19 | 2023-08-15 | Tencent Technology (Shenzhen) Company Limited | Sampling rate processing method, apparatus, and system, storage medium, and computer device |
CN112017622A (en) * | 2020-09-04 | 2020-12-01 | 广州趣丸网络科技有限公司 | Audio data alignment method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109448676B (en) | 2024-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110336960A (en) | Method, apparatus, terminal and the storage medium of Video Composition | |
CN110233976A (en) | The method and device of Video Composition | |
CN109033335A (en) | Audio recording method, apparatus, terminal and storage medium | |
CN109379643A (en) | Image synthesizing method, device, terminal and storage medium | |
CN108965757B (en) | Video recording method, device, terminal and storage medium | |
CN108922506A (en) | Song audio generation method, device and computer readable storage medium | |
CN110244998A (en) | Page layout background, the setting method of live page background, device and storage medium | |
CN110062252A (en) | Live broadcasting method, device, terminal and storage medium | |
CN109300482A (en) | Audio recording method, apparatus, storage medium and terminal | |
CN109729297A (en) | The method and apparatus of special efficacy are added in video | |
CN109348247A (en) | Determine the method, apparatus and storage medium of audio and video playing timestamp | |
CN110022489A (en) | Video broadcasting method, device and storage medium | |
CN109346111A (en) | Data processing method, device, terminal and storage medium | |
CN110491358A (en) | Carry out method, apparatus, equipment, system and the storage medium of audio recording | |
CN108848394A (en) | Net cast method, apparatus, terminal and storage medium | |
CN109147757A (en) | Song synthetic method and device | |
CN108881286A (en) | Method, terminal, sound-box device and the system of multimedia control | |
CN109635133A (en) | Visualize audio frequency playing method, device, electronic equipment and storage medium | |
CN109743461A (en) | Audio data processing method, device, terminal and storage medium | |
CN110418152A (en) | It is broadcast live the method and device of prompt | |
CN110266982A (en) | The method and system of song is provided in recorded video | |
CN109192218A (en) | The method and apparatus of audio processing | |
CN109547843A (en) | The method and apparatus that audio-video is handled | |
CN108831424A (en) | Audio splicing method, apparatus and storage medium | |
CN109192223A (en) | The method and apparatus of audio alignment |
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 |