CN113423007B - Control method and device for multi-audio playing, electronic equipment and storage medium - Google Patents
Control method and device for multi-audio playing, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113423007B CN113423007B CN202110671900.9A CN202110671900A CN113423007B CN 113423007 B CN113423007 B CN 113423007B CN 202110671900 A CN202110671900 A CN 202110671900A CN 113423007 B CN113423007 B CN 113423007B
- Authority
- CN
- China
- Prior art keywords
- audio
- application
- audio device
- calling
- call
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/439—Processing of audio elementary streams
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
- G06F9/4831—Task transfer initiation or dispatching by interrupt, e.g. masked with variable priority
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72442—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for playing music files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
Abstract
The embodiment of the application provides a control method for multi-audio playing, and relates to the technical field of multi-audio. The method comprises the following steps: receiving a call request of a first audio application to an audio device; acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state; and if the condition that at least one audio device is in the calling state is determined, determining target audio devices called by the first audio application from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application of the at least one audio device to the audio devices and the calling states of the audio devices. According to the embodiment of the application, on one hand, other audio equipment is prevented from being in a pause or unplayable state when the current audio equipment is played, on the other hand, the situation that the playing is not clear due to the fact that the same audio equipment plays the mixed sound of a plurality of audio applications is avoided, and the playing experience of a user is improved.
Description
Technical Field
The present application relates to the field of multi-audio playing technologies, and in particular, to a method and an apparatus for controlling multi-audio playing, an electronic device, and a storage medium.
Background
With the popularization of the internet and multimedia playing devices, the demands of users for audio playing are more and more diversified. For example, in some application scenarios, when a user plays a video using a mobile phone terminal, the user may want to perform operations of acquiring other audio, such as performing a voice call, listening to music, and the like, in which case there are multiple audio sources, including audio of a video application, audio of a voice call application, audio of a music application, and the like.
In the prior art, when a plurality of audio sources are received, two processing modes are generally available, one mode is that an audio device is scheduled to an audio application with the highest priority according to the priority of the audio application, the audio corresponding to the audio application with the highest priority is played, and other audio applications are in a pause or unavailable state; another way to do this is to play the mix, schedule the audio device to all audio applications, and play the mix for all audio applications simultaneously.
The two processing modes have corresponding disadvantages, the first mode can only play the audio frequency of one audio frequency application at the same time, and the requirement that a user can listen to a plurality of audio frequencies simultaneously cannot be met; the second type is to play the mixed sound of multiple audio applications, and the sound quality is mixed, and both of these two types can lead to poor user experience.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for controlling multi-audio playing, which overcome the above problems or at least partially solve the above problems.
In a first aspect, a method for controlling multi-audio playing is provided, where the method includes:
receiving a call request of a first audio application to an audio device;
acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state;
and if the condition that at least one audio device is in the calling state is determined, determining target audio devices called by the first audio application from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application of the at least one audio device to the audio devices and the calling states of the audio devices.
In one possible implementation, the call state further includes an idle state; determining target audio equipment called by a first audio application from the audio equipment according to priority information called by the first audio application to the audio equipment, priority information called by a second audio application calling at least one audio equipment to the audio equipment and calling states of the audio equipment, wherein the method comprises the following steps:
determining audio equipment with an idle calling state from the audio equipment as candidate audio equipment;
and determining the audio equipment with the highest priority from the candidate audio equipment as the target audio equipment.
In one possible implementation manner, determining a target audio device called by a first audio application from among audio devices according to priority information called by the first audio application to each audio device, priority information called by a second audio application calling at least one audio device to each audio device, and a calling state of each audio device includes:
and if the priority information of the call of the first audio application to the at least one audio device is higher than the priority information of the call of the second audio application to the at least one audio device, pausing the call of the second audio application to the at least one audio device and taking the at least one audio device as a target audio device.
In one possible implementation manner, determining a target audio device called by a first audio application from among audio devices according to priority information called by the first audio application to each audio device, priority information called by a second audio application calling at least one audio device to each audio device, and a calling state of each audio device includes:
if the priority information of the call of the first audio application to the at least one audio device is equal to the priority information of the call of the second audio application to the at least one audio device, determining the weight information of the first audio application and the second audio application, wherein the weight information is used for representing the importance degree of the audio application;
and if the weight of the first audio application is higher than that of the second audio application, pausing the calling of the at least one audio device by the second audio application and taking the at least one audio device as a target audio device.
In one possible implementation, determining the priority of the first audio application and the priority of the second audio application further includes:
if the weight of the first audio application is equal to the weight of the second audio application, displaying a prompt control, wherein the prompt control is used for a user to determine to call the audio application of at least one audio device;
responding to the triggering operation of the user on the prompt control, and taking at least one audio device as a target audio device if the audio application corresponding to the triggering operation is the first audio application.
In a second aspect, a control device for multi-audio playing is provided, which includes:
the receiving module is used for receiving a calling request of a first audio application to the audio equipment;
the calling state acquisition module is used for acquiring the calling states of the audio equipment, and the calling states at least comprise calling in-process states;
and the determining module is used for determining target audio equipment called by the first audio application from the audio equipment according to the priority information called by the first audio application to the audio equipment, the priority information called by the second audio application calling the at least one audio equipment to the audio equipment and the calling state of the audio equipment if the at least one audio equipment is determined to be in the calling state.
In one possible implementation manner, the determining module further includes:
the candidate audio equipment determining submodule is used for determining the audio equipment with the calling state being the idle state from all the audio equipment as the candidate audio equipment;
and the first target audio equipment determining submodule is used for determining the audio equipment with the highest priority from the candidate audio equipment as the target audio equipment.
In one possible implementation manner, the determining module further includes:
and the second target audio equipment determining submodule is used for pausing the call of the second audio application to the at least one audio equipment and taking the at least one audio equipment as the target audio equipment if the priority of the call of the first audio application to the at least one audio equipment is higher than the priority of the call of the second audio application to the at least one audio equipment.
In one possible implementation manner, the determining module further includes:
the weight information determining submodule is used for determining the weight information of the first audio application and the second audio application if the priority of the call of the first audio application to the at least one audio device is equal to the priority of the call of the second audio application to the at least one audio device, and the weight information is used for representing the importance degree of the audio application;
and the third target audio device determining submodule is used for pausing the calling of the second audio application to the at least one audio device and taking the at least one audio device as the target audio device if the weight of the first audio application is higher than that of the second audio application.
In one possible implementation, determining the first audio application and the second audio application weight information further includes:
the prompting control display sub-module is used for displaying a prompting control if the weight of the first audio application is equal to the weight of the second audio application, and the prompting control is used for a user to determine to call the audio application of at least one audio device;
and the fourth target audio equipment determining submodule responds to the triggering operation of the user on the prompt control, and if the audio application corresponding to the triggering operation is the first audio application, at least one piece of audio equipment is taken as the target audio equipment.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method provided in the first aspect.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the method as provided in the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program, where the computer program includes computer instructions stored in a computer-readable storage medium, and when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes the steps of implementing the method provided in the first aspect.
According to the control method and device for multi-audio playing, the electronic device and the storage medium provided by the embodiment of the invention, the call request of the first audio application to the audio device is received; acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state; if the condition that at least one audio device is in the calling state is determined, the target audio device called by the first audio application is determined from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application to the audio devices by calling the at least one audio device and the calling state of the audio devices.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic diagram illustrating a conventional multi-audio playing method in the prior art according to an embodiment of the present application;
fig. 2 is a schematic diagram of another conventional multi-audio playing method in the prior art according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a control method for playing multiple audios according to an embodiment of the present application;
fig. 4a is an audio mapping table corresponding to a first audio application audio-player according to an embodiment of the present application;
fig. 4b is an audio mapping table corresponding to a second audio application video-player according to an embodiment of the present application;
fig. 4c is an audio mapping table corresponding to a third audio application telephony provided in this embodiment of the present application
Fig. 5 is a schematic structural diagram of a multi-audio playing method according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a method for determining a target audio device according to an embodiment of the present application;
fig. 7 is a schematic flowchart illustrating a process of determining a target audio device called by a first audio application when priority information of calls made by audio applications to the audio devices is the same according to the embodiment of the present application;
fig. 8 is a schematic structural diagram of a control device for playing multiple audios according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The terms referred to in this application will first be introduced and explained:
a mobile device (or cell phone device), sometimes called a hand-held device (hand-held device), pocket computer (Pocket PC), etc., is a portable computing device with a small size, and usually has a small display screen for inputting through a small keyboard or a touch control manner. Typical Mobile devices include communication terminals, internet access terminals, music/video playing terminals, and the like, and may be, for example, PDAs (personal digital assistants), MIDs (Mobile Internet devices), and/or Mobile phones with music/video playing functions, and may also be smart televisions, set-top boxes, and the like. These devices have many features similar to personal computers, which can receive input, produce output, process data, and have some memory capacity, but the data processing and memory capacity is generally weaker than that of personal computers. The hardware of the mobile device, and the operating system, applications, etc. running on the mobile device are all different from those of a conventional personal computer.
Audio devices are mainly a general term for audio input and output devices, and include many types of devices, which can be generally classified into the following: power amplifier, audio amplifier, multimedia console, digital sound console, audio frequency sampling card, synthesizer, well high frequency audio amplifier, microphone, sound card, earphone etc. in the PC, other peripheral audio equipment: professional microphone series, earphones, a receiving and amplifying system and the like. For the mobile device of the present application, the audio device mainly includes: speakers, earphones, wired earphones, sound equipment and the like, and the specific type of the audio equipment and the number of each audio equipment are not limited in the embodiment of the application.
Audio applications refer to any application that supports playing audio (or audio data streams) and mainly includes: video applications, music applications, telephony applications, and other audio-related applications, and the like, embodiments of the present application are not limited to a particular audio application.
As shown in fig. 1, it exemplarily shows a structural diagram of a multi-audio playing method in the prior art, which includes an audio application 110, an audio processing module 120 and an audio device 130, wherein the audio application includes a video application 111, a music application 112 and a setting ringtone 113, the audio device includes a headphone 131, a play-out 132 and a headphone 133, and the purpose of the audio processing module 120 includes comparing the priority of the audio application sending an audio device call request and the priority of the audio application currently calling the audio device, and calling the audio device to the audio application with the high priority. Specifically, when any one of the audio devices in the earphone 131, the play 132, or the earphone 133 is called for the music application 112 currently, the audio data stream output by the video application 111 is a, the audio data stream output by the music application 112 is b, the audio data stream output by the ringtone 113 is set to c, and if the video application 111 and the ringtone setting application send a call request to the audio processing module 120 at the same time, the audio processing module 120 detects that the priorities of the 3 audio applications are in descending order: the video application 111> the music application 112> the ring tone 113 is set, at this time, the audio processing module 120 may suspend the call of the current music application to the audio device, and call the audio device 130 to the video application 110, at this time, the call states of the 3 audio devices are: the video application 111 calls the audio device 130 (any one of the earphone 131, the play 132 or the earphone 133), the audio device 130 plays the audio data stream a output by the video application 111, the music application 112 is in a pause state, and the ring tone 113 is set in a non-permitted-to-play state, that is, the multi-audio-frequency playing method selects the audio data stream of the audio application with high priority to be played, and the other audio devices are in a pause or non-usable state, so that the requirement of a user for listening to multiple audio frequencies at the same time cannot be met.
As shown in fig. 2, which schematically illustrates another existing multi-audio playing method structure of the prior art, the multi-audio playing method structure includes an audio application 210, an audio processing module 220 and an audio device 230, where the audio application includes a video application 211, a music application 212 and a setting ringtone 213, the audio device includes an earphone 231, a play-out 232 and an earphone 233, the purpose of the audio processing module 220 includes, when a call request for any audio reference is received, adding an audio data stream output by the audio application to original audio, so that the audio device plays a mixed sound of multiple audio applications, an audio data stream output by the video application 211 is a, an audio data stream output by the music application 212 is b, setting an audio data stream output by the ringtone 213 to be c, specifically, an audio data stream b output by the music application 212 played by the current audio device 230 (any one of the earphones 231, the external play 232, or the earphones 233) is sent by the video application 211 and the ringtone 213 to the audio processing module 220 at the same time, and the audio processing module 220 directly sends an audio data stream a output by the video application 211 and an audio output stream b output by the music application 212 to the audio device 230, that is, the audio device 230 plays a mixed sound a + b + c of the video application 211, the application 211, and the ringtone 213, and this playing mode plays a mixed sound of multiple audio applications, and the sound quality is not clear, which results in poor user experience.
The application provides a control method and device for multi-audio playing, an electronic device and a computer readable storage medium, which aim to solve the above technical problems in the prior art.
The following describes the technical solution of the present application and how to solve the above technical problems in detail by specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
An embodiment of the present application provides a method for controlling multiple audio playing, as shown in fig. 3, the method includes:
step S301, receiving a call request of a first audio application to an audio device.
The first audio application in the embodiment of the present application refers to any application that supports an output audio data stream, for example, a video application, a music application, a call application, a chat application, and other applications that support an output audio data stream, and the embodiment of the present application does not limit a specific first audio application.
The audio device in the embodiment of the present application refers to any device capable of playing audio, including but not limited to a wired headset, a wireless headset, a speaker, an earphone, and a sound box, and the embodiment of the present application does not limit the specific audio device.
The call request to the audio device in the embodiment of the application may be sent by the audio application, and when the user triggers the audio application or triggers a specific matter or content in the audio application, the audio application may send the call request to the audio device.
Step S302, obtaining the calling state of each audio device, wherein the calling state at least comprises a calling state.
The calling state of the audio equipment reflects whether the audio equipment is called by a certain audio application or not, if the audio equipment is called, the audio equipment is in a calling state, and if the audio equipment is not called, the audio equipment is in an idle state. Specifically, for example, if the mobile phone terminal is playing a song using the headset, the audio device headset is in the calling state.
After receiving a call request of a first audio application to audio equipment, the embodiment of the application can acquire the call state of each audio equipment, and determine the audio equipment which can be called by the first audio application from each audio equipment.
Step S303, if it is determined that at least one audio device is in the calling state, determining a target audio device called by the first audio application from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application calling the at least one audio device to the audio devices, and the calling states of the audio devices.
The embodiment of the application may occur in some application scenarios, for example, when a user plays a video using a mobile phone terminal, the user may want to acquire other audio, such as performing a voice call, listening to music, and the like, in which case there are multiple audio sources, including audio of a video application, audio of a voice call application, audio of a music application, and the like, and the video application plays the audio using an audio device, and in this case, the audio device is in a calling state when playing the audio externally.
The second audio application in the embodiment of the present application refers to an application that currently calls an audio device. Continuing the above example, the video application currently calls for audio device play-out, and the video application belongs to the second audio application.
In the embodiment of the application, the priorities of different audio applications for calling the audio devices are not necessarily the same, the priorities of different audio devices under different audio applications are not necessarily the same, and the audio devices that can be called by different audio applications are not necessarily the same. Specifically, for example, existing audio applications are a video application, a music application, and a call application, and the priority of an audio device that can be called by the video application is: play out > headphone, the priority of the audio device that the music application can invoke is from high to low: headphone > out-play, the priority of the audio device that the telephony application can invoke is from high to low: headphone > play out, in this case neither the video application nor the music application can call the audio device headphone, and the priority of each audio application to the audio device play out call is also different.
In addition, it should be emphasized that, the priority of the call of the audio device in each audio application in the embodiment of the present application may be configured by the user according to the actual situation or preference of the user, for example, some users often use the headphones to listen to songs, may set the headphones to be the audio device with the highest priority in the music application, some users prefer to use the music to watch videos, and may set the music to be the audio device with the highest priority in the video application.
In some cases, if a user of the mobile device does require an audio application to invoke an audio device in an invoking state, the audio application that is invoking the audio device may be forced to suspend the invocation of the audio device, and the audio device may be temporarily invoked to an audio application that the user deems it is actually necessary to invoke the audio device, and the whole process may be interpreted as preemption, i.e., an audio application preempts an audio device that is being invoked by other audio applications. It is noted that in the context of the embodiments of the present application, preemption is temporary rather than permanent. After the preemption instruction is issued, the preemption instruction is the highest priority, if the user issues the preemption instruction, the preemption instruction is immediately responded, and the priority order of the audio application is not considered in the process of responding the preemption instruction.
In the embodiment of the present application, a mapping relationship between audio applications and audio equipment may be stored by establishing an audio mapping table, where the audio mapping table further includes priority information of each audio application calling the audio equipment, fig. 4a shows an audio mapping table corresponding to an audio application, and the priority of the audio equipment that can be called by the audio application is from high to low: header > marker, fig. 4b shows an audio mapping table corresponding to a second audio application, video-player's audio device with a high priority and a low priority, fig. 4c shows an audio mapping table corresponding to a third audio application, telephony's audio device with a high priority and a low priority: head set > earface > hand free. The headset generally refers to an earphone, the speaker generally refers to a speaker, the earpiece generally refers to a receiver, and the handfree generally refers to a loudspeaker (hands-free). The priority information that each audio application calls each audio device may also be obtained in other manners in the embodiment of the present application, which is not limited in this embodiment of the present application.
The target audio device in the embodiment of the present application refers to an audio device to be called to a first audio application, and if it is determined that at least one audio device is in a calling state, the target audio device called by the first audio application is determined based on priority information of calling of the first audio application to each audio device, priority information of calling of a second audio application of the at least one audio device to each audio device, and a calling state of each audio device.
Continuing the example, the audio device being called by the audio application video-player is a header set, if the first audio application video-player sends a call request to the audio device at the moment, and accesses the audio mapping table corresponding to the video-player after receiving the audio call request sent by the video-player, and finds that the audio device spaker is the audio device with the highest priority in the audio mapping table of the video-player and is not called by other audio, the audio device spaker can be directly called to the audio application video-player; if the audio application telephony also sends a call request for the audio equipment, an audio mapping table corresponding to the telephony is accessed after the audio call request sent by the audio application telephony is received, it is found that the audio equipment headset is already occupied by the audio application audio-layer, at this time, a user can select whether to preempt the audio equipment headset, if the audio equipment headset is preempted, the call of the audio application audio-layer to the audio equipment headset is suspended, the audio equipment headset is called to the audio application telephony, if the user selects not to preempt the audio equipment headset, the audio application telephony accesses the audio equipment headset with the next priority information, and if the audio equipment headset is found to be in an idle state, the audio equipment headset is directly called to the audio application telephony.
Specifically, as shown in fig. 5, a structural diagram of a control method for multi-audio playing is exemplarily shown, which includes an audio application 510, an audio processing module 520, and an audio device 530, where the audio application includes a video application 511, a music application 512, and a setting ring tone 513, the audio device includes an earphone 531, a play-out 532, and a headphone 533, and the purpose of the audio processing module 520 includes obtaining a call state of each audio device when a call request of any audio reference is received, and if it is determined that at least one audio device is in a call state, determining a target audio device called by a first audio application from each audio device according to priority information called by the first audio application to each audio device, priority information called by a second audio application calling at least one audio device to each audio device, and the call state of each audio device. Specifically, the audio data stream output by the video application 511 is a, the audio data stream output by the music application 512 is b, the audio data stream output by the ringtone 513 is set to c, and if the priority of the audio device that can be called by the video application 511 is from high to low: out 532> headphones 531> headphones 533, the priority of the audio devices that the music application 512 can invoke is from high to low: the earphone 531 is used for playing music for the music application 512, when an audio calling request sent by the video application 511 and the setting ringtone 513 is received, the audio device called by each audio application can be judged according to calling priority information of the audio application to the audio device, the calling state of each audio device and the like, the specific steps are not described herein again, and finally, the earphone 531 plays an audio data stream b output by the music application 512, the external placed 532 plays an audio data stream a output by the video application 511, and the earphone 533 plays an audio data stream c of the setting ringtone 513.
In a specific scene, a user A watches a video, a mobile phone is used to play audio in a video application, a user B wants to listen to music and set a ring tone, finally, an earphone is called to the video application according to priority information called by each audio application to the audio equipment and calling states of each audio equipment, an outer player is dispatched to the music application, and the receiver is dispatched to the set ring tone.
In addition, it is emphasized that the embodiment of the present application may call the audio device to the audio application one to one according to the actual situation, for example, dispatch the earphone to the video application, and dispatch the earphone to the voice call application; the same audio application may also schedule two or more audio devices simultaneously, such as when a voice call is being made, the earpiece and the loud speaker are scheduled to the voice call application simultaneously.
The method comprises the steps of receiving a call request of a first audio application to audio equipment; acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state; if the condition that at least one audio device is in the calling state is determined, the target audio device called by the first audio application is determined from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application to the audio devices by calling the at least one audio device and the calling state of the audio devices.
A possible implementation manner is provided in the embodiment of the present application, as shown in fig. 6, which exemplarily shows a schematic flowchart of a method for determining a target audio device, where a call state further includes an idle state; determining target audio equipment called by a first audio application from the audio equipment according to priority information called by the first audio application to the audio equipment, priority information called by a second audio application calling at least one audio equipment to the audio equipment and calling states of the audio equipment, wherein the method comprises the following steps:
step S601, determining audio equipment with an idle calling state from the audio equipment as candidate audio equipment;
the call states of the embodiments of the present application further include an idle state, and if the current audio device is not called by the audio application, the audio device is in the idle state.
According to the embodiment of the application, on the premise that the audio equipment which is already in the calling state is not preempted, the audio equipment in the idle state can be directly used as the candidate audio equipment.
Specifically, for example, the existing audio application is a video application and a call application, the video application calls a play currently, the audio device in an idle state includes an earphone, a headphone, and a sound, when the call application sends an audio call request, the audio device that can be called by the read call application includes an earphone and a headphone, and the sound cannot be called, and then, for the call application, the earphone and the headphone can be directly determined as candidate audio devices.
Step S602, the audio device with the highest priority is determined from the candidate audio devices as the target audio device.
After determining each candidate audio device, according to the priority information of the candidate audio devices, determining the audio device with the highest priority as the target audio device.
Continuing the above example, for the call application, the candidate audio devices at this time include an earphone and a receiver, and if the priority of the earphone is higher than that of the receiver, the receiver is directly determined as the target audio device.
The embodiment of the present application provides a possible implementation manner, where according to priority information that a first audio application calls each audio device, priority information that a second audio application that calls at least one audio device calls each audio device, and a call state of each audio device, a target audio device that is called by the first audio application is determined from each audio device, including:
and if the priority of the call of the first audio application to the at least one audio device is higher than the priority of the call of the second audio application to the at least one audio device, pausing the call of the second audio application to the at least one audio device and taking the at least one audio device as a target audio device.
In the embodiment of the present application, the same audio device may have different priorities in different audio applications, and when a user does not issue a preemption instruction, if at least one audio device is occupied by a second audio application, priority information called by the first audio application to the audio device and priority information called by the second audio application to the audio device need to be compared, and if the priority called by the first audio application to the at least one audio device is higher than the priority called by the second audio application to the at least one audio device, the call of the second audio application to the at least one audio device is suspended, and the at least one audio device is taken as a target audio device.
Specifically, the priority of the invocation of the audio device by the chat application is from high to low as: earphone, loudspeaker and sound, wherein the priority of calling the audio equipment by the video application is from high to low: and if the video application is using the audio in the play-out video at the current moment, the audio processing module receives a call request for the audio equipment sent by the chat application, finds that the priority of the video application of the second audio application of the earphone is lower than the priority of the chat application of the first audio application of the earphone, and the user does not instruct the video application to seize the earphone, and suspends the call of the video application to the earphone at the moment and calls the earphone to the chat application.
If the priority of the call of the first audio application to the at least one audio device is equal to the priority of the call of the second audio application to the at least one audio device, the target audio device called by the first audio application is determined according to the weight information of the audio application, and the following steps are detailed.
And if the priority of the call of the first audio application to the at least one audio device is lower than the priority of the call of the second audio application to the at least one audio device, the call of the first audio application to the audio device fails.
An embodiment of the present application provides a possible implementation manner, as shown in fig. 7, which exemplarily shows a schematic flow diagram for determining a target audio device called by a first audio application when priority information called by audio applications to audio devices is the same, and determines the target audio device called by the first audio application from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by a second audio application calling at least one audio device to the audio devices, and a calling state of each audio device, where the method includes:
step S701, if the priority of the call of the first audio application to the at least one audio device is equal to the priority of the call of the second audio application to the at least one audio device, determining weight information of the first audio application and the second audio application, where the weight information is used to indicate an importance degree of the audio application.
In the embodiment of the present application, the weight information of the audio application is used to identify the importance degree of the audio application, the weight information of the audio application may be set by default in the mobile device, or may be set manually by a user according to an actual situation, for example, the probability that some users listen to music is higher than that of watching videos, and then the weight information of the music application may be set to be higher than that of the video application, for example, the duration that some users use a call application is longer than that of the music application, and the duration that music application is used is longer than that of using the video application, and then the importance degree of each application may be set from high to low: conversation application > music application > video application.
In the embodiment of the application, if the priority of the call of the first audio application to the at least one audio device is equal to the priority of the call of the second audio application to the at least one audio device, that is, the priority of the audio device in the first audio application is the same as the priority of the audio device in the second audio application, the target audio device called by the first audio application may be determined according to the weight information of the audio application.
Step S702, if the weight of the first audio application is higher than the weight of the second audio application, suspend the call of the second audio application to the at least one audio device, and take the at least one audio device as the target audio device.
According to the embodiment of the application, under the condition that the priority of calling the at least one audio device by the first audio application is equal to the priority of calling the at least one audio device by the second audio application, the weights of the audio applications are compared, if the weight of the first audio application is higher than that of the second audio application, the calling of the at least one audio application by the second audio application is paused, and the at least one audio device is taken as the target audio device.
Specifically, it is assumed that priority information of calling of a video application to an audio device is play-out > earphones, priority information of calling of a music application to the audio device is play-out > earphones, the music application plays music using the play-out at the current moment, after receiving a call request sent by the video application to the audio device, the priority of calling of the video application to the play-out and the priority of calling of the music application to the play-out are found to be the same, in this case, weights of the video application and the music application need to be considered, if the weight of the video application is greater than the weight of the music application, calling of the music application to the play-out is suspended, and the play-out is called to the video application, at this time, when other audio devices are available, the music application can call other audio devices, and if no other audio devices are available, the music application can be in a suspended state.
The embodiment of the present application provides a possible implementation manner, determining weight information of a first audio application and a second audio application, and then further including:
step S702', if the weight of the first audio application is equal to the weight of the second audio application, a prompt control is displayed, and the prompt control is used for a user to determine to invoke the audio application of the at least one audio device.
According to the method and the device for prompting the audio application, under the condition that the priority of calling the at least one audio device by the first audio application is equal to the priority of calling the at least one audio device by the second audio application, the weight of the audio application is compared, if the weight of the first audio application is equal to the weight of the second audio application, a prompting control is displayed, the prompting control can be any control which plays a prompting selection role, for example, a selection dialog box or a selection button, and the prompting control is used for a user to determine to call the audio application of the at least one audio device.
Step S703', responding to a trigger operation of the user on the prompt control, and if the audio application corresponding to the trigger operation is the first audio application, taking at least one audio device as a target audio device.
After the prompt control is displayed, a user can trigger the prompt control, the user can determine to which audio application the audio equipment is called by himself, and if the audio application to which the user triggers the operation is the first audio application, the audio equipment is called to the first audio application as target audio equipment.
An embodiment of the present application provides a control apparatus 800 for multiple audio playing, as shown in fig. 8, the apparatus may include:
a receiving module 810, configured to receive a call request of a first audio application to an audio device;
a calling state obtaining module 820 for obtaining calling states of the audio devices, wherein the calling states at least include a calling state;
the determining module 830 determines, if it is determined that at least one audio device is in the calling state, a target audio device called by a first audio application from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by a second audio application calling the at least one audio device to the audio devices, and the calling states of the audio devices.
The embodiment of the application provides a possible implementation manner, and the determining module further includes:
the candidate audio equipment determining submodule is used for determining the audio equipment with the calling state being the idle state from all the audio equipment as the candidate audio equipment;
and the first target audio equipment determining submodule is used for determining the audio equipment with the highest priority from the candidate audio equipment as the target audio equipment.
The embodiment of the application provides a possible implementation manner, and the determining module further includes:
and the second target audio equipment determination submodule is used for pausing the call of the second audio application to the at least one audio equipment and taking the at least one audio equipment as the target audio equipment if the priority of the call of the first audio application to the at least one audio equipment is higher than the priority of the call of the second audio application to the at least one audio equipment.
The embodiment of the present application provides a possible implementation manner, and the determining module further includes:
the weight information determining submodule is used for determining the weight information of the first audio application and the second audio application if the priority of the call of the first audio application to the at least one audio device is equal to the priority of the call of the second audio application to the at least one audio device, and the weight information is used for representing the importance degree of the audio application;
the embodiment of the present application provides a possible implementation manner, which is configured to suspend, if the weight of the first audio application is higher than the weight of the second audio application, the call of the second audio application to the at least one audio device, and use the at least one audio device as a target audio device.
The embodiment of the present application provides a possible implementation manner, determining weight information of a first audio application and a second audio application, and then further including:
the prompt control display sub-module is used for displaying a prompt control if the weight of the first audio application is equal to the weight of the second audio application, and the prompt control is used for a user to determine to call the audio application of at least one piece of audio equipment;
and the fourth target audio equipment determining sub-module responds to the triggering operation of the user on the prompt control, and takes at least one piece of audio equipment as the target audio equipment if the audio application corresponding to the triggering operation is the first audio application.
The control device for multiple audio playing provided in the embodiment of the present invention specifically executes the process of the foregoing method embodiment, and please refer to the contents of the foregoing control method for multiple audio playing in detail, which is not described herein again. The control device for playing the multi-audio frequency provided by the embodiment of the invention receives a call request of a first audio frequency application to the audio frequency equipment; acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state; if the condition that at least one audio device is in the calling state is determined, the target audio device called by the first audio application is determined from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application calling the at least one audio device to the audio devices and the calling state of the audio devices.
An embodiment of the present application provides an electronic device, including: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: receiving a call request of a first audio application to an audio device; acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state; if the condition that at least one audio device is in the calling state is determined, the target audio device called by the first audio application is determined from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application to the audio devices by calling the at least one audio device and the calling state of the audio devices.
In an alternative embodiment, an electronic device is provided, as shown in fig. 9, an electronic device 4000 shown in fig. 9 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004. It should be noted that the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (field programmable Gate Array), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 4003 is used for storing application codes for implementing the present scheme, and execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in the foregoing method embodiments.
The embodiment of the present application provides a computer readable storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer is enabled to execute the corresponding content in the foregoing method embodiment. Compared with the prior art, the method comprises the steps of receiving a call request of a first audio application to the audio equipment; acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state; if the condition that at least one audio device is in the calling state is determined, the target audio device called by the first audio application is determined from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application calling the at least one audio device to the audio devices and the calling state of the audio devices.
The embodiment of the present application provides a computer program, which includes computer instructions stored in a computer-readable storage medium, and when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes the contents as shown in the foregoing method embodiment. Compared with the prior art, the method comprises the steps of receiving a call request of a first audio application to the audio equipment; acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state; if the condition that at least one audio device is in the calling state is determined, the target audio device called by the first audio application is determined from the audio devices according to the priority information called by the first audio application to the audio devices, the priority information called by the second audio application calling the at least one audio device to the audio devices and the calling state of the audio devices.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless otherwise indicated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (7)
1. A method for controlling multi-audio playing, comprising:
receiving a call request of a first audio application to an audio device;
acquiring the calling state of each audio device, wherein the calling state at least comprises a calling state;
if it is determined that at least one audio device is in the calling state, determining a target audio device called by the first audio application from the audio devices according to the priority information called by the first audio application to the corresponding called audio device, the priority information called by a second audio application calling the at least one audio device to the corresponding called audio device and the calling states of the audio devices;
the determining, from the audio devices, a target audio device called by the first audio application includes:
and if the priority of the call of the first audio application to the at least one audio device is higher than the priority of the call of the second audio application to the at least one audio device, pausing the call of the second audio application to the at least one audio device, taking the at least one audio device as a target audio device called by the first audio application, and determining a new audio device for the second audio application from other audio devices except the target audio device in the callable audio devices corresponding to the second audio application.
2. The method of claim 1, wherein the call state further comprises an idle state; the determining, according to the priority information that the first audio application calls the corresponding callable audio device, the priority information that the second audio application that calls the at least one audio device calls the corresponding callable audio device, and the call status of each audio device, a target audio device called by the first audio application from the audio devices includes:
determining the audio equipment with the calling state being the idle state from the audio equipment to be used as candidate audio equipment;
and determining the audio equipment with the highest priority from the candidate audio equipment as the target audio equipment.
3. The method for controlling multi-audio playing according to claim 1, wherein the determining the target audio device called by the first audio application from the audio devices according to the priority information called by the first audio application to the corresponding callable audio devices, the priority information called by the second audio application calling the at least one audio device to the corresponding callable audio devices, and the calling status of the audio devices comprises:
if the priority of the call of the first audio application to the at least one audio device is equal to the priority of the call of the second audio application to the at least one audio device, determining the weight information of the first audio application and the second audio application, wherein the weight information is used for representing the importance degree of the audio application;
and if the weight of the first audio application is higher than that of the second audio application, pausing the call of the second audio application to the at least one audio device and taking the at least one audio device as a target audio device.
4. The method of claim 3, wherein the determining the first audio application and the second audio application weighting information further comprises:
if the weight of the first audio application is equal to the weight of the second audio application, displaying a prompt control, wherein the prompt control is used for a user to determine to call the audio application of the at least one audio device;
responding to a trigger operation of a user on the prompt control, and if the audio application corresponding to the trigger operation is the first audio application, taking the at least one audio device as a target audio device.
5. A control apparatus for playing multiple audios, comprising:
the receiving module is used for receiving a calling request of a first audio application to the audio equipment;
the calling state acquisition module is used for acquiring calling states of all the audio equipment, and the calling states at least comprise calling in-progress states;
a determining module, configured to determine, if it is determined that at least one audio device is in a calling state, a target audio device called by a first audio application from among the audio devices according to priority information that the first audio application calls the corresponding callable audio device, priority information that a second audio application calling the at least one audio device calls the corresponding callable audio device, and a calling state of each audio device;
the determining module is specifically configured to suspend the call of the second audio application to the at least one audio device if the priority of the call of the first audio application to the at least one audio device is higher than the priority of the call of the second audio application to the at least one audio device, regard the at least one audio device as a target audio device called by the first audio application, and determine a new audio device for the second audio application from other audio devices except the target audio device in the callable audio devices corresponding to the second audio application.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method for controlling the playing of multiple audios according to one of claims 1 to 4 are implemented when the program is executed by the processor.
7. A computer-readable storage medium, characterized in that it stores computer instructions that cause the computer to execute the steps of the method of controlling the playing of multiple audios according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110671900.9A CN113423007B (en) | 2021-06-17 | 2021-06-17 | Control method and device for multi-audio playing, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110671900.9A CN113423007B (en) | 2021-06-17 | 2021-06-17 | Control method and device for multi-audio playing, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113423007A CN113423007A (en) | 2021-09-21 |
CN113423007B true CN113423007B (en) | 2023-03-14 |
Family
ID=77788844
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110671900.9A Active CN113423007B (en) | 2021-06-17 | 2021-06-17 | Control method and device for multi-audio playing, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113423007B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113934397A (en) * | 2021-10-15 | 2022-01-14 | 深圳市一诺成电子有限公司 | Broadcast control method in electronic equipment and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108063874A (en) * | 2017-12-26 | 2018-05-22 | 上海展扬通信技术有限公司 | A kind of information processing method, device, terminal and computer readable storage medium |
CN108769431A (en) * | 2018-07-03 | 2018-11-06 | Oppo(重庆)智能科技有限公司 | Audio play control method, device, storage medium and mobile terminal |
CN109271128A (en) * | 2018-09-04 | 2019-01-25 | Oppo广东移动通信有限公司 | Audio setting method, device, electronic equipment and storage medium |
CN110764730A (en) * | 2018-07-25 | 2020-02-07 | 杭州海康威视数字技术股份有限公司 | Method and device for playing audio data |
CN111694536A (en) * | 2020-05-27 | 2020-09-22 | 维沃移动通信有限公司 | Audio control method, electronic device and computer-readable storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8171177B2 (en) * | 2007-06-28 | 2012-05-01 | Apple Inc. | Enhancements to data-driven media management within an electronic device |
CN109302525B (en) * | 2017-07-25 | 2021-06-15 | 西安中兴新软件有限责任公司 | Method for playing sound and multi-screen terminal |
-
2021
- 2021-06-17 CN CN202110671900.9A patent/CN113423007B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108063874A (en) * | 2017-12-26 | 2018-05-22 | 上海展扬通信技术有限公司 | A kind of information processing method, device, terminal and computer readable storage medium |
CN108769431A (en) * | 2018-07-03 | 2018-11-06 | Oppo(重庆)智能科技有限公司 | Audio play control method, device, storage medium and mobile terminal |
CN110764730A (en) * | 2018-07-25 | 2020-02-07 | 杭州海康威视数字技术股份有限公司 | Method and device for playing audio data |
CN109271128A (en) * | 2018-09-04 | 2019-01-25 | Oppo广东移动通信有限公司 | Audio setting method, device, electronic equipment and storage medium |
CN111694536A (en) * | 2020-05-27 | 2020-09-22 | 维沃移动通信有限公司 | Audio control method, electronic device and computer-readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113423007A (en) | 2021-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7853649B2 (en) | Audio processing for improved user experience | |
US8588849B2 (en) | System and method for resuming media | |
US10051368B2 (en) | Mobile apparatus and control method thereof | |
CN105630586B (en) | Information processing method and electronic equipment | |
CN107749299B (en) | Multi-audio output method and device | |
US20170195817A1 (en) | Simultaneous Binaural Presentation of Multiple Audio Streams | |
JP2012105312A (en) | System and method for selecting a part of media | |
JP2022546542A (en) | Communication method, communication device, communication system, server and computer program | |
CN111124351A (en) | Audio output method, audio output device, electronic equipment and storage medium | |
CN112286481A (en) | Audio output method and electronic equipment | |
CN113423007B (en) | Control method and device for multi-audio playing, electronic equipment and storage medium | |
CN114040373A (en) | Audio service processing method and device, electronic equipment and storage medium | |
CN111277697B (en) | Audio processing method and device, storage medium and electronic equipment | |
CN116471355B (en) | Audio playing method and electronic equipment | |
CN112702468A (en) | Call control method and device | |
EP1783600B1 (en) | Method for arbitrating audio data output apparatuses | |
WO2018035868A1 (en) | Method for outputting audio, electronic device, and storage medium | |
CN116684856A (en) | Bluetooth connection method and device | |
CN109155803B (en) | Audio data processing method, terminal device and storage medium | |
CN111556406B (en) | Audio processing method, audio processing device and earphone | |
CN113760219A (en) | Information processing method and device | |
US20090240842A1 (en) | Portable electronic apparatus | |
CN107391733B (en) | Music file fast grouping method, music file fast grouping device and terminal | |
WO2019011270A1 (en) | Method and terminal for playing audio, and computer-readable storage medium | |
TWI288879B (en) | An audio signal output devices and a method for arbitrating thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |