WO2018054139A1 - Audio control method and device, and storage medium - Google Patents

Audio control method and device, and storage medium Download PDF

Info

Publication number
WO2018054139A1
WO2018054139A1 PCT/CN2017/092838 CN2017092838W WO2018054139A1 WO 2018054139 A1 WO2018054139 A1 WO 2018054139A1 CN 2017092838 W CN2017092838 W CN 2017092838W WO 2018054139 A1 WO2018054139 A1 WO 2018054139A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
volume
application
applications
output
Prior art date
Application number
PCT/CN2017/092838
Other languages
French (fr)
Chinese (zh)
Inventor
王晋飞
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018054139A1 publication Critical patent/WO2018054139A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output

Definitions

  • the present disclosure relates to the field of computer technologies, and in particular, to an audio control method, apparatus, and storage medium.
  • some applications will apply for an exclusive audio channel.
  • the application does not care about the operation of other applications and directly occupies the audio channel, which may cause the audio being played by other applications to be interrupted.
  • the navigation and music player in the mobile terminal is turned on, and in the process of playing music in the music player, if the navigation information is broadcasted, the music being played by the music player will be interrupted, although the navigation broadcast The music will resume playing after the end, but if this interruption is very frequent, it will affect the user experience.
  • the control of the audio output is lacking, or the concurrent audio is played together at the same volume, or the concurrent audio is interrupted each other, resulting in poor user experience.
  • the present disclosure provides an audio control method, apparatus, and storage medium for solving the problem that no audio output is controlled in a related audio concurrent scene.
  • the present disclosure provides an audio control method, including: detecting whether a plurality of applications concurrently output audio; and detecting that one of the plurality of applications is controlled by a plurality of applications concurrently outputting audio A volume outputs audio, and the remaining applications are controlled to output audio at a second volume different from the first volume.
  • the controlling one of the plurality of applications to output the audio at the first volume comprises: controlling the application with the highest priority to output at the first volume according to the preset priority of the plurality of applications Audio.
  • the controlling one of the plurality of applications to output the audio at the first volume comprises: controlling, according to a sequence of the audio resources occupied by the plurality of applications, an application that last occupies the audio resource to be the first Volume output audio.
  • the controlling one of the plurality of applications to output audio at the first volume comprises: controlling an application running in the foreground to output audio at a first volume.
  • the method further includes: shielding the request sent by the application for applying for exclusive audio resources.
  • the present disclosure also provides an audio control apparatus, including: a detecting module configured to detect whether a plurality of applications concurrently output audio; and a control module configured to control the plurality of applications concurrently detecting audio output One of the plurality of applications outputs audio at a first volume, and controls the remaining applications to output audio at a second volume different from the first volume.
  • the control module is further configured to: according to a preset priority of the multiple applications, control an application with the highest priority to output audio at the first volume.
  • the control module is further configured to control an application that last occupies an audio resource to output audio at a first volume according to a sequence in which the plurality of applications occupy audio resources.
  • the control module is further configured to control an application running in the foreground to output audio at a first volume.
  • the control module is further configured to: in a process of detecting whether multiple applications concurrently output audio, masking a request sent by the application for requesting exclusive audio resources.
  • the present disclosure also provides a storage medium that can store execution instructions for performing the audio control method described above.
  • the present disclosure can avoid the problem that multiple audio outputs are output at the same volume or interrupt each other, and the user experience is good.
  • FIG. 1 is a flowchart of an audio control method according to a first embodiment of the present disclosure
  • FIG. 2 is a flowchart of an audio control method according to a second embodiment of the present disclosure
  • FIG. 3 is a flowchart of an audio control method according to a third embodiment of the present disclosure.
  • FIG. 4 is a flowchart of an audio control method according to a fourth embodiment of the present disclosure.
  • FIG. 5 is a flowchart of an audio control method according to a fifth embodiment of the present disclosure.
  • FIG. 6 is a configuration diagram of an audio control device according to a sixth embodiment of the present disclosure.
  • FIG. 1 is a flowchart of an audio control method according to a first embodiment of the present disclosure.
  • the execution subject of this embodiment is a mobile terminal, and the mobile terminal is installed with a plurality of applications capable of outputting audio.
  • the mobile terminal is, for example, a smartphone and a tablet.
  • Step S110 detecting whether there are multiple applications concurrently outputting audio; if yes, executing step S120; if not, proceeding to step S110.
  • Concurrent output audio means that multiple applications are outputting audio.
  • Audio resources include: audio channels. Output audio through the audio channel.
  • the request sent by the application for applying for exclusive audio resources may be blocked.
  • Step S120 when it is detected that a plurality of applications concurrently output audio, control one of the plurality of applications to output audio at a first volume, and control the remaining applications to a second volume different from the first volume. Output audio.
  • the difference between the first volume and the second volume is greater than the preset volume threshold.
  • the volume threshold is an experimentally obtained value or an empirical value.
  • the first volume can be a preset standard volume.
  • the first volume may be a volume set by the user according to his or her own needs. It is preferable that the second volume does not affect the listening of the first volume.
  • the tag information of each application is acquired; the application that outputs the audio at the first volume is determined according to the tag information of each application, and the remaining applications output the audio at the second volume.
  • the tag information includes, but is not limited to, an application's priority tag, an audio resource occupancy tag, and a front-end tag.
  • the audio resource occupation mark may be a time stamp of the audio resource occupation time or a mark indicating the order of occupation of the audio resources.
  • the front and back tags are used to mark that the application is currently running in the foreground or in the background.
  • the application with the highest priority is controlled to output audio at the first volume, and the remaining applications are controlled to output the audio at the second volume.
  • the application that controls the last (latest) audio resource outputs audio at the first volume, controls, and controls the remaining applications.
  • the audio is output at the second volume.
  • the application running in the foreground is controlled to output audio at the first volume according to the front and back tags of the multiple applications, and the background operation is controlled.
  • the app outputs audio at a second volume.
  • the volume that controls the output of the application running in the foreground is higher than the volume when the application running in the background outputs audio.
  • the multiple applications can be controlled to output audio according to the order of the audio resources or the front and back tags.
  • the volume of the volume such as: control the latest audio resource application to output audio at the first volume, the remaining applications output audio at the second volume, control the foreground application when the front-end conversion operation is detected
  • a volume outputs audio
  • an application running in the background outputs audio at a second volume.
  • the audio is output concurrently, only one audio is allowed to be output at a high volume, and other audio is output at a low volume, and the low volume audio does not affect the high volume audio, so that the user can clearly hear High volume audio.
  • the present embodiment can avoid the problem that multiple channels of audio are outputted at the same volume or interrupted each other, and the user experience is good.
  • FIG. 2 is a flow chart of an audio control method according to a second embodiment of the present disclosure.
  • Step S210 when it is detected that there are multiple applications concurrently outputting audio, the audio is triggered and Send scene mode.
  • Volume control of concurrent audio is required in the audio concurrent scene mode.
  • two applications concurrently output audio as an example.
  • step S220 the application that is occupying the audio channel is marked as old, and the application that newly applies to the audio channel is marked as new.
  • Old and new are audio resource occupancy tags. Old means that the audio channel is occupied first, and new means that the last (latest) occupied audio channel.
  • the application with the timestamp closest to the current time for the new application to the audio channel should be marked as new and the rest of the applications marked as old.
  • the old corresponding application and the new corresponding application output audio through the audio channel.
  • step S230 the application running in the foreground is marked as a foreground task, and the application running in the background is marked as a background task.
  • the front and back flags are used to indicate that the application is currently running in the foreground or running in the background.
  • the front and back background tags include: foreground task tag foreground task and background task tag background task.
  • the foreground task indicates that the application is running in the foreground
  • the background task indicates that the application is running in the background.
  • Step S240 querying the priority of the application corresponding to the old and the application corresponding to the new, and determining whether the number of the highest priority applications is plural; if yes, executing step S250; if not, executing step S270.
  • the application priority table is set in advance.
  • the name of the plurality of applications and the value of the priority of each application are included in the application priority table.
  • the value of the priority is an integer value greater than or equal to 0. The larger the value, the higher the priority, and the smaller the value, the lower the priority. If there is no application name in the application priority table, the application has a priority of 0 by default.
  • the application priority table determine the priority of the application corresponding to the old and the application corresponding to the new, find the application with the highest priority, that is, find the application with the highest priority value, and determine the application with the highest priority value. Whether the number is multiple.
  • the highest priority application outputs audio at the first volume; in the case where there are multiple applications with the highest priority, the application that last occupies the audio resource outputs the audio at the first volume, and after detecting the front-end switching operation, causes the application running in the foreground to output the audio at the first volume.
  • step S250 according to the order of occupying the audio channels, the application corresponding to the old control outputs the audio at a low volume, and the application corresponding to the new control outputs the audio at a high volume.
  • the high volume volume_high and the low volume volume_low are set in advance.
  • volume_low is the first volume, which can be the standard volume.
  • the standard volume can be the volume currently set by the terminal or the volume set by the user according to his or her own needs.
  • Volume_low is the second volume, which can be 20% of the standard volume.
  • the application that last occupies the audio resource outputs the audio at a high volume, so that other applications that occupy the audio resource output the audio at a low volume; therefore, before the front-end switching operation is temporarily detected,
  • the application corresponding to the control old adjusts the volume to the low volume volume_low when the audio is output, and the application corresponding to the new control adjusts the volume to the high volume volume_high when the audio is output.
  • Step S260 after detecting the front-end background switching operation, the application corresponding to the foreground task is controlled to output audio at a high volume, and the application corresponding to the background task is controlled to output audio at a low volume.
  • the front and back tags of multiple applications are updated after the front and back office switching operations are detected.
  • the front and back tags of the application corresponding to old are modified to the foreground task, and the corresponding application of new is The front and back background tags are modified to background task.
  • the volume of the application running in the foreground is higher than the volume when the application running in the background outputs the audio.
  • the front and back of the application corresponding to old are marked as background task
  • the front and back of the application corresponding to new are marked as foreground task
  • the front and back flags of the application corresponding to old are modified to foreground task
  • new The corresponding background mark of the application is modified to background task, so the application corresponding to the control old adjusts the volume to the high volume volume_high when outputting the audio, and the application corresponding to the new control adjusts the volume to the low volume when outputting the audio. Volume_low.
  • step S270 the application with the highest priority is controlled to output audio at a high volume, and the other application outputs audio at a low volume.
  • the audio of the application corresponding to the old may be faded in or out, and the volume value is adjusted to volume_high within a predetermined period of time. You can fade in the audio of other applications and adjust the audio to volume_low for a predetermined period of time.
  • the predetermined time period is, for example, 0.5 s.
  • the audio output by the application corresponding to new can be faded in, and the volume is gradually increased from zero in the predetermined time period until the volume value reaches volume_high.
  • the audio output by the application corresponding to the old can be faded out, and gradually decreased from the current volume within a predetermined period of time until the volume value reaches volume_low.
  • the audio is output by using the default volume of the application, the volume set at the previous time, or the standard volume; if only one application occupies the audio channel, the end is ended.
  • step S210 In performing the process in this embodiment, if a new application applies to the audio channel, then Execution starts from step S210, and volume control is performed on each application of audio concurrent.
  • the volume of the plurality of applications concurrently outputting the audio is controlled; in the plurality of applications When the priorities are the same, according to the order in which the plurality of applications occupy the audio resources, and according to the front and back tags of the plurality of applications, the volume of the plurality of applications concurrently outputting the audio is controlled.
  • FIG. 3 is a flowchart of an audio control method according to a third embodiment of the present disclosure.
  • step S310 the music player A is continuously played.
  • the navigation application B does not initiate the road voice broadcast, and the music player A continues to play the music, only the music player A is occupying the audio channel of the mobile terminal, and does not enter the audio concurrent scene, so the audio of the music player A is maintained.
  • step S320 the navigation application B is opened to start the navigation function.
  • the navigation application B After the navigation application B starts the navigation function, the navigation application B can voice report the road condition.
  • the navigation application B When the navigation application B initiates a road voice broadcast, it needs to apply for an audio channel to the mobile terminal. At this time, the navigation application B has not initiated the road voice broadcast, so the audio concurrent scene mode has not been triggered yet.
  • the mobile terminal determines whether the music player A and the navigation application B that have occupied and are about to occupy the audio channel apply for an exclusive audio channel, and if so, shields the request for the exclusive audio channel and enters the audio concurrent scene.
  • Step S330 when the navigation application B applies for an audio channel, the audio concurrent scene mode is triggered.
  • the navigation application B When the navigation application B initiates a road state voice broadcast, the navigation application B applies for an audio channel to the mobile terminal; by querying the application priority table, it can be determined that the navigation application B has a higher priority than the music. Player A's priority.
  • step S340 the priority of the navigation application B is higher than the priority of the music player A, and the navigation application B is controlled to output audio at a high volume, and the music player A is controlled to output audio at a low volume.
  • the audio of the music player A is faded out, and the current volume is gradually decreased within a predetermined period of time (for example, within 0.5 s) until the volume value reaches volume_low. (such as 20% of the standard volume); the navigation application B audio is faded in, and the volume is increased from zero in the predetermined time period until the volume value reaches volume_high (such as the standard volume).
  • Step S350 after the road condition voice broadcast of the navigation application B is completed, the music player A is controlled to output the audio at a high volume.
  • the behavior of the navigation application B occupies the audio channel ends, and the navigation application B releases the audio channel to restore the audio volume of the music player A to volume_high.
  • the number of applications in the audio concurrent scene is two, and the priority, the order of applying audio resources, and the front and back task attributes are used as standards for controlling the audio volume. It is preset that the music player A and the video application C have the same priority.
  • FIG. 4 is a flowchart of an audio control method according to a fourth embodiment of the present disclosure.
  • step S410 the music player A is continuously played in the background.
  • step S420 the video application C is opened, so that the video application C plays the video in the foreground, triggering the audio concurrent scene mode.
  • the video application C needs to apply for an audio channel, and it can detect that the music player A and the video application C concurrently output audio, thereby triggering the audio concurrent scene mode.
  • step S430 the music player A is marked as old, the video application C is marked as new, and the front and back marks of the music player A and the video application C are recorded.
  • the music player A runs in the background
  • the video application C runs in the foreground
  • the front and back of the music player A is marked as the background task
  • the front and back of the video application C is marked as the foreground task.
  • step S440 it is determined that the priorities of the music player A and the video application C are the same by querying the application priority table.
  • Step S450 according to the order in which the video application C and the music player A occupy the audio channel, the video application C is controlled to output audio at a high volume, and the music player A is controlled to output audio at a low volume.
  • the application that applies for the audio channel first outputs the audio at a low volume, so that the application that applies for the audio channel outputs the audio with a high pitch.
  • the audio corresponding to the old (music player A) is faded out, and gradually decreases from the current volume within a predetermined period of time (eg, 0.5 s) until the volume value reaches volume_low. (such as 20% of the standard volume); fade the audio corresponding to new (video application C), increase the volume from zero within a predetermined time period (such as 0.5s) until the volume reaches volume_high (such as the standard volume) ).
  • a predetermined period of time eg, 0.5 s
  • volume_low such as 20% of the standard volume
  • fade the audio corresponding to new (video application C) increase the volume from zero within a predetermined time period (such as 0.5s) until the volume reaches volume_high (such as the standard volume) ).
  • Step S460 if the video application C pauses the video playback, the music player A is controlled to output the audio at a high volume.
  • the user selects to pause the video of the video application C, and the audio channel originally occupied by the video application C is released, then the sound is released.
  • the audio volume of the player A is restored to volume_high. If the video application C resumes the video playback again and the audio concurrent scene mode is triggered again, the above steps S420 to S460 are repeated.
  • the video application C is playing a video
  • the music player A pauses the music playback
  • the video application C is controlled to output the audio at a high volume volume_high.
  • Step S470 if the video application C is switched from the foreground to the background, and the music player A is switched from the background to the foreground, the front and back marks of the music player A and the video application C are modified, and the video application C is controlled to have a low volume. Output audio, control music player A to output audio at high volume.
  • the audio corresponding to the background task can be faded out, and the current volume is reduced from the current volume to the volume within a preset time period (eg, 0.5 s).
  • the value reaches volume_low (such as 20% of the standard volume); the audio corresponding to the foreground task (the music player A) is increased in volume to volume_high (such as the standard volume) for a predetermined period of time (such as 0.5s).
  • the video application C volume is adjusted to volume_high.
  • volume_high If the user closes the video application C, the volume of the music player A is adjusted to volume_high.
  • the number of applications in the audio concurrent scene is three, and the priority and the order of occupying the audio resources are used as criteria for controlling the audio volume.
  • the priority of the navigation application B is set to be the same as the priority of the social application D, and the priority of the social application D is higher than the priority of the music player A.
  • FIG. 5 is a flowchart of an audio control method according to a fifth embodiment of the present disclosure.
  • step S510 the music player A is continuously played in the background.
  • Step S520 open the navigation application B, start the navigation function, and make the navigation application B in the background run.
  • the navigation application B When the navigation application B initiates a road voice broadcast, it needs to apply for an audio channel to the mobile terminal. At this time, the navigation application B has not initiated the road voice broadcast, so the audio concurrent scene mode has not been triggered yet.
  • step S530 the social application D running in the foreground receives the video chat request, requests to occupy the video channel, and triggers the audio concurrent scene mode.
  • the mobile terminal determines whether the music player A, the navigation application B, and the social application D apply for an exclusive audio channel, and if so, blocks the request for the exclusive audio channel and enters the audio concurrent scene.
  • step S540 the music player A is marked as old and the social application D is marked as new.
  • the audio resource occupancy mark of the navigation application B is not temporarily used.
  • step S550 the priority of the social application D is higher than the priority of the music player A, the social application D is controlled to output audio at a high volume, and the music player A outputs audio at a low volume.
  • the priority of the social application D and the priority of the music player A are queried in the application priority table, and the priorities of the social application D and the music player A are determined.
  • the music of the music player A is faded out, and gradually decreases from the current volume within a predetermined time period (for example, 0.5 s) until the volume value reaches volume_low (such as the standard volume). 20%); the audio of the social application D is faded in, and the volume is gradually increased from zero in a predetermined period of time (for example, 0.5 s) until the volume value reaches volume_high (such as the standard volume).
  • the video chat of social application D continues to be performed at a higher volume value in the foreground, while the music playback of music player A continues to be performed at a lower volume value in the background, so the user's video chat is not affected when playing music.
  • step S560 the navigation application B running in the background initiates road state voice playback and applies for an audio channel.
  • the navigation application B initiates road state voice playback and applies for an audio channel, which is a music channel for the music player A, the navigation application B, and the social application D. .
  • Step S570 marking in accordance with the order in which the music player A, the navigation application B, and the social application D apply for occupying audio resources, marking the music player A and the social application D as old, and marking the navigation application as new.
  • Step S580 the priority of the navigation application B and the priority of the social application D are the same, the priority of the social application D is higher than the priority of the music player A, and the navigation application B that last occupies the audio channel controls the audio output at a high volume, and controls Music player A and social application D output audio at a low volume.
  • the application that last occupies the audio channel is determined among the plurality of applications.
  • the application that last occupies the audio channel is the navigation application B, and the navigation application B
  • the audio is fade-in processed, and the volume is gradually increased from zero in a predetermined period of time (such as 0.5 s) until the volume value reaches volume_high (such as the standard volume); then the old (music player A and social application D) are correspondingly
  • the audio of the application is faded out, and the volume is reduced from the current volume in a short time (such as 0.5s) until the volume value reaches volume_low (such as 20% of the standard volume).
  • step S540 After the traffic condition broadcast of the navigation application B is completed, it is necessary to jump to step S540 to re-mark the audio resource occupation mark for the music player A and the social application D.
  • the social application D releases the occupied audio channel.
  • the navigation application B does not initiate the road voice broadcast, and the music player A continues to play the music, only the music player A is Occupy the audio channel, so you can boost the volume of the music player A output to volume_high.
  • FIG. 6 is a sound according to a sixth embodiment of the present disclosure. Structure diagram of the frequency control device.
  • the device includes:
  • the detecting module 610 is configured to detect whether there are multiple applications concurrently outputting audio.
  • the control module 620 is configured to, when detecting that a plurality of applications concurrently output audio, control one of the plurality of applications to output audio at a first volume, and control the remaining applications to be different from the first volume
  • the second volume outputs audio. Further, controlling the first volume is higher than the second volume.
  • control module 620 is further configured to control the highest priority application to output audio at the first volume according to the preset priorities of the plurality of applications.
  • control module 620 is further configured to control the application that last occupies the audio resource to output the audio at the first volume according to a sequence in which the plurality of applications occupy audio resources.
  • control module 620 is further configured to control the application running in the foreground to output audio at the first volume.
  • control module 620 is further configured to block, in the process of detecting whether there are multiple applications concurrently outputting audio, the request sent by the application for requesting exclusive audio resources.
  • Embodiments of the present disclosure also provide a storage medium.
  • the storage medium is arranged to store program code for performing the following steps:
  • the storage medium is further arranged to store program code for performing the following steps:
  • the application with the highest priority is controlled to output the audio at the first volume.
  • the storage medium is further arranged to store program code for performing the following steps:
  • the application that last occupies the audio resource outputs the audio at the first volume according to the order in which the plurality of applications occupy the audio resources.
  • the storage medium is further arranged to store program code for performing the following steps:
  • the storage medium is further arranged to store program code for performing the following steps:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the present disclosure detects whether there are multiple applications concurrently outputting audio, and if so, only one audio is allowed to be output at a high volume, while other audio is output at a low volume, and the low volume audio does not affect the high volume audio, thereby making the user You can clearly hear high volume audio.
  • the present disclosure can avoid the problem that multiple audio outputs are output at the same volume or interrupt each other, and the user experience is good.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

