CN113039517A - Audio resource calling method and device and electronic equipment - Google Patents

Audio resource calling method and device and electronic equipment Download PDF

Info

Publication number
CN113039517A
CN113039517A CN201880098446.9A CN201880098446A CN113039517A CN 113039517 A CN113039517 A CN 113039517A CN 201880098446 A CN201880098446 A CN 201880098446A CN 113039517 A CN113039517 A CN 113039517A
Authority
CN
China
Prior art keywords
audio resource
audio
application program
resource
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201880098446.9A
Other languages
Chinese (zh)
Other versions
CN113039517B (en
Inventor
李亚军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN113039517A publication Critical patent/CN113039517A/en
Application granted granted Critical
Publication of CN113039517B publication Critical patent/CN113039517B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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)
  • Telephone Function (AREA)

Abstract

The invention relates to a method for calling audio resources, which comprises the following steps: receiving an audio resource calling request of an application program; monitoring the state of the audio resource, and inquiring corresponding occupier information of the audio resource if the state of the audio resource is an occupied state; and if the information of the occupier is empty, releasing the audio resource so that the application program calls the released audio resource. Correspondingly, the invention provides the device for calling the audio resources and the electronic equipment, so that the stability of the system is improved, and the user experience is improved.

Description

Audio resource calling method and device and electronic equipment Technical Field
The present invention relates to the field of information technologies, and in particular, to a method and an apparatus for calling an audio resource, and an electronic device.
Background
In the current mobile terminal, the audio resource can be called by different application programs, for example, the audio resource of the mobile terminal can be called by music application software to realize the playing of music, the playing of ring tone can be realized by call software, and the calling of resources such as a microphone can also be realized by recording software.
However, due to the uniqueness and uniqueness of the audio resources, the audio resources are usually occupied by only one application program during the usage process, and thus cannot be shared. Taking recording as an example, when one recording program is using the recording resource, another recording program cannot use the recording resource at the same time.
In the prior art, when one party needs to use an audio resource, the party needs to wait until the using party uses the audio resource and releases the audio resource completely, and if the current using party uses the audio resource indefinitely or occupies the audio resource abnormally and is not released correspondingly, any new application program cannot call the audio resource, so that abnormal use is caused, the system stability is poor, and the user experience is poor.
Disclosure of Invention
The embodiment of the application provides a method for calling audio resources, which comprises the following steps:
receiving an audio resource calling request of an application program;
monitoring the state of the audio resource, and inquiring corresponding occupier information of the audio resource if the state of the audio resource is an occupied state;
and if the information of the occupier is empty, releasing the audio resource so that the application program calls the released audio resource.
The embodiment of the present application further provides a method for calling audio resources, including:
distributing corresponding audio resources for the application program;
monitoring the state of the audio resource when the audio resource is called by the application program;
and if the audio resource state is abnormal, releasing the audio resource so that the application program calls the released audio resource.
The embodiment of the present application further provides an apparatus for calling an audio resource, where the apparatus includes:
the receiving module is used for receiving an audio resource calling request of an application program;
the monitoring module is used for monitoring the state of the audio resource, and inquiring the information of an occupier corresponding to the audio resource if the state of the audio resource is an occupied state;
and the release module is used for releasing the audio resource if the information of the occupied party is empty so as to enable the application program to call the audio resource.
The embodiment of the present application further provides an apparatus for calling an audio resource, where the apparatus includes:
the distribution module is used for distributing corresponding audio resources for the application program;
the monitoring module is used for monitoring the state of the audio resource when the audio resource is called by the application program;
and the release module is used for releasing the audio resources when the state of the audio resources is abnormal so as to enable the application program to call the released audio resources.
An embodiment of the present application further provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is enabled to execute:
receiving an audio resource calling request of an application program;
monitoring the state of the audio resource, and inquiring corresponding occupier information of the audio resource if the state of the audio resource is an occupied state;
and if the information of the occupier is empty, releasing the audio resource so that the application program calls the released audio resource.
An embodiment of the present application further provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is enabled to execute:
distributing corresponding audio resources for the application program;
monitoring the state of the audio resource when the audio resource is called by the application program;
and if the audio resource state is abnormal, releasing the audio resource so that the application program calls the released audio resource.
Embodiments of the present application further provide a computer non-transitory readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of audio resource calling as described above.
When the electronic equipment and the computer readable storage medium realize the method, the audio resource occupying party is monitored, if the occupying party information is empty, the audio resource is immediately released, and further calling is carried out for the application program needing to call the audio resource. The stability of the system is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings of the embodiments can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of an audio resource invocation method according to an embodiment;
FIG. 2 is a flowchart of an audio resource calling method according to another embodiment;
FIG. 3 is a block diagram of an audio resource invocation device according to an embodiment;
FIG. 4 is a schematic diagram of an audio resource invoking device according to another embodiment;
FIG. 5 is a schematic diagram of an internal structure of an electronic device according to an embodiment;
fig. 6 is a block diagram of a partial structure of an electronic device related to a computer device provided in an embodiment of the present invention.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
As shown in fig. 1, an embodiment of the present application provides a method for calling an audio resource, where the method includes:
s110, receiving an audio resource calling request of an application program;
in the embodiment of the present application, the audio resource may be a resource required for playing audio, such as a speaker, a sound channel, an audio file, or a resource required for recording, such as a microphone, an audio circuit, a recorded data storage, an audio recording processor, and the like, which is not limited in the embodiment of the present application. The audio resource calling of the application program can be realized through the electronic equipment, the audio resource calling can be carried out through a processing function built in the electronic equipment, for example, the electronic equipment provided with the android system is provided, different types of functions are defined in the android system to realize the audio resource calling in different modes, and the audio resource calling comprises audio input and output operations, such as music playing, conversation, voice prompt, recording and the like, so that the audio resource calling can be realized only by using the corresponding audio calling function.
In the embodiment of the application, one or more application programs need to send a call request before using an audio resource, the electronic device performs permission confirmation after receiving the call request of the application program, if the application program has permission to call the audio resource, the call is allowed, otherwise, the call fails. In the prior art, when it is determined that an audio resource can be called, if the audio resource is not occupied, the audio resource is directly called, and if the audio resource is occupied, the audio resource is automatically waited until a previous application program (i.e., an occupied party of the audio resource) releases the audio resource.
S120, monitoring the state of the audio resource, and inquiring corresponding occupier information of the audio resource if the state of the audio resource is an occupied state;
in the embodiment of the present application, a completely new monitoring mechanism is creatively proposed, that is: and creating a system level monitoring module on a system framework layer, monitoring the audio resource state through the monitoring module, or independently creating a monitoring process, and monitoring the audio resource state of the application program through a message transmission mechanism. Specifically, the electronic device may monitor an audio resource call of an application through a built-in monitoring function, and taking the electronic device of the android system as an example, a system-level monitoring module may be created in a system framework layer (native/frame layer), and the audio mode of the application is monitored through the monitoring module, or a monitoring process is independently created, and the audio mode of the application is monitored through a message transmission mechanism. For example, a monitoring module can be set up in the framework layer and run in a system service program (system _ server), and because the monitoring module is set up in the service framework layer of the system level, interaction with other system services can be facilitated without worrying about the authority problem when the system is called. In addition, an independent monitoring process can be created, an independent monitoring function is set and called in the process, the process can be set to be started up and started automatically, the audio resource calling of any other application program is monitored in real time, specifically, the ID information, the state information and/or the priority information and the like of the application program corresponding to the currently called audio resource can be captured in real time, the application program corresponding to the current calling behavior and the state of the application program can be determined accordingly, the independent monitoring process can be developed independently, the independent monitoring process is not coupled with a system, and the subsequent development and the subsequent upgrading are facilitated. Furthermore, whether the state of the application program calling the audio resource is normal or not can be monitored, if the state is abnormal or the ID information is null, the application program is determined to occupy the audio resource abnormally, and the audio resource occupied abnormally needs to be processed.
S130, if the information of the occupied party is empty, releasing the audio resource so that the application program calls the released audio resource.
The method comprises the steps that an occupier is one or more application programs which currently occupy audio resources, occupier information is state information or ID information of the current occupier, if the occupier information is empty, namely the current occupier is represented to be abnormal in state, the occupier information is output to be empty (Null or Error) or the occupier information is not monitored, the occupier information is output to be empty (Null), at the moment, the occupier is determined to be abnormal, namely the occupier occupies the audio resources abnormally, therefore, the audio resources need to be released, and the application programs call the released audio resources. Wherein the audio resource may be released by a restart (Reset) operation, e.g. restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting the audio system to release the audio resource. And if the information of the occupier is not empty, determining that the occupier normally occupies the audio resource, sending an audio resource calling failure response message to the application program sending the request, prohibiting the application program from calling the audio resource until the audio resource is normally released, optionally, generating a conflict prompt message and displaying the conflict prompt message for a user to check, and forcibly closing or restarting the occupier according to further operation of the user so as to release the audio resource and enable the occupier to be used by the application program sending the request.
In addition, in the embodiment of the application, whether the audio resource is released or not can be performed according to the priority among the application programs. In particular, the amount of the solvent to be used,
if the information of the occupier is not empty, determining the priority of the occupier and the application program;
if the priority of the application program is higher than the priority of the occupier, releasing the audio resource so that the application program can call the released audio resource;
and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
It should be noted that, after the application program calls the audio resource, the application program sending the request performs a recording operation through the audio resource or performs a playing operation through the audio resource.
In the embodiment of the application, the audio resource occupier is monitored, and if the occupier information is empty, the audio resource is released immediately, so that the application program needing to call the audio resource is further called. If the information of the occupied party is not null, whether the audio resource is called or not can be determined according to the priority information, so that the stability of the system is improved, and the user experience is improved.
As shown in fig. 2, an embodiment of the present application further provides a method for calling an audio resource, including:
s210, distributing corresponding audio resources for the application program;
unlike the mechanism of S110 that allocates again according to the request, in S210, the electronic device actively allocates or pre-allocates the corresponding audio resource to the application program that needs to use the audio resource, where the audio resource may be randomly allocated or allocated according to a fixed threshold.
S220, monitoring the state of the audio resource when the audio resource is called by the application program;
after the audio resource is allocated to the application program, the audio resource status is monitored when the application program needs to call or start to call the allocated audio resource. The monitoring process is specifically described in S120, and this is not described in detail in this embodiment of the present application.
And S230, if the audio resource is abnormal in state, releasing the audio resource so that the application program calls the released audio resource.
And the audio resource state is abnormal, namely the current audio resource is occupied abnormally. In the embodiment of the application, if the current audio resource is occupied before being called and the information of the occupied party is empty or abnormal, the current audio resource is determined to be abnormal in state.
The method comprises the steps that an occupier is one or more application programs which currently occupy audio resources, occupier information is state information or ID information of the current occupier, if the occupier information is empty, namely the current occupier is represented to be abnormal, the output is empty (Null or Error), or the information of the occupier is not monitored, the output is empty (Null), at the moment, the occupier is determined to be abnormal, namely the occupier occupies the audio resources abnormally, therefore, the audio resources need to be released, and the application programs call the released audio resources. Wherein the audio resource may be released by a restart (Reset) operation, e.g. restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting the audio system to release the audio resource. And if the information of the occupier is not empty, determining that the occupier normally occupies the audio resource, sending an audio resource calling failure response message to the application program sending the request, prohibiting the application program from calling the audio resource until the audio resource is normally released, optionally, generating a conflict prompt message and displaying the conflict prompt message for a user to check, and forcibly closing or restarting the occupier according to further operation of the user so as to release the audio resource and enable the occupier to be used by the application program sending the request.
The audio resource is released, specifically, the audio manager may be restarted to release the audio resource, or the audio release interface may release the audio resource, or the audio system may be restarted to release the audio resource.
Optionally, if the audio resource status is occupied and the information of the occupied party is empty, the audio system is restarted to release the audio resource, or,
if the audio resource state is occupied and the information of the occupied party is not empty, acquiring the priority of the application program and the priority of the occupied party respectively, and if the priority of the application program is higher than the priority of the occupied party, releasing the audio resource for the application program to call the released audio resource; and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
After the application program calls the audio resource, recording operation can be carried out through the audio resource.
In the embodiment of the application, the state of the allocated audio resource is called by monitoring, and if the state is abnormal, the audio resource is released in time to be used for the application program to carry out subsequent calling. Furthermore, if the state is normal, whether the application program is used for subsequent calling can be determined according to the priority, so that the stability of the electronic equipment is improved, and the user experience is improved.
As shown in fig. 3, an apparatus 30 for calling an audio resource is further provided in the embodiment of the present application, where the apparatus 30 includes:
a receiving module 31, configured to receive an audio resource calling request of an application program;
in the embodiment of the present application, the audio resource may be a resource required for playing audio, such as a speaker, a sound channel, an audio file, or a resource required for recording, such as a microphone, an audio circuit, a recorded data storage, an audio recording processor, and the like, which is not limited in the embodiment of the present application. The audio resource calling of the application program can be realized through the audio resource calling device, the audio resource calling can be carried out through a processing function built in the audio resource calling device, for example, the audio resource calling device provided with the android system is installed, different types of functions are defined in the android system to realize the audio resource calling in different modes, and the audio resource calling comprises audio input and output operations, such as music playing, conversation, voice prompt, recording and the like, so that the audio resource calling can be realized only by using the corresponding audio calling function.
In the embodiment of the application, one or more application programs need to send a call request before using the audio resource, the audio resource calling device performs permission confirmation after receiving the call request of the application program, if the application program has the permission to call the audio resource, the call is allowed, otherwise, the call fails. In the prior art, when it is determined that an audio resource can be called, if the audio resource is not occupied, the audio resource is directly called, and if the audio resource is occupied, the audio resource is automatically waited until a previous application program (i.e., an occupied party of the audio resource) releases the audio resource.
The monitoring module 32 is configured to monitor the state of the audio resource, and if the state of the audio resource is an occupied state, query information of an occupied party corresponding to the audio resource;
in the embodiment of the present application, a completely new monitoring mechanism is creatively proposed, that is: and a monitoring module 32 is established at a system framework layer, and the audio resource state is monitored through the monitoring module, or the monitoring module 32 independently establishes a monitoring process and monitors the audio resource state of the application program through a message transmission mechanism. Specifically, the monitoring module 32 may monitor the audio resource call of the application through a built-in monitoring function, taking an audio resource calling device of the android system as an example, the monitoring module 32 may be created in a system framework layer (native/frame layer), and the audio mode of the application is monitored through the monitoring module 32, or the monitoring module 32 independently creates a monitoring process and monitors the audio mode of the application through a message transmission mechanism. For example, the monitoring module 32 may be set up in the framework layer and run in the system service program (system _ server), and since the monitoring module 32 is set up in the service framework layer of the system level, it may facilitate interaction with other system services without worrying about the authority problem when the system is invoked. In addition, an independent monitoring process can be created, an independent monitoring function is set and called in the process, the process can be set to be started up and started automatically, the audio resource calling of any other application program is monitored in real time, specifically, the ID information, the state information and/or the priority information and the like of the application program corresponding to the currently called audio resource can be captured in real time, the application program corresponding to the current calling behavior and the state of the application program can be determined accordingly, the independent monitoring process can be developed independently, the independent monitoring process is not coupled with a system, and the subsequent development and the subsequent upgrading are facilitated. Further, the monitoring module 32 may also monitor whether the state of the application program currently calling the audio resource is normal, and if the state is abnormal or the ID information is null, it is determined that the audio resource is abnormally occupied by the application program, and the audio resource occupied by the abnormal application program needs to be processed.
And a releasing module 33, configured to release the audio resource if the information of the occupied party is empty, so that the application program calls the released audio resource.
The occupation party is one or more application programs which currently occupy the audio resource, the occupation party information is state information or ID information of the current occupation party, if the occupation party information is Null, that is, the current occupation party state is abnormal, the output is Null (Error) or the information of the occupation party is not monitored, the output is Null (Null), it is determined that the occupation party is abnormal at this time, that is, the audio resource is abnormally occupied, therefore, the release module 33 needs to release the audio resource, so that the application programs call the released audio resource. Wherein the audio resource may be released by a restart (Reset) operation, e.g. restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting the audio system to release the audio resource. And if the information of the occupier is not empty, determining that the occupier normally occupies the audio resource, sending an audio resource calling failure response message to the application program sending the request, prohibiting the application program from calling the audio resource until the audio resource is normally released, optionally, generating a conflict prompt message and displaying the conflict prompt message by the audio resource calling device at the moment, allowing a user to check the conflict prompt message, and forcibly closing or restarting the occupier according to further operation of the user to release the audio resource and allow the application program sending the request to use.
In addition, in this embodiment of the application, the releasing module 33 may also release the audio resource according to the priority between the applications. In particular, the amount of the solvent to be used,
if the information of the occupier is not empty, determining the priority of the occupier and the application program;
if the priority of the application program is higher than the priority of the occupier, releasing the audio resource so that the application program can call the released audio resource;
and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
It should be noted that, after the application program calls the audio resource, the application program sending the request performs a recording operation through the audio resource or performs a playing operation through the audio resource.
In the embodiment of the present application, the monitoring module 32 monitors the audio resource occupation party, and if the occupation party information is empty, the releasing module 33 immediately releases the audio resource, so as to further invoke the application program that needs to invoke the audio resource. If the information of the occupied party is not null, whether the audio resource is called or not can be determined according to the priority information, so that the stability of the system is improved, and the user experience is improved.
As shown in fig. 4, an embodiment of the present application further provides an apparatus 40 for calling an audio resource, including:
an allocating module 41, configured to allocate a corresponding audio resource for an application;
the allocating module 41 is different from the receiving module 31 in the foregoing embodiment, and the allocating module 41 actively allocates or pre-allocates the corresponding audio resource to the application program that needs to use the audio resource, where the audio resource may be randomly allocated or allocated according to a fixed threshold.
A monitoring module 42, configured to monitor the status of the audio resource when the application calls the audio resource;
after the audio resource is allocated to the application program, the audio resource status is monitored when the application program needs to call or start to call the allocated audio resource. The monitoring process is the same as that of the monitoring module 32 in the above embodiment, and this is not described in detail in this embodiment.
A releasing module 43, configured to release the audio resource if the state of the audio resource is abnormal, so that the application program calls the released audio resource.
And the audio resource state is abnormal, namely the current audio resource is occupied abnormally. In the embodiment of the application, if the current audio resource is occupied before being called and the information of the occupied party is empty or abnormal, the current audio resource is determined to be abnormal in state.
The occupation party is one or more application programs currently occupying the audio resource, the occupation party information is state information or ID information of the current occupation party, if the occupation party information is Null, that is, it indicates that the current occupation party is abnormal in state, the output is Null (Error) or no information of the occupation party is monitored, the output is Null (Null), it is determined that the occupation party is abnormal at this time, that is, the audio resource is abnormally occupied, therefore, the release module 43 is required to release the audio resource, so that the application program calls the released audio resource. Wherein the audio resource may be released by a restart (Reset) operation, e.g. restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting the audio system to release the audio resource. And if the information of the occupier is not empty, determining that the occupier normally occupies the audio resource, sending an audio resource calling failure response message to the application program sending the request, prohibiting the application program from calling the audio resource until the audio resource is normally released, optionally, generating a conflict prompt message and displaying the conflict prompt message for a user to check, and forcibly closing or restarting the occupier according to further operation of the user so as to release the audio resource and enable the occupier to be used by the application program sending the request.
The audio resource is released, specifically, the audio manager may be restarted to release the audio resource, or the audio release interface may release the audio resource, or the audio system may be restarted to release the audio resource.
Optionally, if the audio resource status is occupied and the information of the occupied party is empty, the releasing module 33 restarts the audio system to release the audio resource, or,
if the audio resource state is occupied and the information of the occupied party is not empty, acquiring the priority of the application program and the priority of the occupied party respectively, and if the priority of the application program is higher than the priority of the occupied party, releasing the audio resource for the application program to call the released audio resource; and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
After the application program calls the audio resource, recording operation can be carried out through the audio resource.
In the embodiment of the present application, the monitoring module 42 calls the allocated audio resource status, and if the status is abnormal, the releasing module 43 releases the audio resource in time to provide the application program with subsequent calls. Furthermore, if the state is normal, whether the application program is used for subsequent calling can be determined according to the priority, so that the stability of the electronic equipment is improved, and the user experience is improved.
Fig. 5 is a schematic diagram of an internal structure of an electronic device according to an embodiment. As shown in fig. 5, the electronic device includes a processor, a nonvolatile storage medium, an internal memory, and a network interface, a sound collection device, a speaker, a display screen, and an input device, which are connected by a system bus. Wherein the non-volatile storage medium of the terminal stores an operating system and computer readable instructions. The computer readable instructions, when executed by a processor, implement an audio resource invocation method for an electronic device. The processor is used for providing calculation and control capability and supporting the operation of the whole electronic equipment. Internal memory in the electronic device provides an environment for the execution of computer-readable instructions in the non-volatile storage medium. The display screen of the electronic device may be a liquid crystal display screen or an electronic ink display screen, and the input device may be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a housing of the electronic device, or an external keyboard, a touch pad or a mouse. The electronic device may be a mobile phone, a tablet computer, or a personal digital assistant or a wearable device, etc. Those skilled in the art will appreciate that the configuration shown in fig. 5 is a block diagram of only a portion of the configuration associated with the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
The above mentioned audio resource calling method may specifically be:
receiving an audio resource calling request of an application program;
monitoring the state of the audio resource, and inquiring corresponding occupier information of the audio resource if the state of the audio resource is an occupied state;
and if the information of the occupier is empty, releasing the audio resource so that the application program calls the released audio resource.
In one embodiment, the monitoring of the audio resource status may specifically be: and creating a system level monitoring module on a system framework layer, monitoring the audio resource state through the monitoring module, or independently creating a monitoring process, and monitoring the audio resource state of the application program through a message transmission mechanism.
In one embodiment, the releasing the audio resource may specifically be: restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting an audio system to release the audio resource.
In one embodiment, the processor is further configured to perform:
and if the information of the occupier is not null, sending an audio resource calling failure response message to the application program, and forbidding the application program to call the audio resource.
In one embodiment, the processor is further configured to perform: and generating and displaying a conflict prompt message.
In one embodiment, the processor is further configured to perform:
if the information of the occupier is not empty, determining the priority of the occupier and the application program;
if the priority of the application program is higher than the priority of the occupier, releasing the audio resource so that the application program can call the released audio resource;
and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
In one embodiment, after the application program calls the audio resource, the processor performs a recording operation or a playing operation through the audio resource.
In addition, the above mentioned audio resource calling method may specifically be further:
distributing corresponding audio resources for the application program;
monitoring the state of the audio resource when the audio resource is called by the application program;
and if the audio resource state is abnormal, releasing the audio resource so that the application program calls the released audio resource.
In one embodiment, the monitoring of the audio resource status may specifically be:
and creating a system level monitoring module on a system framework layer, monitoring the audio resource state through the monitoring module, or independently creating a monitoring process, and monitoring the audio resource state of the application program through a message transmission mechanism.
In one embodiment, the releasing the audio resource may specifically be: restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting an audio system to release the audio resource.
In one embodiment, if the state of the audio resource is abnormal, the audio resource is released, which may specifically be:
if the audio resource status is occupied and the information of the occupied party is empty, the audio system is restarted to release the audio resource, or,
if the audio resource state is occupied and the information of the occupied party is not empty, acquiring the priority of the application program and the priority of the occupied party respectively, and if the priority of the application program is higher than the priority of the occupied party, releasing the audio resource for the application program to call the released audio resource; and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
Wherein, after the application program calls the audio resource, the processor is further configured to: and carrying out recording operation through the audio resource.
In addition, the embodiment of the present application further provides a computer non-volatile readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the audio resource calling.
The embodiment of the invention also provides computer equipment. As shown in fig. 6, for convenience of illustration, only the portion related to the embodiment of the present invention is shown, and details of the technique are not disclosed, please refer to the method portion of the embodiment of the present invention. The computer device may be any terminal device including an electronic device, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the computer device as the electronic device as an example:
fig. 6 is a block diagram of a partial structure of an electronic device related to a computer device provided in an embodiment of the present invention. Referring to fig. 6, the electronic device includes: radio Frequency (RF) circuit 610, memory 620, input unit 630, display unit 640, sensor 650, audio circuit 660, wireless fidelity (WiFi) module 670, processor 680, and power supply 690. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The RF circuit 610 may be used for receiving and transmitting signals during information transmission or communication, and may receive downlink information of the base station and then process the downlink information to the processor 680; the uplink data may also be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 610 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE)), e-mail, Short Messaging Service (SMS), and the like.
The memory 620 may be used to store software programs and modules, and the processor 680 may execute various functional applications of the electronic device and data processing by operating the software programs and modules stored in the memory 620. The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, an address book, etc.) created according to the use of the electronic device, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device 600. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632. The touch panel 631, which may also be referred to as a touch screen, may collect touch operations performed by a user on or near the touch panel 631 (e.g., operations performed by the user on or near the touch panel 631 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. In one embodiment, the touch panel 631 may include two parts, a touch monitoring device and a touch controller. The touch monitoring device monitors the touch direction of a user, monitors signals brought by touch operation and transmits the signals to the touch controller; the touch controller receives touch information from the touch monitoring device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 680, and can receive and execute commands sent by the processor 680. In addition, the touch panel 631 may be implemented using various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 630 may include other input devices 632 in addition to the touch panel 631. In particular, other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), and the like.
The display unit 640 may be used to display information input by or provided to a user and various menus of the electronic device. The display unit 640 may include a display panel 641. In one embodiment, the Display panel 641 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, the touch panel 631 can cover the display panel 641, and when the touch panel 431 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 680 to determine the type of the touch event, and then the processor 680 provides a corresponding visual output on the display panel 641 according to the type of the touch event. Although in fig. 6, the touch panel 631 and the display panel 641 are two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 631 and the display panel 641 may be integrated to implement the input and output functions of the electronic device.
The electronic device 600 may also include at least one sensor 650, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 661 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 661 and/or backlight when the electronic device is moved to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can monitor the magnitude of acceleration in each direction, the magnitude and the direction of gravity can be monitored when the motion sensor is static, and the motion sensor can be used for identifying the application (such as horizontal and vertical screen switching) of the posture of the electronic equipment, and relevant functions (such as pedometer and knocking) of vibration identification and the like; the electronic device may be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
Audio circuit 660, speaker 661, and microphone 662 can provide an audio interface between a user and an electronic device. The audio circuit 660 may transmit the electrical signal converted from the received audio data to the speaker 661, and convert the electrical signal into an audio signal through the speaker 661 for output; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 660 and converted into audio data, which is then processed by the audio data output processor 680 and then transmitted to another electronic device via the RF circuit 610, or the audio data is output to the memory 620 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the electronic equipment can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 670, and provides wireless broadband Internet access for the user. Although fig. 6 illustrates a WiFi module 670, it is understood that it does not pertain to the requisite components of electronic device 600 and may be omitted as desired.
The processor 680 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 620 and calling data stored in the memory 620, thereby monitoring the electronic device as a whole. In one embodiment, processor 680 may include one or more processing units. In one embodiment, processor 680 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, and the like; the modem processor handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 680.
The electronic device 600 also includes a power supply 690 (e.g., a battery) for powering the various components, which may be logically coupled to the processor 680 via a power management system to manage charging, discharging, and power consumption via the power management system.
In one embodiment, the electronic device 600 may also include a camera, a bluetooth module, and the like.
In an embodiment of the present invention, the processor 680 included in the computer device implements the methods of the embodiments described above when executing the computer program stored on the memory, for example, the methods including the audio resource call shown in fig. 1 or fig. 2.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like. Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, performs the methods of the above embodiments.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (19)

  1. A method for audio resource invocation, comprising:
    receiving an audio resource calling request of an application program;
    monitoring the state of the audio resource, and inquiring corresponding occupier information of the audio resource if the state of the audio resource is an occupied state;
    and if the information of the occupier is empty, releasing the audio resource so that the application program calls the released audio resource.
  2. The method of claim 1, wherein the monitoring the audio asset status comprises:
    creating a system-level monitoring module at a system framework layer, and monitoring the audio resource state through the monitoring module, or,
    and independently creating a monitoring process, and monitoring the audio resource state of the application program through a message transmission mechanism.
  3. The method of claim 1, wherein the releasing the audio resource comprises:
    restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting an audio system to release the audio resource.
  4. The method of claim 1, further comprising:
    and if the information of the occupier is not null, sending an audio resource calling failure response message to the application program, and forbidding the application program to call the audio resource.
  5. The method of claim 4, further comprising:
    and generating and displaying a conflict prompt message.
  6. The method of claim 1, further comprising:
    if the information of the occupier is not empty, determining the priority of the occupier and the application program;
    if the priority of the application program is higher than the priority of the occupier, releasing the audio resource so that the application program can call the released audio resource;
    and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
  7. The method of claim 1, wherein after the application makes the call to the audio resource, the method further comprises:
    and carrying out recording operation through the audio resource.
  8. The method of claim 1, wherein after the application makes the call to the audio resource, the method further comprises:
    and performing playing operation through the audio resource.
  9. A method for audio resource invocation, comprising:
    distributing corresponding audio resources for the application program;
    monitoring the state of the audio resource when the audio resource is called by the application program;
    and if the audio resource state is abnormal, releasing the audio resource so that the application program calls the released audio resource.
  10. The method of claim 9, wherein the monitoring the audio asset status comprises:
    creating a system-level monitoring module at a system framework layer, and monitoring the audio resource state through the monitoring module, or,
    and independently creating a monitoring process, and monitoring the audio resource state of the application program through a message transmission mechanism.
  11. The method of claim 9, wherein the releasing the audio resource comprises:
    restarting the audio manager to release the audio resource, or releasing the audio resource through an audio release interface, or restarting an audio system to release the audio resource.
  12. The method of claim 9, wherein releasing the audio resource if the status of the audio resource is abnormal comprises:
    if the audio resource status is occupied and the information of the occupied party is empty, the audio system is restarted to release the audio resource, or,
    if the audio resource state is occupied and the information of the occupied party is not empty, acquiring the priority of the application program and the priority of the occupied party respectively, and if the priority of the application program is higher than the priority of the occupied party, releasing the audio resource for the application program to call the released audio resource; and if the priority of the application program is lower than the priority of the occupier or is the same as the priority of the occupier, forbidding the application program to call the audio resource.
  13. The method of claim 9, wherein after the application makes the call to the audio resource, the method further comprises:
    and carrying out recording operation through the audio resource.
  14. An apparatus for audio resource invocation, the apparatus comprising:
    the receiving module is used for receiving an audio resource calling request of an application program;
    the monitoring module is used for monitoring the state of the audio resource, and inquiring the information of an occupier corresponding to the audio resource if the state of the audio resource is an occupied state;
    and the release module is used for releasing the audio resource if the information of the occupied party is empty so as to enable the application program to call the audio resource.
  15. An apparatus for audio resource invocation, the apparatus comprising:
    the distribution module is used for distributing corresponding audio resources for the application program;
    the monitoring module is used for monitoring the state of the audio resource when the audio resource is called by the application program;
    and the release module is used for releasing the audio resources when the state of the audio resources is abnormal so as to enable the application program to call the released audio resources.
  16. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the steps of audio resource invocation recited in any of claims 1-8.
  17. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the steps of audio resource invocation recited in any of claims 9-13.
  18. A computer non-transitory readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the steps of the audio resource call of any of claims 1-8.
  19. A computer non-transitory readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the steps of the audio resource call of any of claims 9-13.
