WO2017032120A1 - Playing processing method and apparatus for audio switching - Google Patents

Playing processing method and apparatus for audio switching Download PDF

Info

Publication number
WO2017032120A1
WO2017032120A1 PCT/CN2016/084299 CN2016084299W WO2017032120A1 WO 2017032120 A1 WO2017032120 A1 WO 2017032120A1 CN 2016084299 W CN2016084299 W CN 2016084299W WO 2017032120 A1 WO2017032120 A1 WO 2017032120A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
played
gain
data
audio data
Prior art date
Application number
PCT/CN2016/084299
Other languages
French (fr)
Chinese (zh)
Inventor
焦新旺
王云华
Original Assignee
深圳Tcl数字技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳Tcl数字技术有限公司 filed Critical 深圳Tcl数字技术有限公司
Publication of WO2017032120A1 publication Critical patent/WO2017032120A1/en

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03GCONTROL OF AMPLIFICATION
    • H03G3/00Gain control in amplifiers or frequency changers without distortion of the input signal
    • H03G3/20Automatic control

Definitions

  • the present invention relates to the field of audio processing, and in particular, to a playback processing method and apparatus for audio switching.
  • smart TVs can implement multi-screen interaction, that is, simultaneously process different program content on different split screens, for example, Audio files on your smartphone are played on your smart TV.
  • the smart TV is likely to play the program with the sound, and if there is no playback process when the audio is switched, the program is currently playing the TV.
  • the main object of the present invention is to provide a playback processing method and apparatus for audio switching, which aims to solve the technical problem of interference noise generated when different audio devices perform audio switching.
  • the present invention provides a playback processing method during audio switching, and the playback processing method during the audio switching includes:
  • Gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule, wherein the gain of the corresponding audio data in the local audio data according to the preset first audio processing rule Values for gain attenuation processing include:
  • the gain enhancement processing of the gain values of the corresponding audio data in the audio data includes:
  • the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing are respectively output to the audio on the local audio device according to a preset audio output rule.
  • Decoding playback on the decoder includes:
  • the audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding playback in the second duration after the end of the output of the local audio data.
  • the method when the audio is played on the local audio device, after receiving the audio data to be played sent by the external audio device, the method includes:
  • the present invention further provides a playback processing method during audio switching, and the playback processing method during the audio switching includes:
  • the performing the gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule comprises:
  • the attenuation processing of the first gain value is performed based on the attenuation value.
  • performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule includes:
  • An enhancement process of the second gain value is performed according to the enhancement value.
  • the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing are respectively output to the audio on the local audio device according to a preset audio output rule.
  • Decoding playback on the decoder includes:
  • the audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding playback in the second duration after the end of the output of the local audio data.
  • the method when the audio is played on the local audio device, after receiving the audio data to be played sent by the external audio device, the method includes:
  • the present invention further provides a playback processing device during audio switching, where the playback processing device during audio switching includes:
  • a receiving module configured to receive audio data to be played by the external audio device when the audio is played on the local audio device
  • a gain attenuation processing module configured to perform gain attenuation processing on a gain value of the corresponding audio data in the local audio data according to a preset first audio processing rule
  • a gain enhancement processing module configured to perform gain enhancement processing on a gain value of the corresponding audio data in the audio data to be played according to a preset second audio processing rule
  • the audio playback processing module is configured to output the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to the local audio device according to a preset audio output rule Decoding playback on the audio decoder.
  • the present invention When receiving the audio data sent by the external audio device to switch with the current local playing audio, the present invention generates interference noise to avoid sudden switching, and performs gain enhancement processing on the corresponding audio data in the received audio data to be played. And performing gain attenuation processing on the corresponding audio data in the local audio data, thereby correspondingly increasing the output volume of the audio data to be played and correspondingly reducing the output volume of the local audio data, thereby solving the audio switching between the two different audio devices.
  • the generated noise interferes with the smooth transition of the audio after the switching, thereby improving the user experience.
  • FIG. 1 is a schematic flowchart of an embodiment of a playback processing method during audio switching according to the present invention
  • FIG. 2 is a schematic diagram of a refinement process of step S20 in FIG. 1;
  • step S30 in FIG. 1 is a schematic diagram of a refinement process of step S30 in FIG. 1;
  • step S40 in FIG. 1 is a schematic diagram of the refinement process of step S40 in FIG. 1;
  • FIG. 5 is a schematic flowchart diagram of another embodiment of a playback processing method during audio switching according to the present invention.
  • FIG. 6 is a schematic diagram of functional blocks of an embodiment of a playback processing apparatus during audio switching according to the present invention.
  • FIG. 1 is a schematic flowchart diagram of an embodiment of a playback processing method during audio switching according to the present invention.
  • the playback processing method during the audio switching includes:
  • Step S10 when playing audio on the local audio device, receiving audio data to be played sent by the external audio device;
  • the local audio device and the external audio device are not limited.
  • the local audio device specifically refers to the device that currently plays audio
  • the external audio device refers to the device that transmits the audio file to the local audio device.
  • the local audio device can be a smart TV, a smart phone, etc.
  • the external audio device can be a smart phone, a smart TV, or the like.
  • the external audio device can transmit the audio data to be played to the local audio device by wireless or wired.
  • Step S20 performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule
  • Step S30 performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule
  • the smooth transition processing process of the audio switching is specifically set, and the local audio data after the gain attenuation processing is continuously outputted in the smooth transition processing process, and the gain value is also enhanced by the audio data to be played.
  • the gain value is the attribute value of the audio data, that is, the volume of the played volume. Based on the user experience, in the embodiment, it is preferable to perform attenuation processing of the gain value on the exited local audio data, and perform enhancement processing of the gain value on the entered audio data to be played.
  • the gain values of all the local audio data input during the smooth transition processing time may be uniformly attenuated by a fixed value; or the corresponding comparison of the audio data input during the smooth transition processing time may be performed.
  • the high-gain value is subjected to the attenuation processing and the like, and the setting of the second audio processing rule is similar.
  • the first audio processing rule and the second audio processing rule are not limited, and may be specifically set according to actual needs. It should be noted that when the local audio data and the gain of the audio data to be played are processed correspondingly, it is necessary to consider not only the interference problem generated when the sudden switching is performed, but also the user having a good hearing experience. For example, it is slowly and slowly attenuated or slowly increased.
  • Step S40 outputting the local audio data subjected to the gain attenuation processing and the audio data to be played after performing the gain enhancement processing to the audio decoder on the local audio device according to a preset audio output rule. Decode playback on.
  • the smooth transition processing process of the audio switching includes not only the processing of the output content, but also the processing of the output mode, such as the output order of the local audio data and the audio data to be played, and the corresponding output duration, etc., in addition, due to the output content Pre-intervention processing has been carried out, so the output method also needs to be processed accordingly.
  • the setting of the audio output rule is not limited, and is specifically set according to actual needs.
  • the execution order of the above steps S20 and S30 is not limited.
  • the audio data sent by the external audio device is received to switch with the current local playing audio, interference noise is generated to avoid sudden switching, and the corresponding audio data in the received audio data to be played is performed.
  • Gain enhancement processing performing gain attenuation processing on the corresponding audio data in the local audio data, and after performing the audio switching, continuing to output the processed local audio data and outputting the processed audio data to be played for smoothing
  • the transition processing that is, corresponding to increasing the output volume of the audio data to be played and correspondingly reducing the output volume of the local audio data, thereby solving the noise interference generated when the audio is switched between the two different audio devices, and simultaneously playing the audio after switching. A smooth transition to enhance the user experience.
  • FIG. 2 is a schematic diagram of the refinement process of step S20 in FIG.
  • the foregoing step S20 includes:
  • Step S201 acquiring, in a preset first duration, a plurality of first gain values that are greater than a preset first gain threshold among the gain values of the local audio data in the first duration;
  • Step S202 calculating an average value of the selected preset first number of first gain values as an attenuation value for performing the gain attenuation processing
  • Step S203 performing attenuation processing of the first gain value according to the attenuation value.
  • the smooth transition process of the audio switching should not be too long, for example, 1 second, so the first duration can be set to 0.5-1 seconds, which is set according to actual conditions.
  • the maximum gain value is 255 and the minimum gain value is 0. Therefore, the intermediate gain value 127 (or 128) can be used as the distinguishing line of the larger gain value.
  • a gain value greater than 127 over a period of time is set to a first gain value.
  • the setting of the first gain threshold is not limited, and is specifically set according to actual needs.
  • an average value of the randomly selected preset first number of first gain values is preferably used as the attenuation value for performing the gain attenuation processing.
  • the first number of settings is not limited, for example, five first gain values are randomly selected for calculation to obtain corresponding attenuation values.
  • the attenuation value needs to be calculated and determined according to a preset calculation rule.
  • the attenuation value in the embodiment is only used as the playback process at the time of audio switching and the processing time is short, the user mainly cares about the influence of the interference noise during the audio switching, and is not very concerned about the sound effect during the processing. Therefore, in this embodiment, the average value of any number of the first gain values is preferably used as the attenuation value, and the average value of the first gain value is used to avoid the user's feeling that the switching of the audio is not natural enough because the attenuation value is set too large. It is also possible to avoid the delay in processing the delay due to the setting of the attenuation value being too small, thereby affecting the user experience.
  • the attenuation processing of the first gain value is performed based on the calculated attenuation value. For example, if the first gain value is 250, 140, 190, 210, 170, ... in the order of play, the attenuation value is 192, and the corresponding attenuation values after the attenuation processing are 58, 0, 0, 18, 0 in order. .... It should be noted that since the gain value has a certain value range, that is, has a maximum value and a minimum value, when the attenuation process of the gain value is performed, the gain value after the processed gain value is less than or equal to the minimum value is recorded as the minimum value. value. For example, when the gain value is less than zero, it is recorded as zero.
  • This embodiment is a preferred embodiment of performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data.
  • the attenuation processing of the gain value of the local audio data is not limited to the above manner.
  • the first gain value is sequentially 250, 140, 190, 210, 170, ... in the order of playback, and the corresponding gain values after the attenuation processing are sequentially
  • the values of 100, 90, 80, 70, 60, ..., that is, the gain values are sequentially attenuated by 150, 50, 110, 140, 110..., and the attenuation processing methods are different, and the corresponding audio output effects are also different.
  • FIG. 3 is a schematic diagram of the refinement process of step S30 in FIG.
  • the foregoing step S30 includes:
  • a second second gain value of the gain value of the to-be-played audio data in the second duration is less than a preset second gain threshold, in a preset second duration;
  • Step S302 calculating an average value of the selected preset second quantity of second gain values as an enhancement value for performing gain enhancement processing
  • Step S303 performing enhancement processing of the second gain value according to the enhancement value.
  • the smooth transition process of the audio switching should not be too long, for example, 1 second, so the second duration can be set to 0.5-1 seconds, which is set according to the actual situation.
  • the intermediate gain value 127 (or 128) can be used as the distinguishing line of the smaller gain value, that is, the first A gain value of less than 127 over a period of time is set to a second gain value.
  • the setting of the second gain threshold is not limited, and is specifically set according to actual needs.
  • an average value of the randomly selected preset second number of second gain values is preferably used as the enhancement value for performing the gain enhancement processing.
  • the second number of settings is not limited. For example, five second gain values are randomly selected for calculation to obtain corresponding enhancement values.
  • the enhancement value needs to be calculated and determined according to a preset calculation rule.
  • the enhancement value in the embodiment is only used as the playback process at the time of audio switching and the processing time is short, the user mainly cares about the influence of the interference noise during the audio switching, and is not very concerned about the sound effect during the processing.
  • an average value of any number of second gain values is preferably used as an enhancement value, and an average value of the second gain values is used to avoid that the user feels that the switching of the audio is not natural enough due to the excessive setting of the enhancement value. It is also possible to avoid the delay in processing the delay due to the setting of the attenuation value being too small, thereby affecting the user experience.
  • the attenuation processing of the second gain value is sequentially performed in the playback order of the audio data corresponding to the second gain value in the second duration.
  • the enhancement value is 68
  • the corresponding enhanced gain values are 118, 138, 98, 158, 168, respectively.
  • the gain value has a certain value range, that is, has a maximum value and a minimum value
  • the gain value after the processed gain value is greater than or equal to the maximum value is recorded as the maximum value. value. For example, if the gain value is greater than 255, it is recorded as 255.
  • This embodiment is a preferred embodiment of performing a gain enhancement process on the gain value of the corresponding audio data in the local audio data.
  • the attenuation processing of the gain value of the local audio data is not limited to the above manner.
  • the second gain value is sequentially 50, 70, 30, 90, 100, ... in the order of playback, and the corresponding gain values after the enhancement processing are sequentially
  • the gain value is sequentially enhanced by 50, 40, 90, 40, 40..., and the enhanced processing manner is different, and the corresponding audio output effects are also different.
  • the interference noise caused by the volume being too small when the audio to be played is switched is prevented, and the volume of the audio to be played is smoothed during the smooth transition process of the audio switching. Enhance the rise and improve the user experience.
  • FIG. 4 is a schematic diagram of the refinement process of step S40 in FIG.
  • the foregoing step S40 includes:
  • Step S401 the local audio data after the gain attenuation processing is output to the audio decoder on the local audio device for decoding and playing in the first duration after the start of the output of the local audio data;
  • Step S402 the audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding and playing in the second duration after the end of the output of the local audio data.
  • the smoothing transition process of an audio switching is continued after the switching instruction is started to continue the output of the local audio, that is, the local audio data after the attenuation processing is output.
  • the first time duration is 500 milliseconds
  • the second time length is 500 milliseconds
  • the local audio data after the attenuation processing is outputted within 0 to 500 milliseconds after the start, and the audio data to be played after the enhanced processing is outputted within 500 to 1000 milliseconds, and then the audio is smoothly processed during the smooth transition process of the audio switching.
  • the gain is first attenuated and then enhanced, thereby solving the noise interference generated when the audio is switched between two different audio devices, and the audio playback can be smoothly transitioned during the audio switching process to enhance the user experience.
  • FIG. 5 is a schematic flowchart diagram of another embodiment of a playback processing method during audio switching according to the present invention.
  • the method includes:
  • Step S50 Calculate a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data.
  • Step S60 determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
  • Step S70 if yes, determining that the received audio data to be played is interference data and stopping performing playback processing on the interference data.
  • the audio data to be played can be decoded and played after being transmitted at one time, and can also be decoded and played while being transmitted, and is specifically set according to actual needs.
  • the receiving end that is, the local audio device
  • the receiving end needs to allocate corresponding storage space to the received audio data.
  • the sampling frequency is 8KHZ
  • the sampling digit is 16 digits
  • the total audio duration is 2 minutes
  • a preset threshold data amount for example, 1 KB, if it is greater than 1 KB, determining audio data; If it is less than or equal to 1 KB, it is judged to be abnormal audio data, that is, interference data, and if it is interference data, playback processing of audio switching is not required.
  • FIG. 6 is a schematic diagram of functional blocks of an embodiment of a playback processing apparatus during audio switching according to the present invention.
  • the playback processing device during audio switching includes:
  • the receiving module 10 is configured to receive audio data to be played by the external audio device when the audio is played on the local audio device;
  • the local audio device and the external audio device are not limited.
  • the local audio device specifically refers to the device that currently plays audio
  • the external audio device refers to the device that transmits the audio file to the local audio device.
  • the local audio device can be a smart TV, a smart phone, etc.
  • the external audio device can be a smart phone, a smart TV, or the like.
  • the external audio device can transmit the audio data to be played to the local audio device by wireless or wired.
  • the gain attenuation processing module 20 is configured to perform gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule;
  • the gain enhancement processing module 30 is configured to perform gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule;
  • a smooth transition process of audio switching is set, and in the smooth transition process, the local audio data processed by the gain attenuation processing module 20 is continuously output, and the gain enhancement processing module 30 also plays the same.
  • the audio data is subjected to enhancement processing of the gain value.
  • the gain value is the attribute value of the audio data, that is, the volume of the played volume. Based on the user experience, in the embodiment, it is preferable to perform attenuation processing of the gain value on the exited local audio data, and perform enhancement processing of the gain value on the entered audio data to be played.
  • the gain values of all the local audio data input during the smooth transition processing time may be uniformly attenuated by a fixed value; or the corresponding comparison of the audio data input during the smooth transition processing time may be performed.
  • the high-gain value is subjected to the attenuation processing and the like, and the setting of the second audio processing rule is similar.
  • the first audio processing rule and the second audio processing rule are not limited, and may be specifically set according to actual needs. It should be noted that when the local audio data and the gain of the audio data to be played are processed correspondingly, it is necessary to consider not only the interference problem generated when the sudden switching is performed, but also the user having a good hearing experience. For example, it is slowly and slowly attenuated or slowly increased.
  • the audio playback processing module 40 is configured to output the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to the local audio device according to a preset audio output rule. Decoding playback on the upper audio decoder.
  • the smooth transition processing process of the audio switching includes not only the processing of the output content, but also the processing of the output mode, such as the output order of the local audio data and the audio data to be played, and the corresponding output duration, etc., in addition, due to the output content Pre-intervention processing has been carried out, so the output method also needs to be processed accordingly.
  • the setting of the audio output rule is not limited, and is specifically set according to actual needs.
  • the interference noise is generated to avoid the sudden switching
  • the gain enhancement processing module 30 is used to receive the to-be-played audio data.
  • the corresponding audio data is subjected to gain enhancement processing, and the gain attenuation processing is performed on the corresponding audio data in the local audio data by the gain attenuation processing module 20, and after performing the audio switching, the processed local audio data is continuously output and the output is processed.
  • the audio data to be played back is used for smooth transition processing, that is, corresponding to increasing the output volume of the audio data to be played and correspondingly reducing the output volume of the local audio data, thereby solving the problem of audio switching between two different audio devices.
  • the noise interference is simultaneously enabled by the audio playback processing module 40 to enable a smooth transition after the audio switching, thereby improving the user experience.