An audio control method and device, and a storage medium. The method comprises: detecting whether a plurality of applications outputs audios concurrently (S110); and when it is detected that a plurality of applications outputs audios concurrently, controlling one of the plurality of applications to output an audio at a first volume and the remaining applications to output audios at a second volume that is different from the first volume (S120). If audios are output concurrently, only one audio is allowed to be output at a high volume, and the remaining audios are output at a low volume. The audios at the low volume do not affect the audio at the high volume, so that a user can listen to the audio at the high volume clearly. By controlling a plurality of audios, the method can avoid the problem that a plurality of audios is output at the same volume or interrupts each other, thereby providing good user experience.

Description

一种音频控制方法、装置及存储介质Audio control method, device and storage medium 技术领域Technical field
本公开涉及计算机技术领域,特别是涉及一种音频控制方法、装置及存储介质。The present disclosure relates to the field of computer technologies, and in particular, to an audio control method, apparatus, and storage medium.
背景技术Background technique
终端上的应用种类和数量越来越多,但是,目前的终端缺乏统一的应用设计规范和标准,这导致应用的设计质量参差不齐,因此在应用并发时,尤其是在音频并发时,会出现影响用户体验的问题。There are more and more types of applications on the terminal, but the current terminal lacks uniform application design specifications and standards, which leads to uneven design quality of applications. Therefore, when applications are concurrent, especially when audio is concurrent, There are issues that affect the user experience.
在音频并发场景中,一些应用会申请独占音频通道,该应用不关心其他应用的运行,直接占用音频通道,可能造成其他应用正在播放的音频被打断。例如:在驾车过程中,开启移动终端中的导航和音乐播放器,在音乐播放器播放音乐的过程中,如果导航播报路况信息,则音乐播放器正在播放的音乐将会被中断,虽然导航播报结束后音乐还会恢复播放,但如果这种打断非常频繁的话,将会影响用户体验。In an audio concurrent scenario, some applications will apply for an exclusive audio channel. The application does not care about the operation of other applications and directly occupies the audio channel, which may cause the audio being played by other applications to be interrupted. For example, during the driving process, the navigation and music player in the mobile terminal is turned on, and in the process of playing music in the music player, if the navigation information is broadcasted, the music being played by the music player will be interrupted, although the navigation broadcast The music will resume playing after the end, but if this interruption is very frequent, it will affect the user experience.
在音频并发场景中,还有一些应用不会独占音频通道,那么在多个应用同时输出音频时,多个音频将会同时播放。例如:用户在欣赏音乐的同时刷微博,这时如果微博有个视频被点开,则会出现两路音频以同等音量并发播放的现象,这样用户将无法欣赏音乐也无法听到微博视频的声音。In audio concurrent scenes, there are still some applications that do not monopolize the audio channel, so when multiple applications simultaneously output audio, multiple audios will play simultaneously. For example, if the user listens to music while brushing Weibo, if there is a video on Weibo being clicked, two channels of audio will be played concurrently at the same volume, so that the user will not be able to listen to music or listen to Weibo. The sound of the video.
综上,在相关音频并发场景中,缺少对音频输出的控制,要么并发的音频以相同的音量一起播放,要么并发的音频相互打断,导致用户体验效果不佳。In summary, in the related audio concurrent scene, the control of the audio output is lacking, or the concurrent audio is played together at the same volume, or the concurrent audio is interrupted each other, resulting in poor user experience.
发明内容Summary of the invention
本公开提供一种音频控制方法、装置及存储介质,用以解决相关音频并发场景中没有对音频输出进行控制的问题。The present disclosure provides an audio control method, apparatus, and storage medium for solving the problem that no audio output is controlled in a related audio concurrent scene.
为了解决上述技术问题,本公开是通过以下技术方案来解决的: In order to solve the above technical problem, the present disclosure is solved by the following technical solutions:
本公开提供了一种音频控制方法,包括:检测是否有多个应用程序并发输出音频;在检测到有多个应用程序并发输出音频时,控制所述多个应用程序中的一个应用程序以第一音量输出音频,控制其余的应用程序以不同于所述第一音量的第二音量输出音频。The present disclosure provides an audio control method, including: detecting whether a plurality of applications concurrently output audio; and detecting that one of the plurality of applications is controlled by a plurality of applications concurrently outputting audio A volume outputs audio, and the remaining applications are controlled to output audio at a second volume different from the first volume.
其中,所述控制所述多个应用程序中的一个应用程序以第一音量输出音频,包括:根据所述多个应用程序的预设优先级,控制优先级最高的应用程序以第一音量输出音频。The controlling one of the plurality of applications to output the audio at the first volume comprises: controlling the application with the highest priority to output at the first volume according to the preset priority of the plurality of applications Audio.
其中,所述控制所述多个应用程序中的一个应用程序以第一音量输出音频,包括:根据所述多个应用程序占用音频资源的先后顺序,控制最后占用音频资源的应用程序以第一音量输出音频。The controlling one of the plurality of applications to output the audio at the first volume comprises: controlling, according to a sequence of the audio resources occupied by the plurality of applications, an application that last occupies the audio resource to be the first Volume output audio.
其中,所述控制所述多个应用程序中的一个应用程序以第一音量输出音频,包括:控制在前台运行的应用程序以第一音量输出音频。The controlling one of the plurality of applications to output audio at the first volume comprises: controlling an application running in the foreground to output audio at a first volume.
其中,在检测是否有多个应用程序并发输出音频过程中,还包括:屏蔽应用程序发送的用于申请独占音频资源的请求。In the process of detecting whether there are multiple applications concurrently outputting audio, the method further includes: shielding the request sent by the application for applying for exclusive audio resources.
本公开还提供了一种音频控制装置,包括:检测模块,设置为检测是否有多个应用程序并发输出音频;控制模块,设置为在检测到有多个应用程序并发输出音频时,控制所述多个应用程序中的一个应用程序以第一音量输出音频,控制其余的应用程序以不同于所述第一音量的第二音量输出音频。The present disclosure also provides an audio control apparatus, including: a detecting module configured to detect whether a plurality of applications concurrently output audio; and a control module configured to control the plurality of applications concurrently detecting audio output One of the plurality of applications outputs audio at a first volume, and controls the remaining applications to output audio at a second volume different from the first volume.
其中,所述控制模块,进一步设置为根据所述多个应用程序的预设优先级,控制优先级最高的应用程序以第一音量输出音频。The control module is further configured to: according to a preset priority of the multiple applications, control an application with the highest priority to output audio at the first volume.
其中,所述控制模块,进一步设置为根据所述多个应用程序占用音频资源的先后顺序,控制最后占用音频资源的应用程序以第一音量输出音频。The control module is further configured to control an application that last occupies an audio resource to output audio at a first volume according to a sequence in which the plurality of applications occupy audio resources.
其中,所述控制模块,进一步设置为控制在前台运行的应用程序以第一音量输出音频。The control module is further configured to control an application running in the foreground to output audio at a first volume.
其中,所述控制模块,还设置为在检测是否有多个应用程序并发输出音频过程中,屏蔽应用程序发送的用于申请独占音频资源的请求。 The control module is further configured to: in a process of detecting whether multiple applications concurrently output audio, masking a request sent by the application for requesting exclusive audio resources.
本公开还提供了一种存储介质,该存储介质可以存储有执行指令,该执行指令用于执行上述的音频控制方法。The present disclosure also provides a storage medium that can store execution instructions for performing the audio control method described above.
本公开有益效果如下:The beneficial effects of the disclosure are as follows:
本公开如果音频并发输出,则只允许一路音频以高音量输出,而其他音频以低音量输出,低音量的音频对高音量的音频不产生影响,从而使用户可以清楚的听到高音量的音频。本公开通过对多路音频进行控制,可以避免多路音频以相同音量输出或者相互中断的问题发生,用户体验好。In the present disclosure, if audio is output concurrently, only one audio is allowed to be output at a high volume, and other audio is output at a low volume, and the low volume audio does not affect the high volume audio, so that the user can clearly hear the high volume audio. . By controlling multiple audio channels, the present disclosure can avoid the problem that multiple audio outputs are output at the same volume or interrupt each other, and the user experience is good.
附图说明DRAWINGS
图1是根据本公开第一实施例的音频控制方法的流程图;1 is a flowchart of an audio control method according to a first embodiment of the present disclosure;
图2是根据本公开第二实施例的音频控制方法的流程图;2 is a flowchart of an audio control method according to a second embodiment of the present disclosure;
图3是根据本公开第三实施例的音频控制方法的流程图;3 is a flowchart of an audio control method according to a third embodiment of the present disclosure;
图4是根据本公开第四实施例的音频控制方法的流程图;4 is a flowchart of an audio control method according to a fourth embodiment of the present disclosure;
图5是根据本公开第五实施例的音频控制方法的流程图;FIG. 5 is a flowchart of an audio control method according to a fifth embodiment of the present disclosure; FIG.
图6是根据本公开第六实施例的音频控制装置的结构图。FIG. 6 is a configuration diagram of an audio control device according to a sixth embodiment of the present disclosure.
具体实施方式detailed description
以下结合附图以及实施例,对本公开进行进一步详细说明。应当理解,此处所描述的实施例仅仅用以解释本公开,并不限定本公开。The present disclosure will be further described in detail below in conjunction with the drawings and embodiments. It is to be understood that the embodiments described herein are merely illustrative of the disclosure and are not intended to be limiting.
实施例一Embodiment 1
本实施例提供一种音频控制方法,图1是根据本公开第一实施例的音频控制方法的流程图。本实施例的执行主体是移动终端,该移动终端安装有多个能够输出音频的应用程序。该移动终端例如是智能手机和平板电脑。The present embodiment provides an audio control method, and FIG. 1 is a flowchart of an audio control method according to a first embodiment of the present disclosure. The execution subject of this embodiment is a mobile terminal, and the mobile terminal is installed with a plurality of applications capable of outputting audio. The mobile terminal is, for example, a smartphone and a tablet.
步骤S110,检测是否有多个应用程序并发输出音频;若是,则执行步骤S120;若否,则继续执行步骤S110。Step S110, detecting whether there are multiple applications concurrently outputting audio; if yes, executing step S120; if not, proceeding to step S110.
并发输出音频是指多个应用程序都在输出音频。Concurrent output audio means that multiple applications are outputting audio.
由于应用程序输出音频需要先申请音频资源,申请到音频资源,就实 现了音频资源的占用,所以可以检测是否有多个应用程序申请到或正在占用音频资源,来判断是否有多个应用程序并发输出音频。Since the application outputs audio, you need to apply for audio resources first, and apply for audio resources. Now that the audio resources are occupied, it is possible to detect whether there are multiple applications applying for or occupying audio resources to determine whether multiple applications concurrently output audio.
音频资源包括:音频通道。通过音频通道输出音频。Audio resources include: audio channels. Output audio through the audio channel.
检测是否有多个应用程序都在占用音频资源;若是,则确定这多个应用程序并发输出音频;若否,则检测在应用程序占用音频资源的过程中,是否有其他应用程序申请音频资源,若有其他应用程序申请音频资源,且申请成功,则说明该其他应用程序和正在占用音频资源的应用程序并发输出音频;反之,则说明当前没有并发输出音频的应用程序。Detect whether multiple applications are occupying audio resources; if yes, determine that the multiple applications concurrently output audio; if not, detect whether other applications apply for audio resources while the application is occupying audio resources, If another application requests an audio resource and the application is successful, the other application and the application that is occupying the audio resource concurrently output audio; otherwise, the application that does not currently output audio concurrently.
在本实施例中,为了避免一个应用程序独占音频资源,在检测是否有多个应用程序并发输出音频过程中,可以屏蔽应用程序发送的用于申请独占音频资源的请求。In this embodiment, in order to prevent an application from monopolizing audio resources, in the process of detecting whether multiple applications concurrently output audio, the request sent by the application for applying for exclusive audio resources may be blocked.
步骤S120,在检测到有多个应用程序并发输出音频时,控制所述多个应用程序中的一个应用程序以第一音量输出音频,控制其余的应用程序以不同于第一音量的第二音量输出音频。Step S120, when it is detected that a plurality of applications concurrently output audio, control one of the plurality of applications to output audio at a first volume, and control the remaining applications to a second volume different from the first volume. Output audio.
在本实施例中,在音频并发场景中,只允许一路音频以高音量输出,而其他音频以低音量输出,控制第一音量高于第二音量。In the present embodiment, in the audio concurrent scene, only one audio is allowed to be output at a high volume, and other audio is output at a low volume, and the first volume is controlled to be higher than the second volume.
为了使用户可以清晰的听到多个音频中的音量最大的音频,使第一音量和第二音量之间的差值大于预设的音量阈值。该音量阈值为实验获得的值或者经验值。第一音量可以是预先设置的标准音量。该第一音量可以是用户根据自身需求设置的音量。以第二音量不会影响第一音量的收听为佳。In order to enable the user to clearly hear the loudest audio in the plurality of audios, the difference between the first volume and the second volume is greater than the preset volume threshold. The volume threshold is an experimentally obtained value or an empirical value. The first volume can be a preset standard volume. The first volume may be a volume set by the user according to his or her own needs. It is preferable that the second volume does not affect the listening of the first volume.
在音频并发场景中,获取每个应用程序的标记信息;根据每个应用程序的标记信息,确定以第一音量输出音频的应用程序,其余的应用程序均以第二音量输出音频。In the audio concurrent scene, the tag information of each application is acquired; the application that outputs the audio at the first volume is determined according to the tag information of each application, and the remaining applications output the audio at the second volume.
标记信息包括但不限于:应用程序的优先级标记、音频资源占用标记和前后台标记。音频资源占用标记可以是音频资源占用时间戳或者表征音频资源占用先后顺序的标记。前后台标记用于标记应用程序当前在前台运行或后台运行。 The tag information includes, but is not limited to, an application's priority tag, an audio resource occupancy tag, and a front-end tag. The audio resource occupation mark may be a time stamp of the audio resource occupation time or a mark indicating the order of occupation of the audio resources. The front and back tags are used to mark that the application is currently running in the foreground or in the background.
下面提供三种控制方式,但是以下三种控制方式只用于说明本公开,而不用于限定本公开:Three control modes are provided below, but the following three control modes are only used to illustrate the disclosure, and are not intended to limit the disclosure:
方式一,在音频并发的多个应用程序中,根据该多个应用程序的预设优先级,控制优先级最高的应用程序以第一音量输出音频,控制其余的应用程序以第二音量输出音频。In the first mode, in the plurality of audio concurrent applications, according to the preset priorities of the multiple applications, the application with the highest priority is controlled to output audio at the first volume, and the remaining applications are controlled to output the audio at the second volume. .
方式二,在音频并发的多个应用程序中,根据多个应用程序占用音频资源的先后顺序,控制最后(最新)占用音频资源的应用程序以第一音量输出音频,控制,控制其余的应用程序以第二音量输出音频。In the second mode, in multiple applications of audio concurrent, according to the order in which the plurality of applications occupy audio resources, the application that controls the last (latest) audio resource outputs audio at the first volume, controls, and controls the remaining applications. The audio is output at the second volume.
方式三,由于移动终端前台仅允许一个应用程序,所以在音频并发的多个应用程序中,根据多个应用程序的前后台标记,控制前台运行的应用程序以第一音量输出音频,控制后台运行的应用程序以第二音量输出音频。换言之,控制前台运行的应用程序输出音频时的音量高于后台运行的应用程序输出音频时的音量。In the third mode, since only one application is allowed in the foreground of the mobile terminal, in the multiple concurrent applications of the audio, the application running in the foreground is controlled to output audio at the first volume according to the front and back tags of the multiple applications, and the background operation is controlled. The app outputs audio at a second volume. In other words, the volume that controls the output of the application running in the foreground is higher than the volume when the application running in the background outputs audio.
以上三种方式可以单独应用或者结合应用,本实施例对此不做限定。The above three methods may be applied separately or in combination, and this embodiment does not limit this.
例如:如果存在优先级相同的应用程序,且最高优先级的应用程序有多个,则可以根据该多个应用程序占用音频资源的先后顺序或者前后台标记,控制该多个应用程序并发输出音频时的音量大小,如:控制最新占用音频资源的应用程序以第一音量输出音频,其余的应用程序以第二音量输出音频,在检测到前后台转换操作时,控制前台运行的应用程序以第一音量输出音频,后台运行的应用程序以第二音量输出音频。For example, if there are applications with the same priority and there are multiple applications with the highest priority, then the multiple applications can be controlled to output audio according to the order of the audio resources or the front and back tags. The volume of the volume, such as: control the latest audio resource application to output audio at the first volume, the remaining applications output audio at the second volume, control the foreground application when the front-end conversion operation is detected A volume outputs audio, and an application running in the background outputs audio at a second volume.
在本实施例中,如果音频并发输出,则只允许一路音频以高音量输出,而其他音频以低音量输出,低音量的音频对高音量的音频不产生影响,从而使用户可以清楚的听到高音量的音频。通过本实施例可以避免多路音频以相同音量输出或者相互中断的问题发生,用户体验好。In this embodiment, if the audio is output concurrently, only one audio is allowed to be output at a high volume, and other audio is output at a low volume, and the low volume audio does not affect the high volume audio, so that the user can clearly hear High volume audio. The present embodiment can avoid the problem that multiple channels of audio are outputted at the same volume or interrupted each other, and the user experience is good.
实施例二Embodiment 2
图2是根据本公开第二实施例的音频控制方法的流程图。2 is a flow chart of an audio control method according to a second embodiment of the present disclosure.
步骤S210,在检测到有多个应用程序并发输出音频时,触发音频并 发场景模式。Step S210, when it is detected that there are multiple applications concurrently outputting audio, the audio is triggered and Send scene mode.
在音频并发场景模式下需要对并发的音频进行音量控制。Volume control of concurrent audio is required in the audio concurrent scene mode.
如果有应用程序申请独占音频通道,则屏蔽该应用程序的独占请求。If an application requests an exclusive audio channel, the application's exclusive request is blocked.
为了使本实施例更加容易理解,在本实施例中,以两个应用程序并发输出音频为例。In order to make the embodiment easier to understand, in the embodiment, two applications concurrently output audio as an example.
步骤S220,将正在占用音频通道的应用程序标记为old,将新申请到音频通道的应用程序标记为new。In step S220, the application that is occupying the audio channel is marked as old, and the application that newly applies to the audio channel is marked as new.
old和new为音频资源占用标记。old表示先占用音频通道,new表示最后(最新)占用音频通道。Old and new are audio resource occupancy tags. Old means that the audio channel is occupied first, and new means that the last (latest) occupied audio channel.
如果音频并发的应用程序有多个,则可以使用占用音频通道的时间戳来确定多个应用程序占用音频资源的先后顺序。时间戳最靠近当前时间的为新申请到音频通道的应用程序,应标记为new,其余的应用程序都标记为old。If there are multiple audio concurrent applications, you can use the timestamps that occupy the audio channel to determine the order in which multiple applications consume audio resources. The application with the timestamp closest to the current time for the new application to the audio channel should be marked as new and the rest of the applications marked as old.
old对应的应用程序和new对应的应用程序都通过音频通道输出音频。The old corresponding application and the new corresponding application output audio through the audio channel.
步骤S230,将前台运行的应用程序标记为foreground task,将后台运行的应用程序标记为background task。In step S230, the application running in the foreground is marked as a foreground task, and the application running in the background is marked as a background task.
前后台标记用于表明应用程序当前在前台运行或在后台运行。The front and back flags are used to indicate that the application is currently running in the foreground or running in the background.
前后台标记包括:前台任务标记foreground task和后台任务标记background task。其中,foreground task表示应用程序在前台运行,background task表示应用程序在后台运行。The front and back background tags include: foreground task tag foreground task and background task tag background task. Among them, the foreground task indicates that the application is running in the foreground, and the background task indicates that the application is running in the background.
将当前运行在前台的应用程序标记为foreground task,将当前运行在后台的应用程序标记为background task。此时,并发输出音频的应用程序有可能都在后台运行,都在前台运行,或者分别在前台和后台运行。Mark the application currently running in the foreground as the foreground task, and mark the application currently running in the background as the background task. At this point, applications that output audio concurrently may all run in the background, running in the foreground, or running in the foreground and background.
步骤S240,查询old对应的应用程序和new对应的应用程序的优先级,并判断最高优先级的应用程序的数量是否为多个;如果是,则执行步骤S250;如果否,则执行步骤S270。 Step S240, querying the priority of the application corresponding to the old and the application corresponding to the new, and determining whether the number of the highest priority applications is plural; if yes, executing step S250; if not, executing step S270.
预先设置应用优先级表。在该应用优先级表中包括多个应用程序的名称以及每个应用程序的优先级的数值。优先级的数值为大于等于0的整数值,数值越大则优先级越高,数值越小则优先级越低。如果在该应用优先级表中没有某一应用程序的名称,则默认该应用程序的优先级为0。The application priority table is set in advance. The name of the plurality of applications and the value of the priority of each application are included in the application priority table. The value of the priority is an integer value greater than or equal to 0. The larger the value, the higher the priority, and the smaller the value, the lower the priority. If there is no application name in the application priority table, the application has a priority of 0 by default.
查询应用优先级表,确定old对应的应用程序和new对应的应用程序的优先级,找到优先级最高的应用程序,即找到优先级的数值最大的应用程序,判断优先级的数值最大的应用程序的数量是否为多个。Query the application priority table, determine the priority of the application corresponding to the old and the application corresponding to the new, find the application with the highest priority, that is, find the application with the highest priority value, and determine the application with the highest priority value. Whether the number is multiple.
在本实施例中,预先设置在最高优先级的应用程序只有一个的情况下,使最高优先级的应用程序以第一音量输出音频;在最高优先级的应用程序有多个的情况下,在检测到前后台切换操作之前,使最后占用音频资源的应用程序以第一音量输出音频,在检测到前后台切换操作之后,使前台运行的应用程序以第一音量输出音频。In this embodiment, in the case where there is only one application with the highest priority, the highest priority application outputs audio at the first volume; in the case where there are multiple applications with the highest priority, Before detecting the front-end switching operation, the application that last occupies the audio resource outputs the audio at the first volume, and after detecting the front-end switching operation, causes the application running in the foreground to output the audio at the first volume.
步骤S250,根据占用音频通道的先后顺序,控制old对应的应用程序以低音量输出音频,控制new对应的应用程序以高音量输出音频。In step S250, according to the order of occupying the audio channels, the application corresponding to the old control outputs the audio at a low volume, and the application corresponding to the new control outputs the audio at a high volume.
预先设置高音量volume_high和低音量volume_low。The high volume volume_high and the low volume volume_low are set in advance.
其中,0<=volume_low<volume_high。volume_high为第一音量,其可以是标准音量。该标准音量可以是终端当前设定的音量或者是用户根据自身需要设置的音量。volume_low为第二音量,其可以是标准音量的20%。Where 0<=volume_low<volume_high. Volume_high is the first volume, which can be the standard volume. The standard volume can be the volume currently set by the terminal or the volume set by the user according to his or her own needs. Volume_low is the second volume, which can be 20% of the standard volume.
在检测到前后台切换操作之前,使最后占用音频资源的应用程序以高音量输出音频,使其他先占用音频资源的应用程序以低音量输出音频;所以在暂时没有检测到前后台切换操作之前,控制old对应的应用程序在输出音频时将音量调整到低音量volume_low,控制new对应的应用程序在输出音频时将音量调整到高音量volume_high。Before detecting the front-end switching operation, the application that last occupies the audio resource outputs the audio at a high volume, so that other applications that occupy the audio resource output the audio at a low volume; therefore, before the front-end switching operation is temporarily detected, The application corresponding to the control old adjusts the volume to the low volume volume_low when the audio is output, and the application corresponding to the new control adjusts the volume to the high volume volume_high when the audio is output.
步骤S260,在检测到前后台切换操作之后,控制foreground task对应的应用程序以高音量输出音频,控制background task对应的的应用程序以低音量输出音频。Step S260, after detecting the front-end background switching operation, the application corresponding to the foreground task is controlled to output audio at a high volume, and the application corresponding to the background task is controlled to output audio at a low volume.
在检测到前后台切换操作后,对多个应用程序的前后台标记进行更新。 The front and back tags of multiple applications are updated after the front and back office switching operations are detected.
例如:如果检测到old对应的应用程序被切换到前台运行,new对应的应用程序被切换到后台运行,则将old对应的应用程序的前后台标记修改为foreground task,将new对应的的应用程序的前后台标记修改为background task。For example, if it is detected that the application corresponding to old is switched to the foreground, and the corresponding application of new is switched to run in the background, the front and back tags of the application corresponding to old are modified to the foreground task, and the corresponding application of new is The front and back background tags are modified to background task.
在检测到前后台切换操作后,使前台运行的应用程序输出音频时的音量高于后台运行的应用程序输出音频时的音量。例如:之前old对应的应用程序的前后台标记为background task,new对应的应用程序的前后台标记为foreground task,而在切换后,old对应的应用程序的前后台标记被修改为foreground task,new对应的的应用程序的前后台标记被修改为background task,所以控制old对应的应用程序在输出音频时将音量调整到高音量volume_high,控制new对应的应用程序在输出音频时将音量调整到低音量volume_low。After detecting the front-end switching operation, the volume of the application running in the foreground is higher than the volume when the application running in the background outputs the audio. For example, the front and back of the application corresponding to old are marked as background task, and the front and back of the application corresponding to new are marked as foreground task, and after the switch, the front and back flags of the application corresponding to old are modified to foreground task, new The corresponding background mark of the application is modified to background task, so the application corresponding to the control old adjusts the volume to the high volume volume_high when outputting the audio, and the application corresponding to the new control adjusts the volume to the low volume when outputting the audio. Volume_low.
步骤S270,控制优先级最高的应用程序以高音量输出音频,其他应用程序以低音量输出音频。In step S270, the application with the highest priority is controlled to output audio at a high volume, and the other application outputs audio at a low volume.
如果优先级最高的应用程序为old对应的应用程序,则可以将该old对应的应用程序的音频做淡入或淡出处理,在预定时间段内将音量值调整到volume_high。可以对其他应用程序的音频做淡入处理,在预定时间段内将音频调整到volume_low。预定时间段例如是0.5s。If the application with the highest priority is the application corresponding to the old, the audio of the application corresponding to the old may be faded in or out, and the volume value is adjusted to volume_high within a predetermined period of time. You can fade in the audio of other applications and adjust the audio to volume_low for a predetermined period of time. The predetermined time period is, for example, 0.5 s.
如果优先级最高的应用程序为new对应的应用程序,则可以将new对应的应用程序所输出的音频做淡入处理,在预定时间段内将音量从零开始逐渐增大,直至音量值达到volume_high为止;可以对old对应的应用程序所输出的音频做淡出处理,在预定时间段内从当前音量逐渐降低,直至音量值达到volume_low为止。If the application with the highest priority is the application corresponding to new, the audio output by the application corresponding to new can be faded in, and the volume is gradually increased from zero in the predetermined time period until the volume value reaches volume_high. The audio output by the application corresponding to the old can be faded out, and gradually decreased from the current volume within a predetermined period of time until the volume value reaches volume_low.
在执行本实施例中的过程,如果有应用程序释放音频通道,则利用该应用程序的默认音量、前一次设置的音量或者标准音量输出音频;如果仅剩一个应用程序占用音频通道,则结束本流程。In the process of executing the embodiment, if an application releases the audio channel, the audio is output by using the default volume of the application, the volume set at the previous time, or the standard volume; if only one application occupies the audio channel, the end is ended. Process.
在执行本实施例中的过程,如果有新的应用程序申请到音频通道,则 从步骤S210开始执行,对音频并发的各个应用程序进行音量控制。In performing the process in this embodiment, if a new application applies to the audio channel, then Execution starts from step S210, and volume control is performed on each application of audio concurrent.
在本实施例中,在多个应用程序的优先级不相同的情况下,根据多个应用程序的优先级高低,控制该多个应用程序并发输出音频时的音量大小;在多个应用程序的优先级相同的情况下,根据多个应用程序占用音频资源的先后顺序,以及根据多个应用程序的前后台标记,控制该多个应用程序并发输出音频时的音量大小。In this embodiment, in a case where the priorities of the plurality of applications are different, according to the priority levels of the plurality of applications, the volume of the plurality of applications concurrently outputting the audio is controlled; in the plurality of applications When the priorities are the same, according to the order in which the plurality of applications occupy the audio resources, and according to the front and back tags of the plurality of applications, the volume of the plurality of applications concurrently outputting the audio is controlled.
下面提供三个具体的应用实例来进一步地说明本公开。Three specific application examples are provided below to further illustrate the present disclosure.
实施例三Embodiment 3
在本实施例中,音频并发场景中的应用程序数量为两个,以优先级作为控制音频音量的标准。预先设置导航应用B的优先级高于音乐播放器A的优先级。图3是根据本公开第三实施例的音频控制方法的流程图。In this embodiment, the number of applications in the audio concurrent scene is two, with the priority as a criterion for controlling the audio volume. The priority of the navigation application B is set in advance to be higher than the priority of the music player A. FIG. 3 is a flowchart of an audio control method according to a third embodiment of the present disclosure.
步骤S310,使用音乐播放器A持续播放音乐。In step S310, the music player A is continuously played.
此时,导航应用B没有发起路况语音播报,而音乐播放器A在持续播放音乐,只有音乐播放器A在占用移动终端的音频通道,没有进入音频并发场景,所以将音乐播放器A的音频保持以volume_high音量输出。At this time, the navigation application B does not initiate the road voice broadcast, and the music player A continues to play the music, only the music player A is occupying the audio channel of the mobile terminal, and does not enter the audio concurrent scene, so the audio of the music player A is maintained. Output at volume_high volume.
步骤S320,打开导航应用B,启动导航功能。In step S320, the navigation application B is opened to start the navigation function.
导航应用B启动导航功能之后,导航应用B可以语音播报路况。After the navigation application B starts the navigation function, the navigation application B can voice report the road condition.
当导航应用B发起路况语音播报时,需要向移动终端申请音频通道。此时,导航应用B尚未发起路况语音播报,所以尚未触发音频并发场景模式。When the navigation application B initiates a road voice broadcast, it needs to apply for an audio channel to the mobile terminal. At this time, the navigation application B has not initiated the road voice broadcast, so the audio concurrent scene mode has not been triggered yet.
移动终端判断已占用和即将占用音频通道的音乐播放器A和导航应用B是否申请独占音频通道,如果是,则屏蔽该独占音频通道的请求,并进入音频并发场景。The mobile terminal determines whether the music player A and the navigation application B that have occupied and are about to occupy the audio channel apply for an exclusive audio channel, and if so, shields the request for the exclusive audio channel and enters the audio concurrent scene.
步骤S330,当导航应用B申请音频通道时,触发音频并发场景模式。Step S330, when the navigation application B applies for an audio channel, the audio concurrent scene mode is triggered.
当导航应用B发起路况语音播报时,导航应用B向移动终端申请音频通道;通过查询应用优先级表,可以确定导航应用B的优先级高于音乐 播放器A的优先级。When the navigation application B initiates a road state voice broadcast, the navigation application B applies for an audio channel to the mobile terminal; by querying the application priority table, it can be determined that the navigation application B has a higher priority than the music. Player A's priority.
步骤S340,导航应用B的优先级高于音乐播放器A的优先级,控制导航应用B以高音量输出音频,控制音乐播放器A以低音量输出音频。In step S340, the priority of the navigation application B is higher than the priority of the music player A, and the navigation application B is controlled to output audio at a high volume, and the music player A is controlled to output audio at a low volume.
由于导航应用B的优先级高于音乐播放器A的优先级,将音乐播放器A的音频做淡出处理,在预定时间段内(如0.5s内)从当前音量逐渐降低,直至音量值达到volume_low(如标准音量的20%);将导航应用B音频做淡入处理,在预定时间段内从零开始增大音量,直至音量值达到volume_high(如标准音量)。Since the priority of the navigation application B is higher than the priority of the music player A, the audio of the music player A is faded out, and the current volume is gradually decreased within a predetermined period of time (for example, within 0.5 s) until the volume value reaches volume_low. (such as 20% of the standard volume); the navigation application B audio is faded in, and the volume is increased from zero in the predetermined time period until the volume value reaches volume_high (such as the standard volume).
步骤S350,导航应用B的路况语音播报完毕之后,控制音乐播放器A以高音量输出音频。Step S350, after the road condition voice broadcast of the navigation application B is completed, the music player A is controlled to output the audio at a high volume.
导航应用B的路况语音播报完毕,导航应用B占用音频通道的行为结束,导航应用B释放音频通道,将音乐播放器A的音频音量恢复至volume_high。After the navigation of the application B is completed, the behavior of the navigation application B occupies the audio channel ends, and the navigation application B releases the audio channel to restore the audio volume of the music player A to volume_high.
当导航应用B再次发起路况语音播报时,重复上述步骤S330至步骤S350。When the navigation application B initiates the road state voice broadcast again, the above steps S330 to S350 are repeated.
当导航应用B被关闭时,将音乐播放器A的音量恢复至volume_high。When the navigation application B is turned off, the volume of the music player A is restored to volume_high.
实施例四Embodiment 4
在本实施例中,音频并发场景中的应用程序数量为两个,以优先级、申请音频资源的先后顺序以及前后台任务属性作为控制音频音量的标准。预先设置音乐播放器A和视频应用C的优先级相同。In this embodiment, the number of applications in the audio concurrent scene is two, and the priority, the order of applying audio resources, and the front and back task attributes are used as standards for controlling the audio volume. It is preset that the music player A and the video application C have the same priority.
图4是根据本公开第四实施例的音频控制方法的流程图。FIG. 4 is a flowchart of an audio control method according to a fourth embodiment of the present disclosure.
步骤S410,使音乐播放器A在后台持续播放音乐。In step S410, the music player A is continuously played in the background.
只有音乐播放器A占用移动终端的音频通道,没有进入音频并发场景模式。Only the music player A occupies the audio channel of the mobile terminal, and does not enter the audio concurrent scene mode.
步骤S420,打开视频应用C,使视频应用C在前台播放视频,触发音频并发场景模式。 In step S420, the video application C is opened, so that the video application C plays the video in the foreground, triggering the audio concurrent scene mode.
视频应用C播放视频需要向申请音频通道,可以检测到音乐播放器A和视频应用C并发输出音频,进而触发音频并发场景模式。The video application C needs to apply for an audio channel, and it can detect that the music player A and the video application C concurrently output audio, thereby triggering the audio concurrent scene mode.
步骤S430,将音乐播放器A标记为old,将视频应用C标记为new,同时记录音乐播放器A和视频应用C的前后台标记。In step S430, the music player A is marked as old, the video application C is marked as new, and the front and back marks of the music player A and the video application C are recorded.
音乐播放器A在后台运行,视频应用C在前台运行,音乐播放器A的前后台标记为background task,视频应用C的前后台标记为foreground task。The music player A runs in the background, the video application C runs in the foreground, the front and back of the music player A is marked as the background task, and the front and back of the video application C is marked as the foreground task.
判断已占用和即将占用音频通道的音乐播放器A和视频应用C是否申请独占音频通道,如果是,则屏蔽该独占音频通道的请求,并进入音频并发场景。It is judged whether the music player A and the video application C that have occupied and are about to occupy the audio channel apply for an exclusive audio channel, and if so, the request for the exclusive audio channel is blocked, and the audio concurrent scene is entered.
步骤S440,通过查询应用优先级表,确定音乐播放器A和视频应用C的优先级相同。In step S440, it is determined that the priorities of the music player A and the video application C are the same by querying the application priority table.
步骤S450,根据视屏应用C和音乐播放器A占用音频通道的先后顺序,控制视频应用C以高音量输出音频,控制音乐播放器A以低音量输出音频。Step S450, according to the order in which the video application C and the music player A occupy the audio channel, the video application C is controlled to output audio at a high volume, and the music player A is controlled to output audio at a low volume.
预先设置在应用程序的优先级相同时,按照申请音频通道的先后顺序,使先申请音频通道的应用程序以低音量输出音频,使后申请音频通道的应用程序以高音了输出音频。Pre-set When the application's priority is the same, according to the order of the applied audio channels, the application that applies for the audio channel first outputs the audio at a low volume, so that the application that applies for the audio channel outputs the audio with a high pitch.
由于音乐播放器A和视频应用C的优先级相同,将old(音乐播放器A)对应的音频做淡出处理,在预定时间段内(如0.5s)从当前音量逐渐降低,直至音量值达到volume_low(如标准音量的20%);将new(视频应用C)对应的音频做淡入处理,在预定时间段内(如0.5s)将音量从零开始增大,直至音量值达到volume_high(如标准音量)。Since the music player A and the video application C have the same priority, the audio corresponding to the old (music player A) is faded out, and gradually decreases from the current volume within a predetermined period of time (eg, 0.5 s) until the volume value reaches volume_low. (such as 20% of the standard volume); fade the audio corresponding to new (video application C), increase the volume from zero within a predetermined time period (such as 0.5s) until the volume reaches volume_high (such as the standard volume) ).
步骤S460,如果视频应用C暂停视频播放,则控制音乐播放器A以高音量输出音频。Step S460, if the video application C pauses the video playback, the music player A is controlled to output the audio at a high volume.
在音乐播放器A在后台持续播放音乐的过程中,用户选择暂停播放视频应用C的视频,原来被视频应用C占用的音频通道被释放,这时将音 乐播放器A的音频音量恢复至volume_high。如果视频应用C再次恢复视频播放,再次触发音频并发场景模式,则重复以上步骤S420至步骤S460。In the process that the music player A continuously plays music in the background, the user selects to pause the video of the video application C, and the audio channel originally occupied by the video application C is released, then the sound is released. The audio volume of the player A is restored to volume_high. If the video application C resumes the video playback again and the audio concurrent scene mode is triggered again, the above steps S420 to S460 are repeated.
当然,如果视频应用C正在播放视频的过程,如果音乐播放器A暂停音乐播放,则控制视频应用C以高音量volume_high输出音频。Of course, if the video application C is playing a video, if the music player A pauses the music playback, the video application C is controlled to output the audio at a high volume volume_high.
步骤S470,如果将视频应用C从前台切换到后台运行,将音乐播放器A从后台切换到前台运行,则修改音乐播放器A和视频应用C的前后台标记,并控制视频应用C以低音量输出音频,控制音乐播放器A以高音量输出音频。Step S470, if the video application C is switched from the foreground to the background, and the music player A is switched from the background to the foreground, the front and back marks of the music player A and the video application C are modified, and the video application C is controlled to have a low volume. Output audio, control music player A to output audio at high volume.
在修改音乐播放器A和视频应用C的前后台标记之后,可以将background task(视频应用C)对应的音频做淡出处理,在预设时间段内(如0.5s)从当前音量降低,直至音量值达到volume_low(如标准音量的20%);将foreground task(音乐播放器A)对应的音频在预定时间段内(如0.5s)增大音量值到volume_high(如标准音量)。After modifying the front and back marks of the music player A and the video application C, the audio corresponding to the background task can be faded out, and the current volume is reduced from the current volume to the volume within a preset time period (eg, 0.5 s). The value reaches volume_low (such as 20% of the standard volume); the audio corresponding to the foreground task (the music player A) is increased in volume to volume_high (such as the standard volume) for a predetermined period of time (such as 0.5s).
如果用户关闭音乐播放器A,则将视频应用C音量调整到volume_high。If the user turns off music player A, the video application C volume is adjusted to volume_high.
如果用户关闭视频应用C,则将音乐播放器A的音量调整到volume_high。If the user closes the video application C, the volume of the music player A is adjusted to volume_high.
实施例五Embodiment 5
在本实施例中,音频并发场景中的应用程序数量为三个,以优先级和占用音频资源的先后顺序作为控制音频音量的标准。在本实施例中,设置导航应用B的优先级和社交应用D的优先级相同,社交应用D的优先级高于音乐播放器A的优先级。In this embodiment, the number of applications in the audio concurrent scene is three, and the priority and the order of occupying the audio resources are used as criteria for controlling the audio volume. In this embodiment, the priority of the navigation application B is set to be the same as the priority of the social application D, and the priority of the social application D is higher than the priority of the music player A.
图5是根据本公开第五实施例的音频控制方法的流程图。FIG. 5 is a flowchart of an audio control method according to a fifth embodiment of the present disclosure.
步骤S510,使音乐播放器A在后台持续播放音乐。In step S510, the music player A is continuously played in the background.
只有音乐播放器A占用移动终端的音频通道,没有进入音频并发场景模式。Only the music player A occupies the audio channel of the mobile terminal, and does not enter the audio concurrent scene mode.
步骤S520,打开导航应用B,启动导航功能,使导航应用B在后台 运行。Step S520, open the navigation application B, start the navigation function, and make the navigation application B in the background run.
当导航应用B发起路况语音播报时,需要向移动终端申请音频通道。此时,导航应用B尚未发起路况语音播报,所以尚未触发音频并发场景模式。When the navigation application B initiates a road voice broadcast, it needs to apply for an audio channel to the mobile terminal. At this time, the navigation application B has not initiated the road voice broadcast, so the audio concurrent scene mode has not been triggered yet.
步骤S530,在前台运行的社交应用D接收到视频聊天请求,申请占用视频通道,触发音频并发场景模式。In step S530, the social application D running in the foreground receives the video chat request, requests to occupy the video channel, and triggers the audio concurrent scene mode.
在执行本实施例的过程中,移动终端判断音乐播放器A、导航应用B和社交应用D是否申请独占音频通道,如果是,则屏蔽该独占音频通道的请求,并进入音频并发场景。In the process of executing the embodiment, the mobile terminal determines whether the music player A, the navigation application B, and the social application D apply for an exclusive audio channel, and if so, blocks the request for the exclusive audio channel and enters the audio concurrent scene.
步骤S540,将音乐播放器A标记为old,将社交应用D标记为new。In step S540, the music player A is marked as old and the social application D is marked as new.
因为导航应用B尚未发起路况语音播报,所以暂时不用对导航应用B进行音频资源占用标记。Since the navigation application B has not initiated the road state voice broadcast, the audio resource occupancy mark of the navigation application B is not temporarily used.
步骤S550,社交应用D的优先级高于音乐播放器A的优先级,控制社交应用D以高音量输出音频,音乐播放器A以低音量输出音频。In step S550, the priority of the social application D is higher than the priority of the music player A, the social application D is controlled to output audio at a high volume, and the music player A outputs audio at a low volume.
在应用优先级表中查询社交应用D的优先级和音乐播放器A的优先级,并判断社交应用D和音乐播放器A的优先级的高低。The priority of the social application D and the priority of the music player A are queried in the application priority table, and the priorities of the social application D and the music player A are determined.
由于社交应用D优先级高于音乐播放器A,将音乐播放器A的音频做淡出处理,在预定时间段内(如0.5s)从当前音量逐渐降低,直至音量值达到volume_low(如标准音量的20%);将社交应用D的音频做淡入处理,在预定时间段内(如0.5s)将音量从零开始逐渐增大,直至音量值达到volume_high(如标准音量)。Since the social application D has a higher priority than the music player A, the music of the music player A is faded out, and gradually decreases from the current volume within a predetermined time period (for example, 0.5 s) until the volume value reaches volume_low (such as the standard volume). 20%); the audio of the social application D is faded in, and the volume is gradually increased from zero in a predetermined period of time (for example, 0.5 s) until the volume value reaches volume_high (such as the standard volume).
社交应用D的视频聊天在前台持续以较高音量值进行,而音乐播放器A的音乐播放在后台持续以较低音量值进行,因此在播放音乐时不影响用户视频聊天。The video chat of social application D continues to be performed at a higher volume value in the foreground, while the music playback of music player A continues to be performed at a lower volume value in the background, so the user's video chat is not affected when playing music.
步骤S560,后台运行的导航应用B发起路况语音播放,申请音频通道。 In step S560, the navigation application B running in the background initiates road state voice playback and applies for an audio channel.
在使用社交应用D进行视频聊天,使用音乐播放器A播放音乐的过程中,导航应用B发起路况语音播放,申请音频通道,这是音乐播放器A、导航应用B和社交应用D都占用音频通道。In the process of using the social application D for video chat and using the music player A to play music, the navigation application B initiates road state voice playback and applies for an audio channel, which is a music channel for the music player A, the navigation application B, and the social application D. .
步骤S570,按照音乐播放器A、导航应用B和社交应用D申请占用音频资源的先后顺序进行标记,将音乐播放器A和社交应用D标记为old,将导航应用标记为new。Step S570, marking in accordance with the order in which the music player A, the navigation application B, and the social application D apply for occupying audio resources, marking the music player A and the social application D as old, and marking the navigation application as new.
步骤S580,导航应用B的优先级和社交应用D的优先级相同,社交应用D的优先级高于音乐播放器A的优先级,控制最后占用音频通道的导航应用B以高音量输出音频,控制音乐播放器A和社交应用D以低音量输出音频。Step S580, the priority of the navigation application B and the priority of the social application D are the same, the priority of the social application D is higher than the priority of the music player A, and the navigation application B that last occupies the audio channel controls the audio output at a high volume, and controls Music player A and social application D output audio at a low volume.
由于有多个最高优先级的应用程序,所以在这多个应用程序中确定最后占用音频通道的应用程序,在本实施例中,最后占用音频通道的应用程序为导航应用B,将导航应用B的音频做淡入处理,在预定时间段内(如0.5s)将音量从零开始逐渐增大,直至音量值达到volume_high(如标准音量);则将old(音乐播放器A和社交应用D)对应的应用程序的音频做淡出处理,在较短时间内(如0.5s)从当前音量降低,直至音量值达到volume_low(如标准音量的20%)。Since there are a plurality of applications with the highest priority, the application that last occupies the audio channel is determined among the plurality of applications. In this embodiment, the application that last occupies the audio channel is the navigation application B, and the navigation application B The audio is fade-in processed, and the volume is gradually increased from zero in a predetermined period of time (such as 0.5 s) until the volume value reaches volume_high (such as the standard volume); then the old (music player A and social application D) are correspondingly The audio of the application is faded out, and the volume is reduced from the current volume in a short time (such as 0.5s) until the volume value reaches volume_low (such as 20% of the standard volume).
当导航应用B的路况语音播报完毕之后,需要跳转到步骤S540,重新对音乐播放器A和社交应用D进行音频资源占用标记。After the traffic condition broadcast of the navigation application B is completed, it is necessary to jump to step S540 to re-mark the audio resource occupation mark for the music player A and the social application D.
当导航应用B再次发起路况语音播报时,重复上述步骤S560至步骤S580。When the navigation application B initiates the road state voice broadcast again, the above steps S560 to S580 are repeated.
当用户结束社交应用D的视频聊天时,社交应用D释放占用的音频通道,这时,如果导航应用B没有发起路况语音播报,而音乐播放器A在持续播放音乐,则只有音乐播放器A在占用音频通道,所以可以将音乐播放器A输出的音量提升到volume_high。When the user ends the video chat of the social application D, the social application D releases the occupied audio channel. At this time, if the navigation application B does not initiate the road voice broadcast, and the music player A continues to play the music, only the music player A is Occupy the audio channel, so you can boost the volume of the music player A output to volume_high.
实施例六Embodiment 6
本实施例提供一种音频控制装置。图6是根据本公开第六实施例的音 频控制装置的结构图。This embodiment provides an audio control device. FIG. 6 is a sound according to a sixth embodiment of the present disclosure. Structure diagram of the frequency control device.
该装置包括:The device includes:
检测模块610,设置为检测是否有多个应用程序并发输出音频。The detecting module 610 is configured to detect whether there are multiple applications concurrently outputting audio.
控制模块620,设置为在检测到有多个应用程序并发输出音频时,控制所述多个应用程序中的一个应用程序以第一音量输出音频,控制其余的应用程序以不同于第一音量的第二音量输出音频。进一步地,控制所述第一音量高于所述第二音量。The control module 620 is configured to, when detecting that a plurality of applications concurrently output audio, control one of the plurality of applications to output audio at a first volume, and control the remaining applications to be different from the first volume The second volume outputs audio. Further, controlling the first volume is higher than the second volume.
在一个实施例中,控制模块620,进一步设置为根据所述多个应用程序的预设优先级,控制优先级最高的应用程序以第一音量输出音频。In one embodiment, the control module 620 is further configured to control the highest priority application to output audio at the first volume according to the preset priorities of the plurality of applications.
在另一实施例中,控制模块620,进一步设置为根据所述多个应用程序占用音频资源的先后顺序,控制最后占用音频资源的应用程序以第一音量输出音频。In another embodiment, the control module 620 is further configured to control the application that last occupies the audio resource to output the audio at the first volume according to a sequence in which the plurality of applications occupy audio resources.
在又一实施例中,控制模块620,进一步设置为控制在前台运行的应用程序以第一音量输出音频。In yet another embodiment, the control module 620 is further configured to control the application running in the foreground to output audio at the first volume.
在再一实施例中,控制模块620,还设置为在检测是否有多个应用程序并发输出音频过程中,屏蔽应用程序发送的用于申请独占音频资源的请求。In still another embodiment, the control module 620 is further configured to block, in the process of detecting whether there are multiple applications concurrently outputting audio, the request sent by the application for requesting exclusive audio resources.
本实施例所述的装置的功能已经在图1~图5所示的方法实施例中进行了描述,故本实施例的描述中未详尽之处,可以参见前述实施例中的相关说明,在此不做赘述。The functions of the device in this embodiment have been described in the method embodiments shown in FIG. 1 to FIG. 5. Therefore, in the description of the present embodiment, reference may be made to the related description in the foregoing embodiment. This will not be repeated.
尽管为示例目的,已经公开了本公开的可选实施例,本领域的技术人员将意识到各种改进、增加和取代也是可能的,因此,本公开的范围应当不限于上述实施例。Although alternative embodiments of the present disclosure have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are also possible, and thus the scope of the present disclosure should not be limited to the embodiments described above.
实施例七Example 7
本公开的实施例还提供了一种存储介质。可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码: Embodiments of the present disclosure also provide a storage medium. Optionally, in the present embodiment, the storage medium is arranged to store program code for performing the following steps:
S1,检测是否有多个应用程序并发输出音频;S1, detecting whether there are multiple applications concurrently outputting audio;
S2,在检测到有多个应用程序并发输出音频时,控制多个应用程序中的一个应用程序以第一音量输出音频,控制其余的应用程序以不同于第一音量的第二音量输出音频。S2. When detecting that multiple applications concurrently output audio, control one of the plurality of applications to output audio at the first volume, and control the remaining applications to output the audio at a second volume different from the first volume.
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
S1,根据多个应用程序的预设优先级,控制优先级最高的应用程序以第一音量输出音频。S1, according to the preset priority of the plurality of applications, the application with the highest priority is controlled to output the audio at the first volume.
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
S1,根据多个应用程序占用音频资源的先后顺序,控制最后占用音频资源的应用程序以第一音量输出音频。S1: The application that last occupies the audio resource outputs the audio at the first volume according to the order in which the plurality of applications occupy the audio resources.
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
S1,控制在前台运行的应用程序以第一音量输出音频。S1, controlling an application running in the foreground to output audio at a first volume.
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:Optionally, the storage medium is further arranged to store program code for performing the following steps:
S1,屏蔽应用程序发送的用于申请独占音频资源的请求。S1, the request sent by the application for requesting exclusive audio resources is blocked.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.
上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present disclosure are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
工业实用性Industrial applicability
本公开通过检测是否有多个应用程序并发输出音频,若是,则只允许一路音频以高音量输出,而其他音频以低音量输出,低音量的音频对高音量的音频不产生影响,从而使用户可以清楚的听到高音量的音频。本公开通过对多路音频进行控制,可以避免多路音频以相同音量输出或者相互中断的问题发生,用户体验好。 The present disclosure detects whether there are multiple applications concurrently outputting audio, and if so, only one audio is allowed to be output at a high volume, while other audio is output at a low volume, and the low volume audio does not affect the high volume audio, thereby making the user You can clearly hear high volume audio. By controlling multiple audio channels, the present disclosure can avoid the problem that multiple audio outputs are output at the same volume or interrupt each other, and the user experience is good.