CN201880098446.9A 2018-11-26 2018-11-26 Audio resource calling method and device and electronic equipment Active CN113039517B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/117523 WO2020107177A1 (en) 2018-11-26 2018-11-26 Audio resource invoking method and apparatus, and electronic device

Publications (2)

Publication Number Publication Date
CN113039517A true CN113039517A (en) 2021-06-25
CN113039517B CN113039517B (en) 2022-12-13

Family

ID=70853378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880098446.9A Active CN113039517B (en) 2018-11-26 2018-11-26 Audio resource calling method and device and electronic equipment

Country Status (2)

Country Link
CN (1) CN113039517B (en)
WO (1) WO2020107177A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434222A (en) * 2021-06-30 2021-09-24 青岛海尔科技有限公司 Application program control method and device, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294553A (en) * 2012-02-24 2013-09-11 中兴通讯股份有限公司 Method and device for managing multimedia resources of mobile terminal
US20150220517A1 (en) * 2012-06-21 2015-08-06 Emc Corporation Efficient conflict resolution among stateless processes
CN105550037A (en) * 2015-12-11 2016-05-04 北京元心科技有限公司 Method and device for allocating audio resources in multiple systems
CN106101367A (en) * 2016-05-26 2016-11-09 广东欧珀移动通信有限公司 Recording processing method and system
WO2018210049A1 (en) * 2017-05-17 2018-11-22 中兴通讯股份有限公司 Audio occupation processing method, device, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294553A (en) * 2012-02-24 2013-09-11 中兴通讯股份有限公司 Method and device for managing multimedia resources of mobile terminal
US20150220517A1 (en) * 2012-06-21 2015-08-06 Emc Corporation Efficient conflict resolution among stateless processes
CN105550037A (en) * 2015-12-11 2016-05-04 北京元心科技有限公司 Method and device for allocating audio resources in multiple systems
CN106101367A (en) * 2016-05-26 2016-11-09 广东欧珀移动通信有限公司 Recording processing method and system
WO2018210049A1 (en) * 2017-05-17 2018-11-22 中兴通讯股份有限公司 Audio occupation processing method, device, and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434222A (en) * 2021-06-30 2021-09-24 青岛海尔科技有限公司 Application program control method and device, storage medium and electronic device
CN113434222B (en) * 2021-06-30 2023-06-09 青岛海尔科技有限公司 Control method and device of application program, storage medium and electronic device