Abstract

A playing processing method and apparatus for audio switching. The method comprises: receiving audio data to be played sent from an external audio device when audio is played on a local audio device (S10); performing gain reduction processing on a gain value of corresponding audio data in local audio data (S20), and performing gain enhancement processing on a gain value of corresponding audio data in the audio data to be played (S30); and respectively outputting the local audio data subjected to the gain reduction processing and the audio data to be played subjected to the gain enhancement processing to an audio decoder on the local audio device for decoding and playing (S40). Thus, noise interference produced by audio switching between two different audio devices is avoided, and at the same time, playing after audio switching can have a smooth transition, thereby improving the user experience.

Description

音频切换时的播放处理方法及装置  Playback processing method and device during audio switching
技术领域Technical field
本发明涉及音频处理领域,尤其涉及音频切换时的播放处理方法及装置。The present invention relates to the field of audio processing, and in particular, to a playback processing method and apparatus for audio switching.
背景技术Background technique
随着智能音频设备的技术发展,不同智能设备之间进行数据的交互以满足用户的使用需求,比如智能电视可以实现多屏互动,也即同时在不同分屏上处理不同的节目内容,例如将智能手机上的音频文件在智能电视上进行播放。然而,当用户将智能手机上的音频文件推送到智能电视上播放时,智能电视很可能正在播放带有声音的节目,此时如果没有进行音频切换时的播放处理,则当电视当前播放节目的声音突然切换为手机推送过来的音频声音时,很可能造成音频声音的突变,进而产生泊泊噪音或者瞬间的干扰啸叫声音,这不仅使得电视端的音响喇叭容易出现损坏,同时也降低了用户使用体验。With the development of technology of intelligent audio devices, data interaction between different smart devices can meet the needs of users. For example, smart TVs can implement multi-screen interaction, that is, simultaneously process different program content on different split screens, for example, Audio files on your smartphone are played on your smart TV. However, when the user pushes the audio file on the smart phone to play on the smart TV, the smart TV is likely to play the program with the sound, and if there is no playback process when the audio is switched, the program is currently playing the TV. When the sound is suddenly switched to the audio sound pushed by the mobile phone, it may cause a sudden change of the audio sound, which may cause a parking noise or an instantaneous disturbance of the howling sound, which not only makes the audio speaker on the television end susceptible to damage, but also reduces the user's use. Experience.
发明内容Summary of the invention
本发明的主要目的在于提供一种音频切换时的播放处理方法及装置,旨在解决不同音频设备进行音频切换时所产生的干扰噪声的技术问题。The main object of the present invention is to provide a playback processing method and apparatus for audio switching, which aims to solve the technical problem of interference noise generated when different audio devices perform audio switching.
为实现上述目的,本发明提供一种音频切换时的播放处理方法,所述音频切换时的播放处理方法包括:In order to achieve the above object, the present invention provides a playback processing method during audio switching, and the playback processing method during the audio switching includes:
当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;Receiving audio data to be played sent by the external audio device when playing audio on the local audio device;
根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理,其中,所述根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理包括:And performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule, wherein the gain of the corresponding audio data in the local audio data according to the preset first audio processing rule Values for gain attenuation processing include:
在预设的第一时长内,获取所述第一时长内的所述本地音频数据的增益值中大于预设第一增益阈值的若干第一增益值;计算选择的预设第一数量的第一增益值的平均值以作为进行增益衰减处理的衰减值;根据所述衰减值,进行第一增益值的衰减处理;Obtaining, in a preset first duration, a plurality of first gain values of the gain value of the local audio data in the first duration that are greater than a preset first gain threshold; calculating a selected preset first number of the first An average value of a gain value as an attenuation value for performing a gain attenuation process; and performing attenuation processing of the first gain value according to the attenuation value;
根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理,其中,所述根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理包括:Performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule, wherein the to-be-played according to the preset second audio processing rule The gain enhancement processing of the gain values of the corresponding audio data in the audio data includes:
在预设的第二时长内,获取所述第二时长内的所述待播放的音频数据的增益值中小于预设第二增益阈值的若干第二增益值;计算选择的预设第二数量的第二增益值的平均值以作为进行增益增强处理的增强值;根据所述增强值,进行第二增益值的增强处理;Obtaining, in a preset second duration, a plurality of second gain values of the gain value of the to-be-played audio data in the second duration that are less than a preset second gain threshold; calculating the selected preset second quantity An average value of the second gain value is used as an enhancement value for performing a gain enhancement process; and an enhancement process of the second gain value is performed according to the enhancement value;
根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。Outputting the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to an audio decoder on the local audio device for decoding according to a preset audio output rule Play.
优选地,所述根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放包括:Preferably, the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing are respectively output to the audio on the local audio device according to a preset audio output rule. Decoding playback on the decoder includes:
在所述本地音频数据输出开始后的所述第一时长内,将进行增益衰减处理后的所述本地音频数据输出到所述本地音频设备上的音频解码器上进行解码播放;And outputting the local audio data subjected to the gain attenuation processing to an audio decoder on the local audio device for decoding and playing during the first duration after the start of the output of the local audio data;
在所述本地音频数据输出结束后的所述第二时长内,将进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。The audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding playback in the second duration after the end of the output of the local audio data.
优选地,所述当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据之后包括:Preferably, when the audio is played on the local audio device, after receiving the audio data to be played sent by the external audio device, the method includes:
根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;Calculating a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;Determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
若是,则确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。If yes, it is determined that the received audio data to be played is interference data and stops performing playback processing on the interference data.
为实现上述目的,本发明还提供一种音频切换时的播放处理方法,所述音频切换时的播放处理方法包括:In order to achieve the above object, the present invention further provides a playback processing method during audio switching, and the playback processing method during the audio switching includes:
当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;Receiving audio data to be played sent by the external audio device when playing audio on the local audio device;
根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理;And performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to a preset first audio processing rule;
根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理;And performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule;
根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频的音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。Outputting the audio data of the local audio subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to the audio decoder on the local audio device according to a preset audio output rule Perform decoding playback.
优选地,所述根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理包括:Preferably, the performing the gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule comprises:
在预设的第一时长内,获取所述第一时长内的所述本地音频数据的增益值中大于预设第一增益阈值的若干第一增益值;Obtaining, in a preset first duration, a plurality of first gain values of the gain value of the local audio data in the first duration that are greater than a preset first gain threshold;
计算选择的预设第一数量的第一增益值的平均值以作为进行增益衰减处理的衰减值;Calculating an average of the selected first number of first gain values of the selected one as the attenuation value for performing the gain attenuation process;
根据所述衰减值,进行第一增益值的衰减处理。The attenuation processing of the first gain value is performed based on the attenuation value.
优选地,根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理包括:Preferably, performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule includes:
在预设的第二时长内,获取所述第二时长内的所述待播放的音频数据的增益值中小于预设第二增益阈值的若干第二增益值;Obtaining, in a preset second duration, a plurality of second gain values of the gain value of the to-be-played audio data in the second duration that are less than a preset second gain threshold;
计算选择的预设第二数量的第二增益值的平均值以作为进行增益增强处理的增强值;Calculating an average of the selected second number of second gain values of the selected one as an enhancement value for performing gain enhancement processing;
根据所述增强值,进行第二增益值的增强处理。An enhancement process of the second gain value is performed according to the enhancement value.
优选地,所述根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放包括:Preferably, the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing are respectively output to the audio on the local audio device according to a preset audio output rule. Decoding playback on the decoder includes:
在所述本地音频数据输出开始后的所述第一时长内,将进行增益衰减处理后的所述本地音频数据输出到所述本地音频设备上的音频解码器上进行解码播放;And outputting the local audio data subjected to the gain attenuation processing to an audio decoder on the local audio device for decoding and playing during the first duration after the start of the output of the local audio data;
在所述本地音频数据输出结束后的所述第二时长内,将进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。The audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding playback in the second duration after the end of the output of the local audio data.
优选地,所述当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据之后包括:Preferably, when the audio is played on the local audio device, after receiving the audio data to be played sent by the external audio device, the method includes:
根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;Calculating a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;Determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
若是,则确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。If yes, it is determined that the received audio data to be played is interference data and stops performing playback processing on the interference data.
进一步地,为实现上述目的,本发明还提供一种音频切换时的播放处理装置,所述音频切换时的播放处理装置包括:Further, in order to achieve the above object, the present invention further provides a playback processing device during audio switching, where the playback processing device during audio switching includes:
接收模块,用于当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;a receiving module, configured to receive audio data to be played by the external audio device when the audio is played on the local audio device;
增益衰减处理模块,用于根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理;a gain attenuation processing module, configured to perform gain attenuation processing on a gain value of the corresponding audio data in the local audio data according to a preset first audio processing rule;
增益增强处理模块,用于根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理;a gain enhancement processing module, configured to perform gain enhancement processing on a gain value of the corresponding audio data in the audio data to be played according to a preset second audio processing rule;
音频播放处理模块,用于根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。The audio playback processing module is configured to output the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to the local audio device according to a preset audio output rule Decoding playback on the audio decoder.
本发明在接收到外部音频设备发送的音频数据以与当前本地播放音频进行切换时,为避免突然切换而导致产生干扰噪音,通过对接收到的待播放音频数据中的相应音频数据进行增益增强处理,而对本地音频数据中的相应音频数据进行增益衰减处理,从而对应提高待播放音频数据的输出音量以及对应降低本地音频数据的输出音量,进而解决了两种不同音频设备之间进行音频切换时所产生的噪声干扰,同时使音频切换后的播放能够进行平滑过渡进而提升用户使用体验。When receiving the audio data sent by the external audio device to switch with the current local playing audio, the present invention generates interference noise to avoid sudden switching, and performs gain enhancement processing on the corresponding audio data in the received audio data to be played. And performing gain attenuation processing on the corresponding audio data in the local audio data, thereby correspondingly increasing the output volume of the audio data to be played and correspondingly reducing the output volume of the local audio data, thereby solving the audio switching between the two different audio devices. The generated noise interferes with the smooth transition of the audio after the switching, thereby improving the user experience.
附图说明DRAWINGS
图1为本发明音频切换时的播放处理方法一实施例的流程示意图;1 is a schematic flowchart of an embodiment of a playback processing method during audio switching according to the present invention;
图2为图1中步骤S20的细化流程示意图;2 is a schematic diagram of a refinement process of step S20 in FIG. 1;
图3为图1中步骤S30的细化流程示意图;3 is a schematic diagram of a refinement process of step S30 in FIG. 1;
图4为图1中步骤S40细化流程示意图;4 is a schematic diagram of the refinement process of step S40 in FIG. 1;
图5为本发明音频切换时的播放处理方法另一实施例的流程示意图;FIG. 5 is a schematic flowchart diagram of another embodiment of a playback processing method during audio switching according to the present invention; FIG.
图6为本发明音频切换时的播放处理装置一实施例的功能模块示意图。FIG. 6 is a schematic diagram of functional blocks of an embodiment of a playback processing apparatus during audio switching according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
参照图1,图1为本发明音频切换时的播放处理方法一实施例的流程示意图。本实施例中,所述音频切换时的播放处理方法包括:Referring to FIG. 1, FIG. 1 is a schematic flowchart diagram of an embodiment of a playback processing method during audio switching according to the present invention. In this embodiment, the playback processing method during the audio switching includes:
步骤S10,当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;Step S10, when playing audio on the local audio device, receiving audio data to be played sent by the external audio device;
本实施例中,本地音频设备及外部音频设备并不限定,本地音频设备具体是指当前播放音频的设备,而外部音频设备则是向本地音频设备传送音频文件的设备。比如本地音频设备可以为智能电视、智能手机等,外部音频设备可以为智能手机、智能电视等。外部音频设备可以通过无线或有线方式向本地音频设备传送待播放的音频数据。In this embodiment, the local audio device and the external audio device are not limited. The local audio device specifically refers to the device that currently plays audio, and the external audio device refers to the device that transmits the audio file to the local audio device. For example, the local audio device can be a smart TV, a smart phone, etc., and the external audio device can be a smart phone, a smart TV, or the like. The external audio device can transmit the audio data to be played to the local audio device by wireless or wired.
步骤S20,根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理;Step S20, performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule;
步骤S30,根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理;Step S30, performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule;
在本地音频播放突然中断并进行外部音频的播放切换时,如果当前本地音频播放的声音音量特别高,比如赛车游戏声音;而切换播放的声音音量却很低,此时将会造成音频声音的突变,产生干扰啸叫的声音,从而使用户感觉不适。因此,需要对音频切换时的播放进行平滑过渡处理,以降低切换过程中所产生的干扰声音。When the local audio playback is suddenly interrupted and the external audio playback is switched, if the current local audio playback sound volume is particularly high, such as the racing game sound; and the volume of the switched playback sound is very low, this will cause a sudden change in the audio sound. , causing a sound that interferes with howling, thereby making the user feel uncomfortable. Therefore, it is necessary to perform smooth transition processing on the playback at the time of audio switching to reduce the interference sound generated during the switching process.
本实施例中,具体通过设置一音频切换的平滑过渡处理过程,并在此平滑过渡处理过程内继续输出经过增益衰减处理后的本地音频数据,同时也对待播放的音频数据进行增益值的增强处理。增益值是音频数据所具有的属性值,也即播放的音量大小。基于用户使用感受,本实施例中优选对退出的本地音频数据进行增益值的衰减处理,而对进入的待播放音频数据进行增益值的增强处理。对于第一音频处理规则的设置,例如,可以将平滑过渡处理时间内输入的所有本地音频数据的增益值都统一衰减一固定值;或者可以将平滑过渡处理时间内输入的音频数据中对应的较高增益值进行衰减处理等,对于第二音频处理规则的设置类似,本实施例中对第一音频处理规则与第二音频处理规则并不限定,具体可根据实际需要进行设置。需要说明的是,在对本地音频数据以及待播放音频数据的增益进行相应处理时,不仅需要考虑到既要能解决突然切换时所产生的干扰问题,同时也要使用户具有较好的听觉感受,比如比较平滑缓和地慢慢衰减或慢慢增强等。In this embodiment, the smooth transition processing process of the audio switching is specifically set, and the local audio data after the gain attenuation processing is continuously outputted in the smooth transition processing process, and the gain value is also enhanced by the audio data to be played. . The gain value is the attribute value of the audio data, that is, the volume of the played volume. Based on the user experience, in the embodiment, it is preferable to perform attenuation processing of the gain value on the exited local audio data, and perform enhancement processing of the gain value on the entered audio data to be played. For the setting of the first audio processing rule, for example, the gain values of all the local audio data input during the smooth transition processing time may be uniformly attenuated by a fixed value; or the corresponding comparison of the audio data input during the smooth transition processing time may be performed. The high-gain value is subjected to the attenuation processing and the like, and the setting of the second audio processing rule is similar. In the embodiment, the first audio processing rule and the second audio processing rule are not limited, and may be specifically set according to actual needs. It should be noted that when the local audio data and the gain of the audio data to be played are processed correspondingly, it is necessary to consider not only the interference problem generated when the sudden switching is performed, but also the user having a good hearing experience. For example, it is slowly and slowly attenuated or slowly increased.
步骤S40,根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。Step S40, outputting the local audio data subjected to the gain attenuation processing and the audio data to be played after performing the gain enhancement processing to the audio decoder on the local audio device according to a preset audio output rule. Decode playback on.
音频切换的平滑过渡处理过程不仅包括对输出内容的处理,同时也还包括对输出方式的处理,比如本地音频数据与待播放音频数据的输出顺序以及对应的输出时长等,此外,由于对输出内容进行了预先干预处理,因此,输出方式也需进行相应处理等。本实施例中,对于音频输出规则的设置不限,具体根据实际需要进行设置。The smooth transition processing process of the audio switching includes not only the processing of the output content, but also the processing of the output mode, such as the output order of the local audio data and the audio data to be played, and the corresponding output duration, etc., in addition, due to the output content Pre-intervention processing has been carried out, so the output method also needs to be processed accordingly. In this embodiment, the setting of the audio output rule is not limited, and is specifically set according to actual needs.
本实施例中,上述步骤S20与S30的执行顺序不限。本实施例中,在接收到外部音频设备发送的音频数据以与当前本地播放音频进行切换时,为避免突然切换而导致产生干扰噪音,通过对接收到的待播放音频数据中的相应音频数据进行增益增强处理,而对本地音频数据中的相应音频数据进行增益衰减处理,并在执行音频切换后,继续输出经过处理后的本地音频数据以及输出经过处理后的待播放音频数据以用于进行平滑过渡处理,即对应提高待播放音频数据的输出音量以及对应降低本地音频数据的输出音量,进而解决了两种不同音频设备之间进行音频切换时所产生的噪声干扰,同时使音频切换后的播放能够进行平滑过渡进而提升用户使用体验。In this embodiment, the execution order of the above steps S20 and S30 is not limited. In this embodiment, when the audio data sent by the external audio device is received to switch with the current local playing audio, interference noise is generated to avoid sudden switching, and the corresponding audio data in the received audio data to be played is performed. Gain enhancement processing, performing gain attenuation processing on the corresponding audio data in the local audio data, and after performing the audio switching, continuing to output the processed local audio data and outputting the processed audio data to be played for smoothing The transition processing, that is, corresponding to increasing the output volume of the audio data to be played and correspondingly reducing the output volume of the local audio data, thereby solving the noise interference generated when the audio is switched between the two different audio devices, and simultaneously playing the audio after switching. A smooth transition to enhance the user experience.
参照图2,图2为图1中步骤S20的细化流程示意图。本实施例中,上述步骤S20包括:Referring to FIG. 2, FIG. 2 is a schematic diagram of the refinement process of step S20 in FIG. In this embodiment, the foregoing step S20 includes:
步骤S201,在预设的第一时长内,获取所述第一时长内的所述本地音频数据的增益值中大于预设第一增益阈值的若干第一增益值;Step S201, acquiring, in a preset first duration, a plurality of first gain values that are greater than a preset first gain threshold among the gain values of the local audio data in the first duration;
步骤S202,计算选择的预设第一数量的第一增益值的平均值以作为进行增益衰减处理的衰减值;Step S202, calculating an average value of the selected preset first number of first gain values as an attenuation value for performing the gain attenuation processing;
步骤S203,根据所述衰减值,进行第一增益值的衰减处理。Step S203, performing attenuation processing of the first gain value according to the attenuation value.
本实施例中,基于用户使用体验,因而音频切换的平滑过渡处理过程不宜过长,例如1秒钟,因此第一时长相应可以设置为0.5-1秒钟,具体根据实际情况进行设置。另外,本实施例中优选对本地音频数据的增益值中比较大的增益值进行衰减处理,而对于比较小的增益值则不处理,从而一定程度上保证了本地音频播放时的用户听觉体验。以采样位数为8位的音频数据为例,其最大增益值为255,最小增益值为0,因此,可以将中间增益值127(或128)作为较大增益值的区分线,也即将第一时长内大于127的增益值设为第一增益值。本实施例中,对于第一增益阈值的设置不限,具体根据实际需要进行设置。In this embodiment, based on the user experience, the smooth transition process of the audio switching should not be too long, for example, 1 second, so the first duration can be set to 0.5-1 seconds, which is set according to actual conditions. In addition, in this embodiment, it is preferable to attenuate the relatively large gain value of the gain value of the local audio data, and not to process the relatively small gain value, thereby ensuring the user's auditory experience during local audio playback to some extent. Taking the audio data with 8 bits of sampling as an example, the maximum gain value is 255 and the minimum gain value is 0. Therefore, the intermediate gain value 127 (or 128) can be used as the distinguishing line of the larger gain value. A gain value greater than 127 over a period of time is set to a first gain value. In this embodiment, the setting of the first gain threshold is not limited, and is specifically set according to actual needs.
进一步地,对于增益衰减的衰减值的确定,本实施例中优选将随机选择的预设第一数量的第一增益值的平均值作为进行增益衰减处理的衰减值。其中,第一数量的设置不限,例如,随机选择5个第一增益值进行计算以获得相应的衰减值。本实施例中,由于不同的音频文件所对应的增益值不同,且同一音频文件的不同时刻的增益值也可能不同,因此衰减值需要根据预设计算规则进行计算确定。此外,由于本实施例中的衰减值仅仅只是作为音频切换时的播放处理且处理的时长较短,因此用户主要是关心音频切换时的干扰噪声影响,而对于处理过程中的音效并不是十分关注,因此,本实施例中优选将任意数量的第一增益值的平均值作为衰减值,而采用第一增益值的平均值既可以避免由于衰减值设置过大而使用户感觉音频的切换不够自然,也可以避免由于衰减值设置过小而相应延长切换的处理时长,从而影响用户体验。Further, for determining the attenuation value of the gain attenuation, in the embodiment, an average value of the randomly selected preset first number of first gain values is preferably used as the attenuation value for performing the gain attenuation processing. Wherein, the first number of settings is not limited, for example, five first gain values are randomly selected for calculation to obtain corresponding attenuation values. In this embodiment, since the gain values corresponding to different audio files are different, and the gain values of the same audio file may be different at different times, the attenuation value needs to be calculated and determined according to a preset calculation rule. In addition, since the attenuation value in the embodiment is only used as the playback process at the time of audio switching and the processing time is short, the user mainly cares about the influence of the interference noise during the audio switching, and is not very concerned about the sound effect during the processing. Therefore, in this embodiment, the average value of any number of the first gain values is preferably used as the attenuation value, and the average value of the first gain value is used to avoid the user's feeling that the switching of the audio is not natural enough because the attenuation value is set too large. It is also possible to avoid the delay in processing the delay due to the setting of the attenuation value being too small, thereby affecting the user experience.
进一步地,根据计算得到的衰减值,进行第一增益值的衰减处理。例如,第一增益值按照播放顺序依次为250、140、190、210、170……,则衰减值为192,对应的经过衰减处理后的相应增益值依次为58、0、0、18、0……。需要说明的是,由于增益值具有一定数值范围,也即具有最大值与最小值,因此,在进行增益值的衰减处理时,将处理后的增益值小于或等于最小值的增益值记为最小值。 比如增益值小于零时记为零。Further, the attenuation processing of the first gain value is performed based on the calculated attenuation value. For example, if the first gain value is 250, 140, 190, 210, 170, ... in the order of play, the attenuation value is 192, and the corresponding attenuation values after the attenuation processing are 58, 0, 0, 18, 0 in order. .... It should be noted that since the gain value has a certain value range, that is, has a maximum value and a minimum value, when the attenuation process of the gain value is performed, the gain value after the processed gain value is less than or equal to the minimum value is recorded as the minimum value. value. For example, when the gain value is less than zero, it is recorded as zero.
本实施例是对本地音频数据中相应音频数据的增益值进行增益衰减处理的较佳实施例。当然,对于本地音频数据的增益值的衰减处理并不限于上述方式,例如第一增益值按照播放顺序依次为250、140、190、210、170……,则经过衰减处理后的相应增益值依次为100、90、80、70、60……,也即增益值依次衰减了150、50、110、140、110……,衰减处理方式不同,其所对应的音频输出效果亦不相同。通过对第一时长内的较大增益值进行衰减处理,从而防止本地音频切换时由于音量过大而引起的干扰噪声,同时也使得本地音频在音频切换的平滑过渡处理过程中音量能够平滑衰减下降,提高用户使用体验。This embodiment is a preferred embodiment of performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data. Of course, the attenuation processing of the gain value of the local audio data is not limited to the above manner. For example, the first gain value is sequentially 250, 140, 190, 210, 170, ... in the order of playback, and the corresponding gain values after the attenuation processing are sequentially The values of 100, 90, 80, 70, 60, ..., that is, the gain values are sequentially attenuated by 150, 50, 110, 140, 110..., and the attenuation processing methods are different, and the corresponding audio output effects are also different. By attenuating the larger gain value in the first time period, the interference noise caused by the excessive volume during local audio switching is prevented, and the volume of the local audio can be smoothly attenuated during the smooth transition process of the audio switching. To improve the user experience.
参照图3,图3为图1中步骤S30的细化流程示意图。本实施例中,上述步骤S30包括:Referring to FIG. 3, FIG. 3 is a schematic diagram of the refinement process of step S30 in FIG. In this embodiment, the foregoing step S30 includes:
步骤S301,在预设的第二时长内,获取所述第二时长内的所述待播放的音频数据的增益值中小于预设第二增益阈值的若干第二增益值;In step S301, a second second gain value of the gain value of the to-be-played audio data in the second duration is less than a preset second gain threshold, in a preset second duration;
步骤S302,计算选择的预设第二数量的第二增益值的平均值以作为进行增益增强处理的增强值;Step S302, calculating an average value of the selected preset second quantity of second gain values as an enhancement value for performing gain enhancement processing;
步骤S303,根据所述增强值,进行第二增益值的增强处理。Step S303, performing enhancement processing of the second gain value according to the enhancement value.
本实施例中,基于用户使用体验,因而音频切换的平滑过渡处理过程不宜过长,例如1秒钟,因此第二时长相应可以设置为0.5-1秒钟,具体根据实际情况进行设置。另外,本实施例中优选对本地音频数据的增益值中比较小的增益值进行增强处理,而对比较大的增益值不做处理,从而一定程度上保证了本地音频播放时的用户听觉体验。以采样位数为8位的音频数据为例,其最大增益值为255,最小增益值为0,因此,可以将中间增益值127(或128)作为较小增益值的区分线,也即将第一时长内小于127的增益值设为第二增益值。本实施例中,对于第二增益阈值的设置不限,具体根据实际需要进行设置。In this embodiment, based on the user experience, the smooth transition process of the audio switching should not be too long, for example, 1 second, so the second duration can be set to 0.5-1 seconds, which is set according to the actual situation. In addition, in this embodiment, it is preferable to perform enhancement processing on a relatively smaller gain value of the local audio data, and to compare the larger gain value without processing, thereby ensuring the user's auditory experience during local audio playback to a certain extent. Taking the audio data with 8 bits of sampling as an example, the maximum gain value is 255 and the minimum gain value is 0. Therefore, the intermediate gain value 127 (or 128) can be used as the distinguishing line of the smaller gain value, that is, the first A gain value of less than 127 over a period of time is set to a second gain value. In this embodiment, the setting of the second gain threshold is not limited, and is specifically set according to actual needs.
进一步地,对于增益增强的增强值的确定,本实施例中优选将随机选择的预设第二数量的第二增益值的平均值作为进行增益增强处理的增强值。其中,第二数量的设置不限,例如,随机选择5个第二增益值进行计算以获得相应的增强值。本实施例中,由于不同的音频文件所对应的增益值不同,且同一音频文件的不同时刻的增益值也可能不同,因此增强值需要根据预设计算规则进行计算确定。此外,由于本实施例中的增强值仅仅只是作为音频切换时的播放处理且处理的时长较短,因此用户主要是关心音频切换时的干扰噪声影响,而对于处理过程中的音效并不是十分关注,因此,本实施例中优选将任意数量的第二增益值的平均值作为增强值,而采用第二增益值的平均值既可以避免由于增强值设置过大而使用户感觉音频的切换不够自然,也可以避免由于衰减值设置过小而相应延长切换的处理时长,从而影响用户体验。Further, for determining the enhancement value of the gain enhancement, in the embodiment, an average value of the randomly selected preset second number of second gain values is preferably used as the enhancement value for performing the gain enhancement processing. The second number of settings is not limited. For example, five second gain values are randomly selected for calculation to obtain corresponding enhancement values. In this embodiment, since the gain values corresponding to different audio files are different, and the gain values of the same audio file may be different at different times, the enhancement value needs to be calculated and determined according to a preset calculation rule. In addition, since the enhancement value in the embodiment is only used as the playback process at the time of audio switching and the processing time is short, the user mainly cares about the influence of the interference noise during the audio switching, and is not very concerned about the sound effect during the processing. Therefore, in this embodiment, an average value of any number of second gain values is preferably used as an enhancement value, and an average value of the second gain values is used to avoid that the user feels that the switching of the audio is not natural enough due to the excessive setting of the enhancement value. It is also possible to avoid the delay in processing the delay due to the setting of the attenuation value being too small, thereby affecting the user experience.
进一步地,根据计算得到的增强值,在第二时长内按照第二增益值所对应的音频数据的播放顺序依次进行第二增益值的衰减处理。例如,第二增益值按照播放顺序依次为50、70、30、90、100……,则增强值为68,对应的经过增强处理后的相应增益值依次为118、138、98、158、168……。需要说明的是,由于增益值具有一定数值范围,也即具有最大值与最小值,因此,在进行增益值的增强处理时,将处理后的增益值大于或等于最大值的增益值记为最大值。 比如增益值大于255时记为255。Further, according to the calculated enhancement value, the attenuation processing of the second gain value is sequentially performed in the playback order of the audio data corresponding to the second gain value in the second duration. For example, if the second gain value is 50, 70, 30, 90, 100, ... in the order of play, the enhancement value is 68, and the corresponding enhanced gain values are 118, 138, 98, 158, 168, respectively. .... It should be noted that since the gain value has a certain value range, that is, has a maximum value and a minimum value, when the gain value is enhanced, the gain value after the processed gain value is greater than or equal to the maximum value is recorded as the maximum value. value. For example, if the gain value is greater than 255, it is recorded as 255.
本实施例是对本地音频数据中相应音频数据的增益值进行增益增强处理的较佳实施例。当然,对于本地音频数据的增益值的衰减处理并不限于上述方式,例如第二增益值按照播放顺序依次为50、70、30、90、100……,则经过增强处理后的相应增益值依次为100、110、120、130、140……,也即增益值依次增强了50、40、90、40、40……,增强处理方式不同,其所对应的音频输出效果亦不相同。通过对第二时长内的较小增益值进行增强处理,从而防止待播放音频切换时由于音量过小而引起的干扰噪声,同时也使得待播放音频在音频切换的平滑过渡处理过程中音量能够平滑增强上升,提高用户使用体验。This embodiment is a preferred embodiment of performing a gain enhancement process on the gain value of the corresponding audio data in the local audio data. Certainly, the attenuation processing of the gain value of the local audio data is not limited to the above manner. For example, the second gain value is sequentially 50, 70, 30, 90, 100, ... in the order of playback, and the corresponding gain values after the enhancement processing are sequentially For the 100, 110, 120, 130, 140..., that is, the gain value is sequentially enhanced by 50, 40, 90, 40, 40..., and the enhanced processing manner is different, and the corresponding audio output effects are also different. By enhancing the smaller gain value in the second duration, the interference noise caused by the volume being too small when the audio to be played is switched is prevented, and the volume of the audio to be played is smoothed during the smooth transition process of the audio switching. Enhance the rise and improve the user experience.
参照图4,图4为图1中步骤S40细化流程示意图。本实施例中,上述步骤S40包括:Referring to FIG. 4, FIG. 4 is a schematic diagram of the refinement process of step S40 in FIG. In this embodiment, the foregoing step S40 includes:
步骤S401,在所述本地音频数据输出开始后的所述第一时长内,将进行增益衰减处理后的所述本地音频数据输出到所述本地音频设备上的音频解码器上进行解码播放;Step S401, the local audio data after the gain attenuation processing is output to the audio decoder on the local audio device for decoding and playing in the first duration after the start of the output of the local audio data;
步骤S402,在所述本地音频数据输出结束后的所述第二时长内,将进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。Step S402, the audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding and playing in the second duration after the end of the output of the local audio data. .
本实施例中,为避免突然切换而导致产生干扰噪音,在切换指令开始执行后通过一音频切换的平滑过渡处理过程以继续进行本地音频的输出,也即输出经过衰减处理后的本地音频数据。另外,基于用户的听觉感受,比如用户对于1秒钟内的声音变化不是特别敏感,因此,本实施例中,优选第一时长为500毫秒,第二时长为500毫秒,则在本地音频数据输出开始后的0~500毫秒内输出经过衰减处理后的本地音频数据,而在500~1000毫秒内输出经过增强处理后的待播放的音频数据,进而在音频切换的平滑过渡处理过程内,时音频的增益先衰减而后再增强,从而解决了两种不同音频设备之间进行音频切换时所产生的噪声干扰,同时在音频切换过程中使音频的播放能够进行平滑过渡进而提升用户使用体验。In this embodiment, in order to avoid the occurrence of interference noise caused by sudden switching, the smoothing transition process of an audio switching is continued after the switching instruction is started to continue the output of the local audio, that is, the local audio data after the attenuation processing is output. In addition, based on the user's auditory experience, for example, the user is not particularly sensitive to the change of the sound within one second. Therefore, in this embodiment, the first time duration is 500 milliseconds, and the second time length is 500 milliseconds, and the local audio data is output. The local audio data after the attenuation processing is outputted within 0 to 500 milliseconds after the start, and the audio data to be played after the enhanced processing is outputted within 500 to 1000 milliseconds, and then the audio is smoothly processed during the smooth transition process of the audio switching. The gain is first attenuated and then enhanced, thereby solving the noise interference generated when the audio is switched between two different audio devices, and the audio playback can be smoothly transitioned during the audio switching process to enhance the user experience.
参照图5,图5为本发明音频切换时的播放处理方法另一实施例的流程示意图。本实施例中,上述步骤S10之后包括:Referring to FIG. 5, FIG. 5 is a schematic flowchart diagram of another embodiment of a playback processing method during audio switching according to the present invention. In this embodiment, after the step S10, the method includes:
步骤S50,根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;Step S50: Calculate a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data.
步骤S60,根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;Step S60: determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
步骤S70,若是,则确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。Step S70, if yes, determining that the received audio data to be played is interference data and stopping performing playback processing on the interference data.
本实施例中,待播放的音频数据可以一次性传送完后,再进行解码播放,同时也可以边传送边解码播放,具体根据实际需要进行设置。无论采用哪种传送方式,在接收端(也即本地音频设备上)都需要对接收到的音频数据分配相应的存储空间。In this embodiment, the audio data to be played can be decoded and played after being transmitted at one time, and can also be decoded and played while being transmitted, and is specifically set according to actual needs. Regardless of the transmission method used, the receiving end (that is, the local audio device) needs to allocate corresponding storage space to the received audio data.
例如,在接收到的待播放音频数据的相关音频参数,比如音频的总时长、声道数、采样频率、采样位数,即可根据公式:存储容量(字节)=采样频率×采样精度/8×声道数×时间,计算出待播放的音频数据的总数据量。比如,采样频率为8KHZ,采样位数为16位,音频总时长为2分钟,采用双声道,则对应的音频的总数据量=(8000*16*2*2*60)/(8*1024*1024)=3.66M,也即需要分配至少3.66M的存储空间。For example, the relevant audio parameters of the received audio data to be played, such as the total duration of the audio, the number of channels, the sampling frequency, and the number of samples, can be according to the formula: storage capacity (bytes) = sampling frequency × sampling accuracy / 8 × channel number × time, the total amount of data of the audio data to be played is calculated. For example, the sampling frequency is 8KHZ, the sampling digit is 16 digits, the total audio duration is 2 minutes, and the total data volume of the corresponding audio is (8000*16*2*2*60)/(8*). 1024*1024)=3.66M, that is, it needs to allocate at least 3.66M of storage space.
进一步可选的,为排除干扰数据的影响,在计算出接收到的总的数据量后,进一步判断是否大于预设的阈值数据量,比如设为1KB,如果大于1KB,则判定为音频数据;如果小于或等于1KB,则判定为非正常的音频数据,也即干扰数据,而若是干扰数据则无须进行音频切换的播放处理。Further, in order to eliminate the influence of the interference data, after calculating the total amount of data received, further determining whether the value is greater than a preset threshold data amount, for example, 1 KB, if it is greater than 1 KB, determining audio data; If it is less than or equal to 1 KB, it is judged to be abnormal audio data, that is, interference data, and if it is interference data, playback processing of audio switching is not required.
参照图6,图6为本发明音频切换时的播放处理装置一实施例的功能模块示意图。本实施例中,所述音频切换时的播放处理装置包括:Referring to FIG. 6, FIG. 6 is a schematic diagram of functional blocks of an embodiment of a playback processing apparatus during audio switching according to the present invention. In this embodiment, the playback processing device during audio switching includes:
接收模块10,用于当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;The receiving module 10 is configured to receive audio data to be played by the external audio device when the audio is played on the local audio device;
本实施例中,本地音频设备及外部音频设备并不限定,本地音频设备具体是指当前播放音频的设备,而外部音频设备则是向本地音频设备传送音频文件的设备。比如本地音频设备可以为智能电视、智能手机等,外部音频设备可以为智能手机、智能电视等。外部音频设备可以通过无线或有线方式向本地音频设备传送待播放的音频数据。In this embodiment, the local audio device and the external audio device are not limited. The local audio device specifically refers to the device that currently plays audio, and the external audio device refers to the device that transmits the audio file to the local audio device. For example, the local audio device can be a smart TV, a smart phone, etc., and the external audio device can be a smart phone, a smart TV, or the like. The external audio device can transmit the audio data to be played to the local audio device by wireless or wired.
增益衰减处理模块20,用于根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理;The gain attenuation processing module 20 is configured to perform gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule;
增益增强处理模块30,用于根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理;The gain enhancement processing module 30 is configured to perform gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule;
在本地音频播放突然中断并进行外部音频的播放切换时,如果当前本地音频播放的声音音量特别高,比如赛车游戏声音;而切换播放的声音音量却很低,此时将会造成音频声音的突变,产生干扰啸叫的声音,从而使用户感觉不适。因此,需要对音频切换时的播放进行平滑过渡处理,以降低切换过程中所产生的干扰声音。When the local audio playback is suddenly interrupted and the external audio playback is switched, if the current local audio playback sound volume is particularly high, such as the racing game sound; and the volume of the switched playback sound is very low, this will cause a sudden change in the audio sound. , causing a sound that interferes with howling, thereby making the user feel uncomfortable. Therefore, it is necessary to perform smooth transition processing on the playback at the time of audio switching to reduce the interference sound generated during the switching process.
本实施例中,具体通过设置一音频切换的平滑过渡处理过程,并在此平滑过渡处理过程内,继续输出经过增益衰减处理模块20处理后的本地音频数据,同时增益增强处理模块30也对待播放的音频数据进行增益值的增强处理。增益值是音频数据所具有的属性值,也即播放的音量大小。基于用户使用感受,本实施例中优选对退出的本地音频数据进行增益值的衰减处理,而对进入的待播放音频数据进行增益值的增强处理。对于第一音频处理规则的设置,例如,可以将平滑过渡处理时间内输入的所有本地音频数据的增益值都统一衰减一固定值;或者可以将平滑过渡处理时间内输入的音频数据中对应的较高增益值进行衰减处理等,对于第二音频处理规则的设置类似,本实施例中对第一音频处理规则与第二音频处理规则并不限定,具体可根据实际需要进行设置。需要说明的是,在对本地音频数据以及待播放音频数据的增益进行相应处理时,不仅需要考虑到既要能解决突然切换时所产生的干扰问题,同时也要使用户具有较好的听觉感受,比如比较平滑缓和地慢慢衰减或慢慢增强等。In this embodiment, a smooth transition process of audio switching is set, and in the smooth transition process, the local audio data processed by the gain attenuation processing module 20 is continuously output, and the gain enhancement processing module 30 also plays the same. The audio data is subjected to enhancement processing of the gain value. The gain value is the attribute value of the audio data, that is, the volume of the played volume. Based on the user experience, in the embodiment, it is preferable to perform attenuation processing of the gain value on the exited local audio data, and perform enhancement processing of the gain value on the entered audio data to be played. For the setting of the first audio processing rule, for example, the gain values of all the local audio data input during the smooth transition processing time may be uniformly attenuated by a fixed value; or the corresponding comparison of the audio data input during the smooth transition processing time may be performed. The high-gain value is subjected to the attenuation processing and the like, and the setting of the second audio processing rule is similar. In the embodiment, the first audio processing rule and the second audio processing rule are not limited, and may be specifically set according to actual needs. It should be noted that when the local audio data and the gain of the audio data to be played are processed correspondingly, it is necessary to consider not only the interference problem generated when the sudden switching is performed, but also the user having a good hearing experience. For example, it is slowly and slowly attenuated or slowly increased.
音频播放处理模块40,用于根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。The audio playback processing module 40 is configured to output the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to the local audio device according to a preset audio output rule. Decoding playback on the upper audio decoder.
音频切换的平滑过渡处理过程不仅包括对输出内容的处理,同时也还包括对输出方式的处理,比如本地音频数据与待播放音频数据的输出顺序以及对应的输出时长等,此外,由于对输出内容进行了预先干预处理,因此,输出方式也需进行相应处理等。本实施例中,对于音频输出规则的设置不限,具体根据实际需要进行设置。The smooth transition processing process of the audio switching includes not only the processing of the output content, but also the processing of the output mode, such as the output order of the local audio data and the audio data to be played, and the corresponding output duration, etc., in addition, due to the output content Pre-intervention processing has been carried out, so the output method also needs to be processed accordingly. In this embodiment, the setting of the audio output rule is not limited, and is specifically set according to actual needs.
本实施例中,在接收到外部音频设备发送的音频数据以与当前本地播放音频进行切换时,为避免突然切换而导致产生干扰噪音,通过增益增强处理模块30对接收到的待播放音频数据中的相应音频数据进行增益增强处理,而通过增益衰减处理模块20对本地音频数据中的相应音频数据进行增益衰减处理,并在执行音频切换后,继续输出经过处理后的本地音频数据以及输出经过处理后的待播放音频数据以用于进行平滑过渡处理,即对应提高待播放音频数据的输出音量以及对应降低本地音频数据的输出音量,进而解决了两种不同音频设备之间进行音频切换时所产生的噪声干扰,同时通过音频播放处理模块40使音频切换后的播放能够进行平滑过渡进而提升用户使用体验。In this embodiment, when receiving the audio data sent by the external audio device to switch with the current local playing audio, the interference noise is generated to avoid the sudden switching, and the gain enhancement processing module 30 is used to receive the to-be-played audio data. The corresponding audio data is subjected to gain enhancement processing, and the gain attenuation processing is performed on the corresponding audio data in the local audio data by the gain attenuation processing module 20, and after performing the audio switching, the processed local audio data is continuously output and the output is processed. The audio data to be played back is used for smooth transition processing, that is, corresponding to increasing the output volume of the audio data to be played and correspondingly reducing the output volume of the local audio data, thereby solving the problem of audio switching between two different audio devices. The noise interference is simultaneously enabled by the audio playback processing module 40 to enable a smooth transition after the audio switching, thereby improving the user experience.