Claims (11)

  1. 一种音频控制方法,包括:An audio control method includes:
    检测是否有多个应用程序并发输出音频;Detect if there are multiple applications that output audio concurrently;
    在检测到有多个应用程序并发输出音频时,控制所述多个应用程序中的一个应用程序以第一音量输出音频,控制其余的应用程序以不同于所述第一音量的第二音量输出音频。When detecting that a plurality of applications concurrently output audio, controlling one of the plurality of applications to output audio at a first volume, and controlling the remaining applications to output a second volume different from the first volume Audio.
  2. 如权利要求1所述的方法,其中,所述控制所述多个应用程序中的一个应用程序以第一音量输出音频,包括:The method of claim 1, wherein the controlling one of the plurality of applications to output audio at a first volume comprises:
    根据所述多个应用程序的预设优先级,控制优先级最高的应用程序以第一音量输出音频。The application with the highest priority is controlled to output audio at the first volume according to the preset priorities of the plurality of applications.
  3. 如权利要求1所述的方法,其中,所述控制所述多个应用程序中的一个应用程序以第一音量输出音频,包括:The method of claim 1, wherein the controlling one of the plurality of applications to output audio at a first volume comprises:
    根据所述多个应用程序占用音频资源的先后顺序,控制最后占用音频资源的应用程序以第一音量输出音频。The application that last occupies the audio resource outputs the audio at the first volume according to the order in which the plurality of applications occupy the audio resources.
  4. 如权利要求1所述的方法,其中,所述控制所述多个应用程序中的一个应用程序以第一音量输出音频,包括:The method of claim 1, wherein the controlling one of the plurality of applications to output audio at a first volume comprises:
    控制在前台运行的应用程序以第一音量输出音频。Controls the application running in the foreground to output audio at the first volume.
  5. 如权利要求1-4中任一项所述的方法,其中,在检测是否有多个应用程序并发输出音频过程中,还包括:The method according to any one of claims 1 to 4, wherein, in the process of detecting whether a plurality of applications concurrently output audio, the method further comprises:
    屏蔽应用程序发送的用于申请独占音频资源的请求。Blocks requests sent by the application to request exclusive audio resources.
  6. 一种音频控制装置,包括:An audio control device includes:
    检测模块,设置为检测是否有多个应用程序并发输出音频;a detection module configured to detect whether multiple applications concurrently output audio;
    控制模块,设置为在检测到有多个应用程序并发输出音频时,控制所述多个应用程序中的一个应用程序以第一音量输出音频,控制其余的应用程序以不同于所述第一音量的第二音量输出音频。a control module, configured to control one of the plurality of applications to output audio at a first volume when detecting that a plurality of applications concurrently output audio, and control the remaining applications to be different from the first volume The second volume outputs audio.
  7. 如权利要求6所述的装置,其中,所述控制模块,进一步设置为 根据所述多个应用程序的预设优先级,控制优先级最高的应用程序以第一音量输出音频。The apparatus of claim 6 wherein said control module is further configured to The application with the highest priority is controlled to output audio at the first volume according to the preset priorities of the plurality of applications.
  8. 如权利要求6所述的装置,其中,所述控制模块,进一步设置为根据所述多个应用程序占用音频资源的先后顺序,控制最后占用音频资源的应用程序以第一音量输出音频。The apparatus according to claim 6, wherein the control module is further configured to control an application that last occupies an audio resource to output audio at a first volume according to a sequence in which the plurality of applications occupy audio resources.
  9. 如权利要求6所述的装置,其中,所述控制模块,进一步设置为控制在前台运行的应用程序以第一音量输出音频。The apparatus of claim 6, wherein the control module is further configured to control an application running in the foreground to output audio at the first volume.
  10. 如权利要求6-9中任一项所述的装置,其中,所述控制模块,还设置为在检测是否有多个应用程序并发输出音频过程中,屏蔽应用程序发送的用于申请独占音频资源的请求。The apparatus according to any one of claims 6-9, wherein the control module is further configured to, in the process of detecting whether a plurality of applications concurrently output audio, the application sent by the shielding application for applying for exclusive audio resources Request.
  11. 一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行上述权利要求1至5任一项中所述的方法。 A storage medium comprising a stored program, wherein the program is executed to perform the method of any of the preceding claims 1 to 5.