Also Published As

Publication number Publication date
CN113039517B (en) 2022-12-13
WO2020107177A1 (en) 2020-06-04

Similar Documents

Publication Publication Date Title
US10635449B2 (en) Method and apparatus for running game client
US10831161B2 (en) Method and device for sending communication message
CN106775833B (en) Device driver loading method, terminal and system
WO2018120905A1 (en) Message reminding method for terminal, and terminal
CN107786424B (en) Audio and video communication method, terminal and server
CN108600516B (en) Data acquisition method, mobile terminal and computer readable storage medium
JP2018504708A (en) Method, device, and system for managing information recommendations
CN109002547B (en) Log file storage method, mobile terminal and computer readable storage medium
CN109766119B (en) Recovery partition upgrade method, terminal and computer readable storage medium
CN113039516A (en) Method and device for processing application program and electronic equipment
WO2020118495A1 (en) Audio resource allocation method, device, and electronic apparatus
CN107247617B (en) Virtual machine resource allocation method, trial platform and readable storage medium
CN107770449B (en) Continuous shooting method, electronic device and storage medium
CN112805988A (en) Call control method and device, computer readable storage medium and electronic equipment
CN107463395B (en) Component calling method and device
CN113039517B (en) Audio resource calling method and device and electronic equipment
CN110209434B (en) Memory management method and device and computer readable storage medium
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
CN115225966B (en) Application starting method, device, terminal equipment and storage medium
CN111078312A (en) MBN loading method and electronic equipment
CN109992322B (en) Application program unloading method and device, storage medium and terminal
CN104717283A (en) File downloading control method, terminal and logic processing server
CN106445594B (en) System application installation method and device and terminal equipment
WO2020097787A1 (en) Method, apparatus, and electronic device for audio resource release
CN113852450A (en) Message push feedback method and device, electronic equipment and storage medium

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