Claims (18)

  1. 一种音频切换时的播放处理方法,其特征在于,所述音频切换时的播放处理方法包括: A playback processing method for audio switching, wherein the playback processing method during audio switching includes:
    当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;Receiving audio data to be played sent by the external audio device when playing audio on the local audio device;
    根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理,其中,所述根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理包括:And performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule, wherein the gain of the corresponding audio data in the local audio data according to the preset first audio processing rule Values for gain attenuation processing include:
    在预设的第一时长内,获取所述第一时长内的所述本地音频数据的增益值中大于预设第一增益阈值的若干第一增益值;计算选择的预设第一数量的第一增益值的平均值以作为进行增益衰减处理的衰减值;根据所述衰减值,进行第一增益值的衰减处理;Obtaining, in a preset first duration, a plurality of first gain values of the gain value of the local audio data in the first duration that are greater than a preset first gain threshold; calculating a selected preset first number of the first An average value of a gain value as an attenuation value for performing a gain attenuation process; and performing attenuation processing of the first gain value according to the attenuation value;
    根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理,其中,所述根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理包括:Performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule, wherein the to-be-played according to the preset second audio processing rule The gain enhancement processing of the gain values of the corresponding audio data in the audio data includes:
    在预设的第二时长内,获取所述第二时长内的所述待播放的音频数据的增益值中小于预设第二增益阈值的若干第二增益值;计算选择的预设第二数量的第二增益值的平均值以作为进行增益增强处理的增强值;根据所述增强值,进行第二增益值的增强处理;Obtaining, in a preset second duration, a plurality of second gain values of the gain value of the to-be-played audio data in the second duration that are less than a preset second gain threshold; calculating the selected preset second quantity An average value of the second gain value is used as an enhancement value for performing a gain enhancement process; and an enhancement process of the second gain value is performed according to the enhancement value;
    根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。Outputting the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to an audio decoder on the local audio device for decoding according to a preset audio output rule Play.
  2. 如权利要求1所述的音频切换时的播放处理方法,其特征在于,所述根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放包括:The playback processing method for audio switching according to claim 1, wherein said local audio data subjected to gain attenuation processing and said gain enhancement processing are respectively performed according to a preset audio output rule Outputting the audio data to be played to the audio decoder on the local audio device for decoding and playing includes:
    在所述本地音频数据输出开始后的所述第一时长内,将进行增益衰减处理后的所述本地音频数据输出到所述本地音频设备上的音频解码器上进行解码播放;And outputting the local audio data subjected to the gain attenuation processing to an audio decoder on the local audio device for decoding and playing during the first duration after the start of the output of the local audio data;
    在所述本地音频数据输出结束后的所述第二时长内,将进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。The audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding playback in the second duration after the end of the output of the local audio data.
  3. 如权利要求1所述的音频切换时的播放处理方法,其特征在于,所述当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据之后包括:The method for processing audio during audio switching according to claim 1, wherein when the audio is played on the local audio device, receiving the audio data to be played by the external audio device includes:
    根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;Calculating a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;Determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    若是,则确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。If yes, it is determined that the received audio data to be played is interference data and stops performing playback processing on the interference data.
  4. 如权利要求2所述的音频切换时的播放处理方法,其特征在于,所述当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据之后包括:The method for processing audio during audio switching according to claim 2, wherein when the audio is played on the local audio device, receiving the audio data to be played by the external audio device includes:
    根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;Calculating a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;Determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    若是,则确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。If yes, it is determined that the received audio data to be played is interference data and stops performing playback processing on the interference data.
  5. 一种音频切换时的播放处理方法,其特征在于,所述音频切换时的播放处理方法包括:A playback processing method for audio switching, wherein the playback processing method during audio switching includes:
    当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;Receiving audio data to be played sent by the external audio device when playing audio on the local audio device;
    根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理;And performing gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to a preset first audio processing rule;
    根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理;And performing gain enhancement processing on the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule;
    根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。Outputting the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to an audio decoder on the local audio device for decoding according to a preset audio output rule Play.
  6. 如权利要求5所述的音频切换时的播放处理方法,其特征在于,所述根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理包括:The playback processing method of the audio switching according to claim 5, wherein the performing the gain attenuation processing on the gain value of the corresponding audio data in the local audio data according to the preset first audio processing rule comprises:
    在预设的第一时长内,获取所述第一时长内的所述本地音频数据的增益值中大于预设第一增益阈值的若干第一增益值;Obtaining, in a preset first duration, a plurality of first gain values of the gain value of the local audio data in the first duration that are greater than a preset first gain threshold;
    计算选择的预设第一数量的第一增益值的平均值以作为进行增益衰减处理的衰减值;Calculating an average of the selected first number of first gain values of the selected one as the attenuation value for performing the gain attenuation process;
    根据所述衰减值,进行第一增益值的衰减处理。The attenuation processing of the first gain value is performed based on the attenuation value.
  7. 如权利要求5所述的音频切换时的播放处理方法,其特征在于,根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理包括:The playback processing method of the audio switching according to claim 5, wherein the gain enhancement processing of the gain value of the corresponding audio data in the audio data to be played according to the preset second audio processing rule comprises:
    在预设的第二时长内,获取所述第二时长内的所述待播放的音频数据的增益值中小于预设第二增益阈值的若干第二增益值;Obtaining, in a preset second duration, a plurality of second gain values of the gain value of the to-be-played audio data in the second duration that are less than a preset second gain threshold;
    计算选择的预设第二数量的第二增益值的平均值以作为进行增益增强处理的增强值;Calculating an average of the selected second number of second gain values of the selected one as an enhancement value for performing gain enhancement processing;
    根据所述增强值,进行第二增益值的增强处理。An enhancement process of the second gain value is performed according to the enhancement value.
  8. 如权利要求5所述的音频切换时的播放处理方法,其特征在于,所述根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放包括:The playback processing method for audio switching according to claim 5, wherein said local audio data subjected to gain attenuation processing and said gain enhancement processing are respectively performed according to a preset audio output rule Outputting the audio data to be played to the audio decoder on the local audio device for decoding and playing includes:
    在所述本地音频数据输出开始后的所述第一时长内,将进行增益衰减处理后的所述本地音频数据输出到所述本地音频设备上的音频解码器上进行解码播放;And outputting the local audio data subjected to the gain attenuation processing to an audio decoder on the local audio device for decoding and playing during the first duration after the start of the output of the local audio data;
    在所述本地音频数据输出结束后的所述第二时长内,将进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。The audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding playback in the second duration after the end of the output of the local audio data.
  9. 如权利要求5所述的音频切换时的播放处理方法,其特征在于,所述当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据之后包括:The method for processing audio during audio switching according to claim 5, wherein when the audio is played on the local audio device, receiving the audio data to be played by the external audio device includes:
    根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;Calculating a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;Determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    若是,则确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。If yes, it is determined that the received audio data to be played is interference data and stops performing playback processing on the interference data.
  10. 如权利要求6所述的音频切换时的播放处理方法,其特征在于,所述当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据之后包括:The method for processing audio during audio switching according to claim 6, wherein when the audio is played on the local audio device, receiving the audio data to be played by the external audio device includes:
    根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;Calculating a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;Determining, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    若是,则确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。If yes, it is determined that the received audio data to be played is interference data and stops performing playback processing on the interference data.
  11. 一种音频切换时的播放处理装置,其特征在于,所述音频切换时的播放处理装置包括:A playback processing device for audio switching, wherein the playback processing device during audio switching comprises:
    接收模块,用于当在本地音频设备上播放音频时,接收外部音频设备所发送的待播放的音频数据;a receiving module, configured to receive audio data to be played by the external audio device when the audio is played on the local audio device;
    增益衰减处理模块,用于根据预设的第一音频处理规则,将本地音频数据中相应音频数据的增益值进行增益衰减处理;a gain attenuation processing module, configured to perform gain attenuation processing on a gain value of the corresponding audio data in the local audio data according to a preset first audio processing rule;
    增益增强处理模块,用于根据预设的第二音频处理规则,将所述待播放的音频数据中相应音频数据的增益值进行增益增强处理;a gain enhancement processing module, configured to perform gain enhancement processing on a gain value of the corresponding audio data in the audio data to be played according to a preset second audio processing rule;
    音频播放处理模块,用于根据预设的音频输出规则,分别将进行增益衰减处理后的所述本地音频数据以及进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。The audio playback processing module is configured to output the local audio data subjected to the gain attenuation processing and the audio data to be played after the gain enhancement processing to the local audio device according to a preset audio output rule Decoding playback on the audio decoder.
  12. 如权利要求11所述的音频切换时的播放处理装置,其特征在于,所述增益衰减处理模块包括:The playback processing device for audio switching according to claim 11, wherein the gain reduction processing module comprises:
    第一获取单元,用于在预设的第一时长内,获取所述第一时长内的所述本地音频数据的增益值中大于预设第一增益阈值的若干第一增益值;a first acquiring unit, configured to acquire, in a preset first duration, a plurality of first gain values that are greater than a preset first gain threshold among the gain values of the local audio data in the first duration;
    衰减值计算单元,用于计算选择的预设第一数量的第一增益值的平均值以作为进行增益衰减处理的衰减值;And an attenuation value calculation unit, configured to calculate an average value of the selected preset first number of first gain values as an attenuation value for performing the gain attenuation process;
    增益衰减处理单元,用于根据所述衰减值,进行第一增益值的衰减处理。And a gain attenuation processing unit configured to perform attenuation processing of the first gain value according to the attenuation value.
  13. 如权利要求11所述的音频切换时的播放处理装置,其特征在于,所述增益增强处理模块包括:The playback processing device for audio switching according to claim 11, wherein the gain enhancement processing module comprises:
    第二获取单元,用于在预设的第二时长内,获取所述第二时长内的所述待播放的音频数据的增益值中小于预设第二增益阈值的若干第二增益值;a second acquiring unit, configured to acquire, in a preset second duration, a plurality of second gain values of the gain value of the to-be-played audio data in the second duration that are less than a preset second gain threshold;
    增强值计算单元,用于计算选择的预设第二数量的第二增益值的平均值以作为进行增益增强处理的增强值;An enhancement value calculation unit configured to calculate an average of the selected second number of second gain values as the enhancement value for performing the gain enhancement process;
    增益增强处理单元,用于根据所述增强值,进行第二增益值的增强处理。And a gain enhancement processing unit, configured to perform enhancement processing of the second gain value according to the enhancement value.
  14. 如权利要求11所述的音频切换时的播放处理装置,其特征在于,所述音频播放处理模块还用于:The playback processing device for audio switching according to claim 11, wherein the audio playback processing module is further configured to:
    在所述本地音频数据输出开始后的所述第一时长内,将进行增益衰减处理后的所述本地音频数据输出到所述本地音频设备上的音频解码器上进行解码播放;以及在所述本地音频数据输出结束后的所述第二时长内,将进行增益增强处理后的所述待播放的音频数据输出到所述本地音频设备上的音频解码器上进行解码播放。Outputting the local audio data subjected to the gain attenuation processing to an audio decoder on the local audio device for decoding and playing during the first duration after the start of the output of the local audio data; The audio data to be played after the gain enhancement processing is output to the audio decoder on the local audio device for decoding and playing in the second duration after the end of the local audio data output.
  15. 如权利要求11所述的音频切换时的播放处理装置,其特征在于,所述音频切换时的播放处理装置还包括:The playback processing device for audio switching according to claim 11, wherein the playback processing device during audio switching further comprises:
    数据量计算模块,用于根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;a data amount calculation module, configured to calculate a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    数据量判断模块,用于根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;a data amount determining module, configured to determine, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    停止处理模块,用于当所述待播放的音频数据的总数据量大于所述阈值数据量时,确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。Stopping the processing module, when the total data amount of the audio data to be played is greater than the threshold data amount, determining that the received audio data to be played is interference data and stopping playing the interference data .
  16. 如权利要求12所述的音频切换时的播放处理装置,其特征在于,所述音频切换时的播放处理装置还包括:The playback processing device for audio switching according to claim 12, wherein the playback processing device during audio switching further comprises:
    数据量计算模块,用于根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;a data amount calculation module, configured to calculate a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    数据量判断模块,用于根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;a data amount determining module, configured to determine, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    停止处理模块,用于当所述待播放的音频数据的总数据量大于所述阈值数据量时,确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。Stopping the processing module, when the total data amount of the audio data to be played is greater than the threshold data amount, determining that the received audio data to be played is interference data and stopping playing the interference data .
  17. 如权利要求13所述的音频切换时的播放处理装置,其特征在于,所述音频切换时的播放处理装置还包括:The playback processing device for audio switching according to claim 13, wherein the playback processing device during audio switching further comprises:
    数据量计算模块,用于根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;a data amount calculation module, configured to calculate a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    数据量判断模块,用于根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;a data amount determining module, configured to determine, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    停止处理模块,用于当所述待播放的音频数据的总数据量大于所述阈值数据量时,确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。Stopping the processing module, when the total data amount of the audio data to be played is greater than the threshold data amount, determining that the received audio data to be played is interference data and stopping playing the interference data .
  18. 如权利要求14所述的音频切换时的播放处理装置,其特征在于,所述音频切换时的播放处理装置还包括:The playback processing device for audio switching according to claim 14, wherein the playback processing device during audio switching further comprises:
    数据量计算模块,用于根据接收到的所述待播放的音频数据的相关音频参数,计算所述待播放的音频数据的总数据量;a data amount calculation module, configured to calculate a total data amount of the audio data to be played according to the received audio parameter of the to-be-played audio data;
    数据量判断模块,用于根据计算得到的所述待播放的音频数据的总数据量,判断所述待播放的音频数据的总数据量是否大于预设的阈值数据量;a data amount determining module, configured to determine, according to the calculated total data amount of the audio data to be played, whether the total data amount of the audio data to be played is greater than a preset threshold data amount;
    停止处理模块,用于当所述待播放的音频数据的总数据量大于所述阈值数据量时,确定接收到的所述待播放的音频数据为干扰数据并停止对所述干扰数据进行播放处理。Stopping the processing module, when the total data amount of the audio data to be played is greater than the threshold data amount, determining that the received audio data to be played is interference data and stopping playing the interference data .