PCT/CN2017/092838 2016-09-26 2017-07-13 Audio control method and device, and storage medium WO2018054139A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610853138.5A CN107870759A (en) 2016-09-26 2016-09-26 A kind of audio control method and device
CN201610853138.5 2016-09-26

Publications (1)

Publication Number Publication Date
WO2018054139A1 true WO2018054139A1 (en) 2018-03-29

Family

ID=61689747

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/092838 WO2018054139A1 (en) 2016-09-26 2017-07-13 Audio control method and device, and storage medium

Country Status (2)

Country Link
CN (1) CN107870759A (en)
WO (1) WO2018054139A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112437383A (en) * 2020-11-09 2021-03-02 中国第一汽车股份有限公司 Multi-sound-source adjusting method and device, vehicle and storage medium
CN112771495A (en) * 2018-11-16 2021-05-07 深圳市欢太科技有限公司 Audio mode adjusting method and device and electronic equipment
CN112804593A (en) * 2020-12-31 2021-05-14 上海擎朗智能科技有限公司 Method and device for controlling volume of application system, robot and storage medium
CN113170015A (en) * 2018-11-20 2021-07-23 深圳市欢太科技有限公司 Call processing method, computer-readable storage medium and electronic device

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109388367B (en) * 2018-09-04 2021-03-02 Oppo广东移动通信有限公司 Sound effect adjusting method and device, electronic equipment and storage medium
CN109271129B (en) * 2018-09-04 2020-11-27 Oppo广东移动通信有限公司 Sound effect adjusting method and device, electronic equipment and storage medium
CN109088997B (en) * 2018-10-26 2021-05-21 努比亚技术有限公司 Game audio control method, terminal and computer readable storage medium
CN109857530B (en) * 2019-01-21 2021-09-03 湖北亿咖通科技有限公司 Application request scheduling method and device
CN111741156A (en) * 2019-03-25 2020-10-02 奇酷互联网络科技(深圳)有限公司 Audio output method, mobile terminal and wearable device
CN114063963A (en) * 2020-07-30 2022-02-18 北京小米移动软件有限公司 Volume adjusting method, device and storage medium
CN112965685B (en) * 2021-02-04 2023-08-25 RealMe重庆移动通信有限公司 Audio control method, device, system, terminal equipment and storage medium
CN113407149A (en) * 2021-06-18 2021-09-17 维沃移动通信有限公司 Volume adjustment method and electronic equipment
CN113791843A (en) * 2021-09-10 2021-12-14 中国第一汽车股份有限公司 Execution method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101701829A (en) * 2009-10-28 2010-05-05 深圳市凯立德计算机系统技术有限公司 Navigation apparatus and voice broadcast method thereof
US20110026737A1 (en) * 2009-07-30 2011-02-03 Samsung Electronics Co., Ltd. Method and apparatus for controlling volume in an electronic machine
CN102117221A (en) * 2009-12-31 2011-07-06 上海博泰悦臻电子设备制造有限公司 Audio frequency application conflict management method and manager
CN103596641A (en) * 2012-10-18 2014-02-19 华为终端有限公司 Audio frequency managing method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101489070B (en) * 2009-02-17 2011-01-19 华为技术有限公司 Television volume regulating method, apparatus and system
CN102033776B (en) * 2009-09-29 2016-08-17 联想(北京)有限公司 A kind of audio frequency playing method and a kind of calculating equipment
CN102774321B (en) * 2012-08-15 2014-11-05 中标软件有限公司 Vehicle-mounted system and sound control method thereof
CN104023305B (en) * 2014-05-30 2015-10-28 爱培科科技开发(深圳)有限公司 A kind of mixing control method of Wince vehicle mounted multimedia and device
CN106303816B (en) * 2015-05-25 2019-12-24 联想(北京)有限公司 Information control method and electronic equipment
CN105632521B (en) * 2015-12-22 2018-03-20 深圳市智行畅联科技有限公司 A kind of random source of sound automatic sound control device based on automobile
CN105827825A (en) * 2016-02-29 2016-08-03 维沃移动通信有限公司 Audio data processing method and mobile terminal
CN106354471A (en) * 2016-09-29 2017-01-25 北京小米移动软件有限公司 Method and device for audio play control and electronic device
CN107273086A (en) * 2017-06-06 2017-10-20 深圳市沃特沃德股份有限公司 Audio-frequency processing method and device based on navigation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110026737A1 (en) * 2009-07-30 2011-02-03 Samsung Electronics Co., Ltd. Method and apparatus for controlling volume in an electronic machine
CN101701829A (en) * 2009-10-28 2010-05-05 深圳市凯立德计算机系统技术有限公司 Navigation apparatus and voice broadcast method thereof
CN102117221A (en) * 2009-12-31 2011-07-06 上海博泰悦臻电子设备制造有限公司 Audio frequency application conflict management method and manager
CN103596641A (en) * 2012-10-18 2014-02-19 华为终端有限公司 Audio frequency managing method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112771495A (en) * 2018-11-16 2021-05-07 深圳市欢太科技有限公司 Audio mode adjusting method and device and electronic equipment
CN113170015A (en) * 2018-11-20 2021-07-23 深圳市欢太科技有限公司 Call processing method, computer-readable storage medium and electronic device
CN113170015B (en) * 2018-11-20 2022-07-12 深圳市欢太科技有限公司 Call processing method, call processing device, computer-readable storage medium, and electronic apparatus
CN112437383A (en) * 2020-11-09 2021-03-02 中国第一汽车股份有限公司 Multi-sound-source adjusting method and device, vehicle and storage medium
CN112804593A (en) * 2020-12-31 2021-05-14 上海擎朗智能科技有限公司 Method and device for controlling volume of application system, robot and storage medium

