Summary of the invention
The main purpose of the present invention is to provide a kind of audio-frequency processing method and devices, it is intended to improve recording or communication processIn handling and interest, promoted user experience.
To achieve these objectives, the present invention proposes a kind of audio-frequency processing method, comprising steps of
Audio-frequency information is acquired by Mike, filters out the environmental noise in the audio-frequency information;
Preset background sound is mixed into audio-frequency information all the way with the audio-frequency information for having filtered out environmental noise in real time;
Coded treatment is carried out to mixed audio-frequency information.
Preferably, described that preset background sound is mixed into audio all the way with the audio-frequency information for having filtered out environmental noise in real timeInformation includes:
The format of the background sound is decoded as pcm format by the audio file for reading preset background sound;
The sample rate of the background sound of the pcm format is converted, so that the sample rate of the background soundIt is identical as the sample rate of collected audio-frequency information;
The background sound is mixed into audio-frequency information all the way with the audio-frequency information for having filtered out environmental noise in real time.
Preferably, the environmental noise filtered out in audio-frequency information includes:
Compare the volume difference of the audio-frequency information of two Mikes acquisition;
The audio-frequency information that volume difference in the audio-frequency information of acquisition is less than preset value is filtered out as environmental noise.
Preferably, after described the step of carrying out coded treatment to mixed audio-frequency information further include: storage is outsideAudio-frequency information after sending coded treatment.
Preferably, the method also includes: in primary call or Recording Process, the background sound is recycled and is mixedIt closes or is mixed using the background sound preset times.
The present invention proposes a kind of apparatus for processing audio simultaneously, including setting unit, Mike, filters out unit and processing unit,Wherein:
Setting unit, for background sound to be arranged;
Mike, for acquiring audio-frequency information;
Unit is filtered out, for filtering out the environmental noise in the audio-frequency information;
Processing unit, for preset background sound to be mixed into audio letter all the way with the audio-frequency information for having filtered out environmental noiseBreath, and coded treatment is carried out to mixed audio-frequency information.
Preferably, the processing unit is used for:
The format of the background sound is decoded as pcm format by the audio file for reading preset background sound;
The sample rate of the background sound of the pcm format is converted, so that the sample rate of the background soundIt is identical as the sample rate of collected audio-frequency information;
The background sound is mixed into audio-frequency information all the way with the audio-frequency information for having filtered out environmental noise in real time.
Preferably, the Mike at least two, the unit that filters out are used for: comparing the audio-frequency information of two Mikes acquisitionVolume difference, using volume difference in the audio-frequency information of acquisition be less than preset value audio-frequency information filtered as environmental noiseIt removes.
Preferably, the processing unit is further used for: the audio-frequency information after storing or being sent out coded treatment.
Preferably, the processing unit is further used for: in primary call or Recording Process, the background is recycledSound mix or mixed using the background sound preset times.
A kind of audio-frequency processing method provided by the present invention, in recording or communication process, by presetting background sound,The environmental noise of the audio-frequency information currently acquired is filtered out, and background sound is mixed in real time with audio-frequency information, thus by trueReal background sound replaces with the background sound of the customized setting of user.Therefore in communication process, the background sound that other side hears is to useThe background sound of family setting, rather than the background sound under true environment, so that user can be set what background sound was in pretend oneselfEnvironment can be by being arranged white noise to achieve the purpose that protect privacy or the other side that talks in professional jargon, or for the harassing call of strangerOr similar background noise alerts other side as background sound.Both the environmental noise for having eliminated current environment, improve recording orSpeech quality, and handling and interest is improved, the individual demand of user is met, the user experience is improved.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Audio-frequency processing method of the invention can be applied to the application scenarios such as voice communication, audio recording, and the voice is logicalWords can be two people call or more people converse (such as videoconference), be also possible to the video calling based on application program, the soundIt includes recording or video recording that frequency, which is recorded,.It is described in detail by taking voice communication as an example below.
Referring to Fig. 1, audio-frequency processing method first embodiment of the invention is proposed, the audio-frequency processing method includes following stepIt is rapid:
Step S101: setting background sound
The present embodiment presets background sound before call.In specific implementation, it can be shown in the dialing interface of terminal" call setting " option increases background sound in " call setting " option and adds function choosing-item, can be with preset musical meeting, coffeeThe selection of the background sounds options for user such as shop, cinema, in-situ match can also be customized by the user the local audio file of selectionAs background sound option.The number that comes into force can also be further set, such as only come into force to primary call, or is raw to all callsEffect;Or setting application, such as be applied to particular contact, applied in address list All Contacts or stranger (i.e.Phone not in address list) etc..
It is possible to further which an audio file is arranged as background sound, two or more audio files also can be setAs background sound, and the order by merging of settable multiple audio files.It can also be provided in a communication process, be recycled pre-If background sound mixed (i.e. circulation reads (or play) preset background sound), or use preset background sound preset timesIt is mixed and (reads (or broadcasting) preset background sound preset times).
Step S102: after establishing voice communication, audio-frequency information is acquired by Mike
Step S103: the environmental noise in the audio-frequency information of acquisition is filtered out
Terminal can filter out the environmental noise in audio-frequency information using noise reduction technology in the prior art.
Preferably, terminal acquires audio-frequency information using at least two Mikes, compares the audio of any two Mike acquisitionThe volume difference of information, since user is nearest from Mike, the volume of the audio-frequency information of two collected users of Mike is poorIt is worth larger, so that the audio-frequency information of the smaller such as less than preset value of volume difference be filtered out as noise, the preset value is excellentIt is selected as 6 decibels.
Step S104: preset background sound is mixed into audio letter all the way with the audio-frequency information for having filtered out environmental noise in real timeBreath
Specifically, as shown in Fig. 2, terminal reads the audio file of (or broadcasting) preset background sound, institute by playerStating audio file can be the audio formats such as WMV, MP3, WAV, MP4, AVI, FLV.During reading audio file, sound is parsedThe format of background sound is decoded as pulse code modulation (PCM, Pulse Code Modulation) lattice by codec by railFormula;The sample rate of the background sound of PCM format is converted again, so that the sample rate of background sound and collected audio-frequency informationSample rate (usually 8K) is identical;Background sound is finally mixed into audio all the way with the audio-frequency information for having filtered out environmental noise in real timeInformation.
Step S105: coded treatment is carried out to mixed audio-frequency information
Terminal carries out coded treatment to mixed audio-frequency information by codec.
Step S106: the audio-frequency information after being sent out coded treatment
Terminal is sent out the audio-frequency information after coded treatment by radio-frequency module.To so that partner was heardBackground sound is the background sound of user setting, rather than the background sound under true environment, so that background sound can be set to pretend in userThe environment oneself being in, to achieve the purpose that protect privacy or the other side that talks in professional jargon, or for the harassing call of stranger, Ke YitongIt crosses setting white noise or similar background noise alerts other side as background sound.Handling and interest is improved, use is metThe individual demand at family, the user experience is improved.
Referring to Fig. 3, audio-frequency processing method second embodiment of the invention is proposed, the audio-frequency processing method includes following stepIt is rapid:
Step S201: in communication process, background sound is set
The present embodiment allows the background sound that background sound is arranged in user at any time in communication process or change is set.It is specific realOn now, " more " option can be shown in the dialing interface of terminal, increase background sound in " more " option and add function choosing-item.The specific setting method of background sound in the present embodiment is identical as the step S101 in first embodiment, and details are not described herein.
Step S202: audio-frequency information is acquired by Mike
Step S203: the environmental noise in the audio-frequency information of acquisition is filtered out
Step S204: preset background sound is mixed into audio letter all the way with the audio-frequency information for having filtered out environmental noise in real timeBreath
Step S205: coded treatment is carried out to mixed audio-frequency information
Step S206: the audio-frequency information after being sent out coded treatment
The present embodiment allows the background sound that background sound is arranged in user at any time in communication process or change is set, so that withFamily can be changed and be handled in real time according to the actual situation, further improve handling, the user experience is improved.
In certain embodiments, the audio-frequency processing method also can be applied to audio recording process, and background sound can beIt is arranged before audio recording or is configured during audio recording, the place in specific processing method and voice call processReason method is roughly the same, and difference is the last processing to the audio-frequency information after coded treatment.It is carried out if recording, video recording applicationAudio-frequency information after coded treatment is then stored in local after the completion of recording by audio recording;Sound is carried out if the application such as wechatFrequency is recorded, then the audio-frequency information after coded treatment is sent to corresponding contact person by wechat after the completion of recording.PrimaryIn Recording Process, background sound can be recycled and mix or mixed using background sound preset times.
Referring to fig. 4, one embodiment of apparatus for processing audio of the invention is proposed, the apparatus for processing audio includes that setting is singleMember, filters out unit and processing unit at Mike.
Setting unit: for background sound to be arranged.
Background sound can be arranged before call or recording in setting unit, can also set at any time in call or Recording ProcessSet or change background sound.Specifically, can be set in option or recording or call interface increase background sound addition function choosing-item,It can be selected, can also be made by oneself by user with the background sounds options for user such as preset musical meeting, coffee-house, cinema, in-situ matchJustice selects local audio file as background sound option.The number that comes into force can also be further set, such as only to primary call lifeEffect, or come into force to all calls;Or setting application, such as it is applied to particular contact, applied in address listAll Contacts or stranger's (phone i.e. not in address list) etc..
It is possible to further which an audio file is arranged as background sound, two or more audio files also can be setAs background sound, and the order by merging of settable multiple audio files.It can also be provided in primary call or Recording Process, circulation(i.e. circulation reads (or broadcasting) preset background sound) is mixed using preset background sound, or pre- using preset background soundIf number is mixed and (reads (or broadcasting) preset background sound preset times).
Mike: it for acquiring audio-frequency information, and is sent to processing unit or filters out unit.
Filter out unit: the environmental noise in audio-frequency information for filtering out acquisition.
Environmental noise in audio-frequency information can be filtered out using noise reduction technology in the prior art by filtering out unit.
Preferably, apparatus for processing audio acquires audio-frequency information using at least two Mikes, filters out unit more any twoThe volume difference of the audio-frequency information of a Mike's acquisition, since target sound source is usually nearest from Mike, two Mikes are collectedTarget sound source audio-frequency information volume difference it is larger, so that the audio-frequency information of the smaller such as less than preset value of volume difference be madeIt is filtered out for noise, the preset value is preferably 6 decibels.
Processing unit: for the setting parameter according to setting unit, respective handling is carried out.If setting unit is not provided with backJing Yin then directly receives the collected audio-frequency information of Mike;If setting unit is provided with background sound, controlling Mike will be collectedAudio-frequency information be sent to filter out unit carry out environmental noise filter out processing, by preset background sound with filtered out environmental noiseAudio-frequency information is mixed into audio-frequency information all the way in real time, and carries out coded treatment to mixed audio-frequency information.
Specifically, as shown in Fig. 2, processing unit reads the audio text of (or broadcasting) preset background sound by playerPart, the audio file can be the audio formats such as WMV, MP3, WAV, MP4, AVI, FLV.During reading audio file,Track is parsed, the format of background sound is decoded as by pulse code modulation (PCM, Pulse Code by codecModulation) format;The sample rate of the background sound of PCM format is converted again, so that the sample rate and acquisition of background soundThe sample rate (usually 8K) of the audio-frequency information arrived is identical;It is finally that background sound and the audio-frequency information that has filtered out environmental noise is real-timeIt is mixed into audio-frequency information all the way, and coded treatment is carried out to mixed audio-frequency information by codec.
If apparatus for processing audio currently passes through recording, video recording application carries out audio recording, processing unit is being recordedThe audio-frequency information after coded treatment is stored in local after;If passing through the application such as wechat carries out audio recording, processing unitThe audio-frequency information after coded treatment is then sent to by corresponding contact person by wechat after the completion of recording.
If apparatus for processing audio is currently carrying out voice communication, processing form unit passes through radio-frequency module and is sent out volumeCode treated audio-frequency information.To, so that the background sound that other side hears is the background sound of user setting, rather than under true environmentBackground sound so that background sound can be set to pretend the environment oneself being in user, to reach protection privacy or the other side that talks in professional jargonPurpose, or for the harassing call of stranger, can by setting white noise or similar background noise as background sound comeAlert other side.Handling and interest is improved, meets the individual demand of user, the user experience is improved.
Technical characteristic in above method embodiment is corresponding applicable in the present apparatus, no longer repeats here.
It should be understood that apparatus for processing audio provided by the above embodiment is when carrying out audio processing, only with above-mentioned eachThe division progress of functional module can according to need and for example, in practical application by above-mentioned function distribution by different functionIt can module completion.In addition, apparatus for processing audio provided by the above embodiment and audio-frequency processing method embodiment belong to same design,Its specific implementation process is detailed in embodiment of the method, and which is not described herein again.
Those of ordinary skill in the art will appreciate that implementing the method for the above embodiments can lead toProgram is crossed to control relevant hardware and complete, the program can be stored in a computer readable storage medium, describedStorage medium can be ROM/RAM, disk, CD etc..
It should be understood that the above is only a preferred embodiment of the present invention, the scope of the patents of the invention cannot be therefore limited,It is all to utilize equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content, it is applied directly or indirectly inOther related technical areas are included within the scope of the present invention.