PCT/CN2016/084299 2015-08-27 2016-06-01 Playing processing method and apparatus for audio switching WO2017032120A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510537484.8A CN105162427B (en) 2015-08-27 2015-08-27 Play handling method when Audio conversion and device
CN201510537484.8 2015-08-27

Publications (1)

Publication Number Publication Date
WO2017032120A1 true WO2017032120A1 (en) 2017-03-02

Family

ID=54803210

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/084299 WO2017032120A1 (en) 2015-08-27 2016-06-01 Playing processing method and apparatus for audio switching

Country Status (2)

Country Link
CN (1) CN105162427B (en)
WO (1) WO2017032120A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112423120A (en) * 2020-01-22 2021-02-26 上海哔哩哔哩科技有限公司 Audio time delay detection method and system

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105162427B (en) * 2015-08-27 2018-09-04 深圳Tcl数字技术有限公司 Play handling method when Audio conversion and device
CN111007774B (en) * 2019-12-20 2020-10-27 广州市迪声音响有限公司 Multi-channel audio signal bidirectional switching circuit and method
CN112689173A (en) * 2020-12-23 2021-04-20 海信视像科技股份有限公司 Display device and volume control method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1963937A (en) * 2006-11-30 2007-05-16 北京中星微电子有限公司 Method for eliminating random switching noise in audio playing and audio playing apparatus
US20100014682A1 (en) * 2008-01-18 2010-01-21 Samsung Electronics Co., Ltd. Audio processing apparatus and method thereof to provide hearing protection
CN102025946A (en) * 2009-09-18 2011-04-20 深圳Tcl新技术有限公司 Volume control method and digital television all-in-one machine utilizing same
CN103928037A (en) * 2013-01-10 2014-07-16 先锋高科技(上海)有限公司 Audio switching method and terminal device
CN104168431A (en) * 2014-08-06 2014-11-26 青岛海信宽带多媒体技术有限公司 Volume adjusting method and device and set top box
CN105162427A (en) * 2015-08-27 2015-12-16 深圳Tcl数字技术有限公司 Playing handling method and device for audio switching

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101409094B (en) * 2008-10-30 2010-10-13 炬力集成电路设计有限公司 Method for eliminating sound effect switching noise and audio play equipment
CN104168000A (en) * 2013-05-20 2014-11-26 深圳富泰宏精密工业有限公司 Audio processing system and method
CN104112459B (en) * 2014-06-25 2017-02-15 小米科技有限责任公司 Method and apparatus for playing audio data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1963937A (en) * 2006-11-30 2007-05-16 北京中星微电子有限公司 Method for eliminating random switching noise in audio playing and audio playing apparatus
US20100014682A1 (en) * 2008-01-18 2010-01-21 Samsung Electronics Co., Ltd. Audio processing apparatus and method thereof to provide hearing protection
CN102025946A (en) * 2009-09-18 2011-04-20 深圳Tcl新技术有限公司 Volume control method and digital television all-in-one machine utilizing same
CN103928037A (en) * 2013-01-10 2014-07-16 先锋高科技(上海)有限公司 Audio switching method and terminal device
CN104168431A (en) * 2014-08-06 2014-11-26 青岛海信宽带多媒体技术有限公司 Volume adjusting method and device and set top box
CN105162427A (en) * 2015-08-27 2015-12-16 深圳Tcl数字技术有限公司 Playing handling method and device for audio switching

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112423120A (en) * 2020-01-22 2021-02-26 上海哔哩哔哩科技有限公司 Audio time delay detection method and system