Also Published As

Publication number Publication date
CN107870759A (en) 2018-04-03

Similar Documents

Publication Publication Date Title
WO2018054139A1 (en) Audio control method and device, and storage medium
US20190012134A1 (en) Audio playing method,apparatus, device and server
CN105630586B (en) Information processing method and electronic equipment
CN106302997B (en) Output control method, electronic equipment and system
CN106598539B (en) Method and device for processing audio in application program
US9042579B2 (en) Mitigating the effects of audio interruptions via adaptive automated fast audio playback
WO2017148270A1 (en) Volume control method and device, and terminal
WO2017092329A1 (en) Method and apparatus for playing streaming media
CN101355766A (en) Mobile terminal and control method for playing multimedia thereof
CN110321096A (en) A kind of MCVF multichannel voice frequency intelligent control method and relevant apparatus and equipment
CN105025344A (en) Inter-cut method and device
CN105791987B (en) media data playing method and terminal
CN108234768B (en) Resource switching control method and device and terminal equipment
CN112565876B (en) Screen projection method, device, equipment, system and storage medium
CN112533188B (en) Output processing method and device of play source
CN113934397A (en) Broadcast control method in electronic equipment and electronic equipment
CN108419133A (en) A kind of application switching controls the method and device of audio output in the process
US20230276001A1 (en) Systems and methods for improved audio/video conferences
CN103744505A (en) Information processing method and electronic device
WO2015074623A1 (en) Video playback method, apparatus and intelligent terminal
US20190213215A1 (en) Method and device for continuing a running playback of audio and/or video content from a first source after a temporary interruption or overlaying the running playback by a playback of audio and/or video content from a second source
CN113050911B (en) Audio playing method and audio playing device
CN111050240A (en) Earphone mode switching method and device
KR100644437B1 (en) Mobile terminal with music automatic stop function and method for music stop
CN108184193A (en) Control method for playing back, bluetooth equipment and the computer storage media of bluetooth playback terminal

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: 17852210

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17852210

Country of ref document: EP

Kind code of ref document: A1