CN115134452A - Calling method and device of microphone resources - Google Patents
Calling method and device of microphone resources Download PDFInfo
- Publication number
- CN115134452A CN115134452A CN202110325571.2A CN202110325571A CN115134452A CN 115134452 A CN115134452 A CN 115134452A CN 202110325571 A CN202110325571 A CN 202110325571A CN 115134452 A CN115134452 A CN 115134452A
- Authority
- CN
- China
- Prior art keywords
- service
- microphone
- audio data
- recording
- recording request
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R3/00—Circuits for transducers, loudspeakers or microphones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R3/00—Circuits for transducers, loudspeakers or microphones
- H04R3/005—Circuits for transducers, loudspeakers or microphones for combining the signals of two or more microphones
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Otolaryngology (AREA)
- Telephonic Communication Services (AREA)
Abstract
The application provides a method and a device for calling microphone resources, which comprise the following steps: receiving a first recording request initiated by a first service, wherein the first recording request is used for indicating recording based on microphone resources, and if the terminal equipment is in a state of providing the microphone resources for a second service, copying the audio data acquired by providing the microphone resource for the second service to obtain copied audio data, feeding the copied audio data back to the first service, and when the microphone resource is already used, the audio data acquired based on the microphone resources may be copied, resulting in copied audio data, so as to feed the copied audio data back to the service which initiates the recording request later, thereby realizing that a plurality of services commonly use the microphone resource, the method and the device have the advantages that the recording requirements of the microphones are concurrent, the resource utilization rate is improved, the requirements of users on the microphone resources are met, and the technical effect of user experience is improved.
Description
Technical Field
The present application relates to communications technologies, and in particular, to a method and an apparatus for calling microphone resources.
Background
With the development of internet technology and communication technology, terminal devices are more widely used, and the demands of users on the functions of the terminal devices are increasing and increasing. For example, the demand for using the recording function by one service has progressed to the demand for using the recording function by a plurality of services in common.
A microphone is generally provided in the terminal device, and recording or calling is performed through the microphone. In the prior art, if a microphone is already opened by a certain service for recording, other services cannot open and use the microphone again, and the other services can only use the microphone resource after the microphone resource is released by the certain service.
However, since the microphone resource can only be used by a certain service, there may be problems of low resource utilization and low flexibility of recording.
Disclosure of Invention
The application provides a calling method and device of microphone resources, which are used for solving the problem that the microphone resources cannot be called by a plurality of services at the same time in the prior art.
In a first aspect, the present application provides a method for calling a microphone resource, which is applied to a terminal device, where the terminal device is provided with multiple services, and each service can use the microphone resource of the terminal device through a recording request, and the method includes:
receiving a first recording request initiated by a first service, wherein the first recording request is used for indicating recording based on the microphone resource;
if the terminal equipment is in a state of providing the microphone resource for the second service, copying the audio data acquired by providing the microphone resource for the second service to obtain copied audio data;
and feeding back the copied audio data to the first service.
In some embodiments, the first recording request carries recording parameters, and feeding back the copied audio data to the first service includes:
and according to the recording parameter of the first service, resampling the copied audio data to obtain resampled data, and feeding back the resampled data to the first service.
In some embodiments, the first recording request carries an identifier of the first service, and feeding back the copied audio data to the first service includes:
and feeding back the copied audio data to the first service according to the identifier of the first service.
In some embodiments, further comprising:
if the microphone resource is not used by other services, creating a recording according to the first recording request to realize an Audio Record instance;
and acquiring Audio data collected based on a microphone according to the Audio Record example, and feeding back the Audio data to the first service.
In some embodiments, further comprising:
receiving a second recording request initiated by a first service, wherein the second recording request is used for indicating to stop recording;
and if the terminal equipment does not need to provide the microphone resources for other services, stopping recording according to the second recording request, and releasing the microphone resources.
In some embodiments, further comprising:
and if the terminal equipment needs to provide the microphone resources for other services, stopping copying audio data for the first service according to the second recording request.
In a second aspect, the present application provides a device for calling a microphone resource, which is applied to a terminal device, where the terminal device is provided with a plurality of services, and each service can use the microphone resource through a recording request, and the device includes:
a first receiving unit, configured to receive a first recording request initiated by a first service, where the first recording request is used to instruct recording based on the microphone resource;
the copying unit is used for copying the audio data acquired by providing the microphone resource for the second service to obtain copied audio data if the terminal equipment is in a state of providing the microphone resource for the second service;
and the first feedback unit is used for feeding back the copied audio data to the first service.
In some embodiments, the first recording request carries recording parameters, and the first feedback unit includes:
the resampling subunit is configured to perform resampling processing on the copied audio data according to the recording parameter of the first service, so as to obtain resampled data;
and the feedback subunit is used for feeding back the resampled data to the first service.
In some embodiments, the first feedback unit is configured to feed back the copied audio data to the first service according to the identifier of the first service.
In some embodiments, further comprising:
a creating unit, configured to create a recording according to the first recording request to implement an Audio Record instance if the microphone resource is not used by other services;
the acquisition unit is used for acquiring Audio data acquired based on a microphone according to the Audio Record example;
and the second feedback unit is used for feeding back the audio data to the first service.
In some embodiments, further comprising:
a second receiving unit, configured to receive a second recording request initiated by a first service, where the second recording request is used to instruct to stop recording;
a first stopping unit, configured to stop recording according to the second recording request if the terminal device does not need to provide the microphone resource for another service;
a release unit for releasing the microphone resource.
In some embodiments, further comprising:
and the second stopping unit is used for stopping copying audio data for the first service according to the second recording request if the terminal equipment needs to provide the microphone resources for other services.
In a third aspect, the present application provides an electronic device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the method of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon computer-executable instructions for implementing the method according to the first aspect when executed by a processor.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, performs the method according to the first aspect.
In a sixth aspect, the present application provides a terminal device, including: an android operating system platform, a microphone resource multiplexing virtual layer, and an application program interface, wherein,
the application program interface is used for receiving a first recording request initiated by a first service, wherein the first recording request is used for indicating recording based on the microphone resource;
the microphone resource multiplexing virtual layer is used for copying audio data acquired by providing microphone resources for a second service to obtain copied audio data if the terminal equipment is in a state of providing the microphone resources for the second service, wherein the audio data is acquired from the android operating system platform;
and the application program interface is used for feeding back the copied audio data to the first service.
The application provides a method and a device for calling microphone resources, which are applied to a terminal device, wherein a plurality of services are arranged in the terminal device, and each service can use the microphone resources of the terminal device through a recording request, and the method comprises the following steps: receiving a first recording request initiated by a first service, where the first recording request is used to instruct recording based on microphone resources, and if the terminal device is in a state of providing microphone resources for a second service, copying audio data obtained by providing microphone resources for the second service to obtain copied audio data, and feeding the copied audio data back to the first service, in this embodiment, when the microphone resources are already used, the audio data obtained based on the microphone resources may be copied to obtain copied audio data, so as to feed the copied audio data back to the service initiating a recording request later, thereby implementing common use of the microphone resources by multiple services, that is, implementing concurrence of recording requirements for microphones, improving resource utilization rate, and satisfying requirements of users for microphone resources, the technical effect of the user experience is increased.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram of an application scenario of a method for calling microphone resources according to the present application;
fig. 2 is a flowchart illustrating a method for calling a microphone resource according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a method for calling a microphone resource according to another embodiment of the present application;
FIG. 4 is a diagram illustrating an apparatus for invoking microphone resources according to an embodiment of the present application;
FIG. 5 is a diagram illustrating an apparatus for invoking microphone resources according to another embodiment of the present application;
FIG. 6 is a block diagram of an electronic device for invoking a method of microphone resources according to the present application;
fig. 7 is a schematic diagram of a terminal device according to an embodiment of the disclosure.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. The drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the concepts of the application by those skilled in the art with reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
Referring to fig. 1, fig. 1 is a schematic view illustrating an application scenario of a method for calling microphone resources according to the present application.
As shown in fig. 1, a plurality of services may be set in the terminal device 101, and one service may be one Application (APP). That is, a plurality of applications can be downloaded and run in the terminal apparatus 101.
The terminal apparatus 101 may be a wireless terminal or a wired terminal. A wireless terminal may refer to a device that provides voice and/or other traffic data connectivity to a user, a handheld device having wireless connection capability, or other processing device connected to a wireless modem. A wireless terminal, which may be a mobile terminal such as a mobile telephone (or "cellular" telephone) and a computer having a mobile terminal, for example, a portable, pocket, hand-held, computer-included, or vehicle-mounted mobile device, may communicate with one or more core Network devices via a Radio Access Network (RAN), and may exchange language and/or data with the RAN. For another example, the Wireless terminal may also be a Personal Communication Service (PCS) phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), and other devices. A wireless Terminal may also be referred to as a system, a Subscriber Unit (Subscriber Unit), a Subscriber Station (Subscriber Station), a Mobile Station (Mobile), a Remote Station (Remote Station), a Remote Terminal (Remote Terminal), an Access Terminal (Access Terminal), a User Terminal (User Terminal), a User Agent (User Agent), and a User Equipment (User Device or User Equipment), which are not limited herein. Optionally, the terminal device may also be a smart watch, a tablet computer, or the like.
Illustratively, as shown in fig. 1, the terminal apparatus 101 may include an application a and an application B therein.
The terminal device 101 may also be provided with at least one microphone, e.g. the terminal device 101 may be provided with one microphone, or the terminal device 101 may be provided with two microphones, etc.
The location of the microphone on the terminal device 101 is not limited in this embodiment.
In one example, if the number of the microphones is one, the microphones may be disposed at a position above the screen of the terminal device 101, such as the microphones may be disposed at a position flush with the camera, or the microphones may be disposed at a position below the screen, such as the microphones may be disposed at a position flush with the charging interface, or the microphones may be disposed at a left side of the terminal device 101, or the microphones may be disposed at a right side of the terminal device 101, etc., which are not listed again.
In another example, if the number of the microphones is multiple, any one of the multiple microphones may be set by referring to the position of the microphone, which is not described herein again.
As shown in fig. 1, the user 102 may start multiple applications in the terminal device 101 at the same time, and the multiple applications may need to use the microphone resource at the same time, for example, the multiple applications need to acquire corresponding audio data through the recording function of the microphone.
For example, taking application a and application B shown in fig. 1 as an example, the following is exemplarily described:
both application a and application B need to use the microphone resource, and if both need to obtain corresponding audio data through the recording function of the microphone.
However, in the related art, the audio resource management policy of the android Operating System (OS) platform does not support multiple recording tracks (tracks) nor does it support concurrent voice and recording, so if the application a is recording or talking on a microphone, the application B cannot use the microphone, and needs to wait for the application a to record or finish the voice call, and release the microphone resource, then the application can use the microphone.
Therefore, the method for calling the microphone resource in the related art cannot simultaneously satisfy the requirements of multiple services (i.e., multiple applications), which results in a problem of low resource utilization rate and low flexibility of microphone utilization.
In order to solve at least one of the above technical problems, the inventors of the present application have made creative efforts to obtain the inventive concept of the present application: if the microphone resource is already used by the service, the audio data acquired based on the microphone resource can be copied, and the copied audio data is sent to the service requesting to use the microphone.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. These several specific embodiments may be combined with each other below, 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.
Fig. 2 is a flowchart illustrating a method for calling a microphone resource according to an embodiment of the present application.
As shown in fig. 2, the method includes:
s201: and receiving a first sound recording request initiated by a first service.
The method of the embodiment may be applied to a terminal device, where the terminal device is provided with multiple services, each service may use a microphone resource of the terminal device through a recording request, and the first recording request is used to instruct recording based on the microphone resource.
For example, the execution main body of this embodiment may be a calling device of a microphone resource (hereinafter, referred to as a calling device for short), and the calling device may be a terminal device, an electronic device, a server, a processor, a chip, or the like, and this embodiment is not limited thereto.
For example, if the calling device is a terminal device, the description of the terminal device may refer to the description of the terminal device in the application scenario, and is not described herein again.
For another example, if the calling device is an electronic device, the electronic device may be a recorder, and the recorder has a voice recording service and a communication (e.g., a talk-over call) service.
That is to say, the method for calling the microphone resource according to the embodiment may be applied to the application scenario shown in fig. 1, and may also be applied to an application scenario of security protection, for example, in the process of security protection, relevant staff may obtain evidence through a recorder, for example, by recording sound, so as to obtain corresponding evidence, and contact and communication with other relevant staff may also be achieved through the recorder.
It should be understood that the above examples are only used for exemplary illustration, and the calling method of the microphone resource of the present embodiment may be applied to an application scenario, and is not to be construed as a limitation to the application scenario.
S202: and if the terminal equipment is in the state of providing the microphone resources for the second service, copying the audio data acquired by providing the microphone resources for the second service to obtain copied audio data.
S203: and feeding back the copied audio data to the first service.
Exemplarily, taking the first service as a voice recording service and the second service as an intercom service as an example, the present embodiment is exemplarily described as follows:
after receiving the voice recording service, the calling device judges whether the microphone resource is used by other services, if the calling device determines that the microphone resource is used by the talkback service, the audio data obtained by providing the microphone resource for the talkback service is copied to obtain copied audio data, and the copied audio data is sent to the talkback service.
That is to say, in this embodiment, the copied audio data can be obtained by copying the audio data, and by sending the copied audio data to the talkback service, the implementation of the voice recording service and the implementation of the talkback service are both satisfied, so that the microphone resources are shared by different services, the resource utilization rate is improved, and the technical effects of diversity and flexibility of the application of the microphone are improved.
Based on the above analysis, an embodiment of the present application provides a method for calling a microphone resource, which is applied to a terminal device, where the terminal device is provided with multiple services, and each service can use the microphone resource of the terminal device through a recording request, and the method includes: receiving a first recording request initiated by a first service, wherein the first recording request is used for indicating recording based on microphone resources, and if a terminal device is in a state of providing the microphone resources for a second service, copying audio data obtained by providing the microphone resources for the second service to obtain copied audio data, and feeding the copied audio data back to the first service, in this embodiment, when the microphone resources are already used, the audio data obtained based on the microphone resources can be copied to obtain copied audio data, so that the copied audio data can be fed back to the service initiating the recording request later, thereby realizing that multiple services commonly use the microphone resources, i.e. realizing concurrence of recording requirements on microphones, improving resource utilization rate, and satisfying requirements of users on microphone resources, the technical effect of the user experience is increased.
Fig. 3 is a flowchart illustrating a method for calling microphone resources according to another embodiment of the present application.
As shown in fig. 3, the method includes:
s301: and receiving a first sound recording request initiated by a first service.
The method of the embodiment may be applied to a terminal device, where the terminal device is provided with multiple services, each service may use a microphone resource of the terminal device through a recording request, and the first recording request is used to instruct recording based on the microphone resource.
For example, the description about S301 may refer to S201, and is not described herein again.
S302: and judging whether the microphone resources are used by other services, if so, executing S303, and if not, executing S310.
S303: and copying the audio data acquired by providing microphone resources for other services to obtain copied audio data.
For example, if the invoking device determines that the microphone resource is already used by the other service, and in combination with the above embodiment, if the other service is the second service, that is, the microphone resource is used by the second service, the invoking device may copy the audio data acquired and provided for the second service, to obtain the copied audio data.
Specifically, if the number of the first services is one, one copy of audio data may be copied, and if the number of the first services is multiple, multiple copies of audio data may be copied, that is, the calling device may determine the number of copies of audio data based on the number of the first services, so as to subsequently allocate one copy of audio data to each first service.
S304: and according to the recording parameter of the first service, resampling the copied audio data to obtain resampled data.
Wherein, the first recording request carries the recording parameter. The recording parameters may be set by the calling device based on the requirements of the service for recording. That is, different services have different recording requirements, and the different recording requirements correspond to different recording parameters. The recording parameters may characterize parameters related to the quality of the audio data, etc.
It should be noted that, in this embodiment, the audio data after being copied is resampled by combining the recording parameter of the first service, so that the obtained resampled data meets the requirement of the first service, and different audio data can be allocated to different services, thereby achieving diversity and flexibility, and enabling the resampled data received by each service not to be interfered by other data, and meeting the technical effect of user experience.
S305: and feeding back the resample data to the first service according to the identifier of the first service.
Wherein, the first recording request carries the identifier of the first service.
For example, different services have different identifiers, when each service sends a first recording request to the calling device, the identifier of each service may be carried in the first recording request, and after the calling device obtains resampled data, the calling device may allocate corresponding resampled data to each service based on the identifier of each service.
It should be noted that, in this embodiment, the resample data is fed back to the first service through the identifier of the first service, so that the technical effects of accuracy and reliability of the feedback of the resample data can be improved.
S306: and receiving a second sound recording request initiated by the first service.
Wherein the second recording request is used for indicating to stop recording.
S307: and judging whether the terminal equipment needs to provide microphone resources for other services, if so, executing S308, and if not, executing S309.
S308: and stopping copying the audio data for the first service according to the second recording request.
For example, with reference to the foregoing embodiment, if the calling device provides audio data for the first service and the second service respectively, and if the first service requests stopping recording, the calling device may stop copying the audio data for the first service, that is, the calling device does not need to copy the audio data any more, and does not need to feed the copied audio data back to the first service, but only needs to provide the audio data for the second service.
It should be noted that, in this embodiment, when a certain service requests stopping recording, the calling device may stop copying audio data for the service without affecting the provision of audio data for other services, and therefore, the technical effects of providing flexibility, diversity and reliability of audio data may be achieved.
S309: and stopping recording according to the second recording request and releasing the microphone resource.
For example, in this embodiment, if the calling device does not need to provide audio data for any service task any more, the calling device may stop recording based on the second recording request and release the microphone resource, thereby achieving the technical effects of reducing the load and improving the resource utilization rate.
S310: an Audio Record instance is implemented by creating a sound Record according to the first sound Record request.
In some embodiments, the first recording request may carry attribute information of the first service, where the attribute information may be understood as related information representing an identity or an authority of the first service, the invoking device may verify the authority of the first service based on the attribute information of the first service, if the verification passes, the invoking device may create an Audio Record instance according to the first recording request, and if the verification fails, the invoking device may feed back prompt information to the first service, so as to prompt that the first service does not have an authority to use a microphone resource, and the like.
S311: and acquiring Audio data collected based on a microphone according to the Audio Record example, and feeding back the Audio data to the first service.
That is to say, in this embodiment, the calling device may obtain the Audio data by creating an Audio Record instance, and since no other service uses the microphone resource, the calling device may directly feed back the obtained Audio data to the first service.
It should be noted that, by acquiring and feeding back Audio data in a manner of creating an Audio Record instance, the technical effect of flexibility and diversity of feeding back Audio data can be achieved.
Referring to fig. 4, fig. 4 is a schematic diagram of a device for calling microphone resources according to an embodiment of the present application.
As shown in fig. 4, the apparatus 400 for calling a microphone resource includes:
a first receiving unit 401, configured to receive a first recording request initiated by a first service, where the first recording request is used to instruct to record based on microphone resources.
A copying unit 402, configured to copy, if the terminal device is in a state of providing microphone resources for the second service, the audio data acquired by providing the microphone resources for the second service, so as to obtain copied audio data.
A first feedback unit 403, configured to feed back the copied audio data to the first service.
Referring to fig. 5, fig. 5 is a schematic diagram of a device for calling microphone resources according to another embodiment of the present application.
As shown in fig. 5, the apparatus 500 for calling a microphone resource includes:
a first receiving unit 501, configured to receive a first recording request initiated by a first service, where the first recording request is used to indicate recording based on a microphone resource.
The copying unit 502 is configured to copy, if the terminal device is in a state of providing microphone resources for the second service, the audio data acquired by providing the microphone resources for the second service, so as to obtain copied audio data.
A first feedback unit 503, configured to feed back the copied audio data to the first service.
The first feedback unit 503 is configured to feed back the copied audio data to the first service according to the identifier of the first service.
As can be seen from fig. 5, in some embodiments, the first recording request carries recording parameters, and the first feedback unit 503 includes:
the resampling sub-unit 5031 is configured to perform resampling processing on the copied audio data according to the recording parameter of the first service, so as to obtain resampled data.
A feedback sub-unit 5032, configured to feed back the resampled data to the first service.
A creating unit 504, configured to create a recording to implement the Audio Record instance according to the first recording request if the microphone resource is not used by other services.
An obtaining unit 505, configured to obtain Audio data collected based on a microphone according to the Audio Record instance.
A second feedback unit 506, configured to feed back the audio data to the first service.
A second receiving unit 507, configured to receive a second recording request initiated by the first service, where the second recording request is used to instruct to stop recording.
A first stopping unit 508, configured to stop recording according to the second recording request if the terminal device does not need to provide microphone resources for other services.
A releasing unit 509, configured to release the microphone resource.
A second stopping unit 510, configured to stop copying the audio data for the first service according to the second recording request if the terminal device needs to provide microphone resources for another service.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
There is also provided, in accordance with an embodiment of the present application, a computer program product, including: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
Fig. 6 is a block diagram of an electronic device for calling a microphone resource according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). One processor 601 is illustrated in fig. 6.
The memory 602 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the method for invoking microphone resources provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the method of calling microphone resources provided herein.
The memory 602, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the calling method of the microphone resource in the embodiments of the present application. The processor 601 executes various functional applications of the server and data processing, i.e., implementing the calling method of the microphone resource in the above method embodiment, by running the non-transitory software programs, instructions and modules stored in the memory 602.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device of the calling method of the microphone resource, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 optionally includes memory located remotely from the processor 601, which may be connected over a network to the electronic device invoking the method of the microphone resource. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the calling method of the microphone resource may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603, and the output device 604 may be connected by a bus or other means, and are exemplified by being connected by a bus in fig. 6.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the method of invoking the microphone resource, such as a touch screen, keypad, mouse, track pad, touch pad, pointer stick, one or more mouse buttons, track ball, joystick, or like input device. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to another aspect of the embodiment of the present application, a terminal device is also provided in the embodiment of the present application.
Referring to fig. 7, fig. 7 is a schematic diagram of a terminal device according to an embodiment of the disclosure.
As shown in fig. 7, the terminal device 700 includes: an android operating system platform 701, a microphone resource multiplexing virtual layer 702, and an application program interface 703, wherein,
the application program interface 703 is configured to receive a first recording request initiated by the first service, where the first recording request is used to instruct recording based on the microphone resource.
In some embodiments, the application program interface 703 may include a virtual microphone control interface and a virtual microphone recording interface.
The virtual microphone recording interface may receive a first recording request initiated by a first service, that is, the virtual microphone recording interface may interact with the service, so as to receive the first recording request sent by any service, and a second recording request for instructing to stop recording.
The virtual microphone control interface may be used to switch different microphones. For example, if two microphones are provided on the terminal device, the virtual microphone control interface may be switched from one of the microphones to the other microphone.
With reference to the foregoing embodiment, it can be known that the first recording request may carry the recording parameter, the identifier, the attribute information, and the like of the first service, and accordingly, the virtual mike recording interface may obtain and record the recording parameter, the identifier, the attribute information, and the like of the first service carried in the first recording request.
And the microphone resource multiplexing virtual layer 702 is configured to, if the terminal device is in a state of providing microphone resources for the second service, copy the audio data acquired by providing the microphone resources for the second service to obtain copied audio data.
Wherein the audio data is acquired from the android operating system platform 701.
In some embodiments, the microphone resource multiplexing virtual layer 702 may include a service registration management unit, a basic configuration management unit, a recording policy management unit, a data cache management unit, and a resampling unit.
The virtual microphone recording interface can send the recording parameters to the service registration management unit.
The service registration management unit acquires the recording parameter of the first service (the recording parameter is stored when the first service is registered for the first time) from the basic configuration management unit, and if the recording parameter provided by the virtual microphone recording interface is the same as the recording parameter stored in the basic configuration management unit, the service registration management unit applies for creating an Audio Record instance from the recording strategy management unit.
The recording strategy management unit creates an Audio Record instance, acquires Audio data from an android operating system platform according to the Audio Record instance, and stores the Audio data to the data cache management unit.
And if the first service and the second service both need to use the microphone resource, the recording strategy management unit copies the audio data in the data cache management unit.
And the resampling unit is used for resampling the copied audio data based on the recording parameter of the first service to obtain resampled data, and sending the resampled data to the application program interface, and the application program interface is used for sending the resampled data to the first service.
The recording strategy management unit can also be used for releasing the resources of the microphone and the android operating system platform.
The application program interface 701 is configured to feed back the copied audio data to the first service.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (11)
1. A calling method of microphone resources is applied to terminal equipment, a plurality of services are arranged in the terminal equipment, each service can use the microphone resources of the terminal equipment through a recording request, and the calling method comprises the following steps:
receiving a first recording request initiated by a first service, wherein the first recording request is used for indicating recording based on the microphone resource;
if the terminal equipment is in a state of providing microphone resources for a second service, copying audio data acquired by providing the microphone resources for the second service to obtain copied audio data;
and feeding back the copied audio data to the first service.
2. The method of claim 1, wherein the first recording request carries recording parameters, and feeding back the copied audio data to the first service includes:
and resampling the copied audio data according to the recording parameters of the first service to obtain resampled data, and feeding back the resampled data to the first service.
3. The method of claim 1, wherein the first recording request carries an identifier of the first service, and feeding back the copied audio data to the first service includes:
and feeding back the copied audio data to the first service according to the identifier of the first service.
4. The method of claim 1, further comprising:
if the microphone resource is not used by other services, creating a recording according to the first recording request to realize an Audio Record instance;
and acquiring Audio data collected based on a microphone according to the Audio Record example, and feeding back the Audio data to the first service.
5. The method of claim 1, further comprising:
receiving a second recording request initiated by a first service, wherein the second recording request is used for indicating to stop recording;
and if the terminal equipment does not need to provide the microphone resources for other services, stopping recording according to the second recording request, and releasing the microphone resources.
6. The method of claim 5, further comprising:
and if the terminal equipment needs to provide the microphone resource for other services, stopping copying audio data for the first service according to the second recording request.
7. A calling device of microphone resources is applied to terminal equipment, a plurality of services are arranged in the terminal equipment, each service can use the microphone resources through a recording request, and the calling device comprises:
a first receiving unit, configured to receive a first recording request initiated by a first service, where the first recording request is used to instruct recording based on the microphone resource;
the copying unit is used for copying the audio data acquired by providing the microphone resource for the second service to obtain copied audio data if the terminal equipment is in a state of providing the microphone resource for the second service;
and the first feedback unit is used for feeding back the copied audio data to the first service.
8. An electronic device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the method of any one of claims 1 to 6.
9. A computer readable storage medium having stored therein computer executable instructions for implementing the method of any one of claims 1 to 6 when executed by a processor.
10. A computer program product comprising a computer program which, when executed by a processor, carries out the method of any one of claims 1 to 6.
11. A terminal device, comprising: an android operating system platform, a microphone resource multiplexing virtual layer, and an application program interface, wherein,
the application program interface is used for receiving a first recording request initiated by a first service, wherein the first recording request is used for indicating recording based on the microphone resource;
the microphone resource multiplexing virtual layer is used for copying audio data acquired by providing microphone resources for a second service to obtain copied audio data if the terminal equipment is in a state of providing the microphone resources for the second service, wherein the audio data is acquired from the android operating system platform;
and the application program interface is used for feeding back the copied audio data to the first service.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110325571.2A CN115134452A (en) | 2021-03-26 | 2021-03-26 | Calling method and device of microphone resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110325571.2A CN115134452A (en) | 2021-03-26 | 2021-03-26 | Calling method and device of microphone resources |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115134452A true CN115134452A (en) | 2022-09-30 |
Family
ID=83374966
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110325571.2A Pending CN115134452A (en) | 2021-03-26 | 2021-03-26 | Calling method and device of microphone resources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115134452A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3179472A1 (en) * | 2015-12-11 | 2017-06-14 | Sony Mobile Communications, Inc. | Method and device for recording and analyzing data from a microphone |
CN106897146A (en) * | 2017-02-09 | 2017-06-27 | 青岛海信移动通信技术股份有限公司 | The data processing method and the terminal with microphone of a kind of microphone of terminal |
CN106911831A (en) * | 2017-02-09 | 2017-06-30 | 青岛海信移动通信技术股份有限公司 | The data processing method and the terminal with microphone of a kind of microphone of terminal |
CN110097897A (en) * | 2019-04-02 | 2019-08-06 | 烽火通信科技股份有限公司 | A kind of Android device recording multiplexing method and system |
CN111381954A (en) * | 2018-12-27 | 2020-07-07 | 深圳市优必选科技有限公司 | Audio data recording method, system and terminal equipment |
-
2021
- 2021-03-26 CN CN202110325571.2A patent/CN115134452A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3179472A1 (en) * | 2015-12-11 | 2017-06-14 | Sony Mobile Communications, Inc. | Method and device for recording and analyzing data from a microphone |
CN106897146A (en) * | 2017-02-09 | 2017-06-27 | 青岛海信移动通信技术股份有限公司 | The data processing method and the terminal with microphone of a kind of microphone of terminal |
CN106911831A (en) * | 2017-02-09 | 2017-06-30 | 青岛海信移动通信技术股份有限公司 | The data processing method and the terminal with microphone of a kind of microphone of terminal |
US20180225080A1 (en) * | 2017-02-09 | 2018-08-09 | Hisense Mobile Communications Technology Co., Ltd. | Method and apparatus for processing data of a microphone of a terminal, and terminal |
CN111381954A (en) * | 2018-12-27 | 2020-07-07 | 深圳市优必选科技有限公司 | Audio data recording method, system and terminal equipment |
CN110097897A (en) * | 2019-04-02 | 2019-08-06 | 烽火通信科技股份有限公司 | A kind of Android device recording multiplexing method and system |
Non-Patent Citations (2)
Title |
---|
NOKIA CORPORATION: "S4-180462 \"On spatial metadata for IVAS spatial audio input format\"" * |
廖晶;: "基于Android录音软件实现及验证" * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109582472B (en) | Micro-service processing method and device | |
CN112291583B (en) | Live broadcast and microphone connecting method and device, server, terminal and storage medium | |
US11556380B2 (en) | Task execution method, apparatus, device and system, and storage medium | |
US9843667B2 (en) | Electronic device and call service providing method thereof | |
US9191417B2 (en) | Cross-process media handling in a voice-over-internet protocol (VOIP) application platform | |
US8855583B2 (en) | Communication system, communication terminal, server, communication method to be used therein and program therefor | |
CN103442032A (en) | Vehicle navigation method and system based on cloud service | |
JPWO2012023190A1 (en) | Communication terminal device, incoming call processing program, and incoming call processing method | |
CN109951560B (en) | Method, terminal and storage medium for improving concurrency and application speed of application service | |
CN113190362B (en) | Service calling method and device, computer equipment and storage medium | |
CN113377647B (en) | Page processing method, device, server, terminal and readable storage medium | |
CN114327087A (en) | Input event processing method and device, electronic equipment and storage medium | |
US20130343373A1 (en) | Voice-over-internet protocol (voip) application platform | |
CN114222003A (en) | Service calling method, system, device, equipment and storage medium | |
US20080140390A1 (en) | Solution for sharing speech processing resources in a multitasking environment | |
CN115134452A (en) | Calling method and device of microphone resources | |
CN112306685A (en) | Task isolation method and device, electronic equipment and computer readable medium | |
WO2020052392A1 (en) | Game platform capability invocation method and related product | |
KR102230266B1 (en) | Method and electronic device for sharing applications among a plurality of electronic devices | |
US20110131271A1 (en) | Apparatus and method for allocating and releasing imaging device in virtualization system | |
CN115629809A (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
WO2021168800A1 (en) | Data synchronization method and related product | |
CN111783643A (en) | Face recognition method and device, electronic equipment and storage medium | |
JP2020021484A (en) | Methods, systems and non-transitory computer-readable recording media for providing notification in multi-device environment | |
KR20150008945A (en) | Mobile terminal and operation method 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 |