Also Published As

Publication number Publication date
CN105162427A (en) 2015-12-16
CN105162427B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
WO2017032120A1 (en) Playing processing method and apparatus for audio switching
WO2016192254A1 (en) Method and device for online playback of network video
WO2017084301A1 (en) Audio data playing method and apparatus, and smart television
WO2019000792A1 (en) Method and system for adjusting sound quality, and host side and storage medium
WO2019080406A1 (en) Television voice interaction method, voice interaction control device and storage medium
WO2019051887A1 (en) Method and device for controlling home appliance, and computer-readable storage medium
WO2017084311A1 (en) Method and device for accelerating playing of single-fragment video
WO2016091011A1 (en) Subtitle switching method and device
WO2017177524A1 (en) Audio and video playing synchronization method and device
WO2019051902A1 (en) Terminal control method, air conditioner and computer-readable storage medium
WO2013185508A1 (en) Method and wireless communication device for implementing wireless headset feature of television
WO2017020649A1 (en) Audio/video playback control method and device thereof
WO2016090991A1 (en) Method and apparatus for downloading streaming media data
WO2018023926A1 (en) Interaction method and system for television and mobile terminal
WO2017036209A1 (en) Audio data play method based on smart television, and smart television and system
WO2018028124A1 (en) Television set and signal source switching method thereof
WO2019051897A1 (en) Terminal operating parameter adjustment method and device, and computer readable storage medium
WO2015058570A1 (en) Method and device for automatically recognizing network operator to realize data configuration
WO2017036203A1 (en) Play control method for media application, remote control device and television system
WO2016095244A1 (en) Method and device for adjusting video window in video conference
WO2014048239A1 (en) Smart television playing method and smart television
WO2016029502A1 (en) Signal source switching method and device
WO2017045441A1 (en) Smart television-based audio playback method and apparatus
WO2017084303A1 (en) Switching method for launcher and switching control system
WO2017084305A1 (en) Terminal control method and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16838380

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16.07.2018)

122 Ep: pct application non-entry in european phase

Ref document number: 16838380

Country of ref document: EP

Kind code of ref document: A1