Recording method and device, electronic equipment and readable storage medium

The electronic control unit allocates audio focus among multiple applications, solves the problem of audio focus preemption when multiple applications record simultaneously, realizes the function of sharing microphone resources for multiple applications, and improves the user experience.

CN119883176AActive Publication Date: 2025-04-25GREAT WALL MOTOR CO LTD

Patent Information

Application Number
CN202411916404.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-25
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

When multiple applications record simultaneously, it may lead to preemption of microphone audio focus, affecting the user experience.

Method used

When receiving the recording request, the electronic control unit determines whether the microphone is turned on by other applications and allocates the audio focus according to the category of the application, ensuring that multiple applications can share the microphone resources.

Benefits of technology

The function of recording multiple applications at the same time is realized, which improves the user experience and avoids application failures caused by audio focus preemption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883176A_ABST
    Figure CN119883176A_ABST
Patent Text Reader

Abstract

The invention provides a recording method and device, electronic equipment and a readable storage medium, the method is applied to the technical field of voice, and the method comprises the following steps: under the condition of receiving a recording request sent by a first application, if a microphone is started by a second application, determining whether the first application is a first type of application needing to occupy an audio focus; if the first application is the first type of application, determining whether the second application is a second type of application which does not need to occupy the audio focus; and if the second application is the second type of application, starting the recording permission of the first application, so that the first application and the second application jointly acquire audio data currently acquired by the microphone. According to the invention, multiple applications can share the microphone resource, so that the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of speech technology, and more specifically, to a recording method, device, electronic device and readable storage medium in the field of speech technology. Background Art

[0002] At present, recording functions may exist in different applications. If multiple applications are recording at the same time, the audio focus of the microphone may be occupied. For example, if a user needs to wake up a voice assistant while recording using navigation, the voice assistant may not be woken up. Therefore, a method that can ensure that multiple applications can record at the same time is urgently needed to improve the user experience. Summary of the invention

[0003] The present application provides a recording method, device, electronic device and readable storage medium, which can enable multiple applications to record simultaneously.

[0004] In a first aspect, a recording method is provided, the method comprising:

[0005] In the case of receiving a recording request sent by the first application, if the microphone is turned on by the second application, determining whether the first application is a first type of application that needs to occupy the audio focus;

[0006] If the first application is a first-category application, determining whether the second application is a second-category application that does not need to occupy the audio focus;

[0007] If the second application is a second type of application, the recording permission of the first application is enabled so that the first application and the second application can jointly obtain the audio data currently collected by the microphone.

[0008] In an embodiment of the present application, when the electronic control unit receives a recording request sent by a first application that needs to occupy the audio focus, it determines whether the microphone is turned on by a second application that does not need to occupy the audio focus. If the microphone is turned on by the second application that does not need to occupy the audio focus, the recording permission of the first application is enabled so that the first application can obtain the audio data currently collected by the microphone. In this way, after determining that the microphone is turned on by the second application that does not need to occupy the focus, the electronic control unit controls the activation of the recording permission of the first application, so that the first application and the second application can jointly use the audio data collected by the microphone, which can enable multiple applications to share microphone resources, thereby improving the user experience.

[0009] In combination with the first aspect, in some possible implementations, the method further includes:

[0010] Determine whether the first application needs to exclusively use the audio data collected by the microphone;

[0011] If the first application needs to exclusively use the audio data collected by the microphone, the recording permission of the second application is closed so that the second application stops obtaining the audio data collected by the microphone.

[0012] In an embodiment of the present application, after receiving a recording request sent by a first application and determining that the microphone has been turned on by a second application, if the electronic control unit determines that the first application needs to monopolize the audio data collected by the microphone, the recording permission of the second application is turned off, so that the second application stops obtaining the audio data collected by the microphone. Since voice calls have high security and real-time requirements, by turning off the recording permission of the second application, it can be ensured that the first application can instantly obtain the audio data collected by the microphone, thereby meeting the real-time requirements of voice calls. At the same time, turning off the recording permission of other applications can reduce the risk of call information leakage.

[0013] In conjunction with the first aspect, in some possible implementations, the audio data collected by the microphone is stored in the target storage space, and after the recording permission of the second application is disabled, the method further includes:

[0014] Determine a first address; wherein the first address is an address at which the second application reads audio data from the target storage space when the recording permission of the second application is disabled;

[0015] Determine a second address; wherein the second address is the address at which the first application starts to read audio data from the target storage space when the recording permission is enabled;

[0016] The audio data located between the first address and the second address is provided to the second application.

[0017] In the embodiment of the present application, after closing the recording permission of the second application, the electronic control unit determines the first address and the second address; and provides the second application with audio data between the first address and the second address, and the audio data between the first address and the second address refers to the audio data that the second application has not read before the recording permission is closed. In this way, after closing the recording permission of the second application, the second application will not immediately interrupt the service due to the closing of the recording permission, thereby improving the overall performance and flexibility of the vehicle-mounted system.

[0018] In conjunction with the first aspect, in some possible implementations, providing the second application with audio data located between the first address and the second address includes:

[0019] After the recording permission of the first application is disabled, re-enabling the recording permission of the second application;

[0020] The audio data located between the first address and the second address is provided to a second application with permission to restart recording.

[0021] In the embodiment of the present application, the electronic control unit reopens the recording permission of the second application after the recording permission of the first application is closed; and provides the audio data located between the first address and the second address to the second application that has resumed the recording permission. In this way, after the recording permission of the first application is closed, the recording permission of the second application is reopened, and the user does not need to reopen the second application; further, the second application can continue to process the unread audio data, avoiding the loss and repeated processing of audio data.

[0022] In conjunction with the first aspect, in some possible implementations, the audio data collected by the microphone is stored in the target storage space, and after enabling the recording permission of the first application, the method further includes:

[0023] Determine a real-time read address when the first application reads audio data from the target storage space;

[0024] When there is a deviation between the real-time storage address and the real-time read address, the real-time read address is corrected according to the real-time storage address; wherein the real-time storage address is the address of the audio data stored in the target storage space at the current moment.

[0025] In an embodiment of the present application, by correcting the real-time read address when there is a deviation between the real-time storage address and the real-time read address, it can be ensured that the read audio data is always close to the latest stored audio data, avoiding audio lag problems caused by read delays, thereby improving the real-time experience of the application.

[0026] In combination with the first aspect, in some possible implementations, when there is a deviation between the real-time storage address and the real-time read address, correcting the real-time read address according to the real-time storage address includes:

[0027] Determining a reading speed when the first application reads the audio data from the target storage space;

[0028] Determine the storage speed when storing the audio data collected by the microphone into the target storage space;

[0029] When the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time reading address, the real-time storage address is used as the real-time reading address.

[0030] In an embodiment of the present application, when the real-time read address is much smaller than the real-time storage address, outdated data may be read, affecting the effect and real-time performance of audio processing. By timely correcting the read address, it is possible to ensure that the read audio data is always the latest, avoiding the generation of invalid data, thereby improving the real-time performance and reliability of the application's recording.

[0031] In combination with the first aspect, in some possible implementations, the target storage space is a ring storage space, and when the storage speed is greater than the read speed and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address, including:

[0032] When the storage speed is greater than the reading speed, determining the number of storage overflows and the number of reading overflows of the annular storage space after the recording permission of the first application is enabled;

[0033] If the number of storage overflows is greater than the number of read overflows, and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address.

[0034] In an embodiment of the present application, when the storage speed is faster than the reading speed, the electronic control unit can determine whether the reading address needs to be corrected by comparing the number of storage overflows and the number of read overflows, thereby effectively utilizing the storage space and ensuring that data will not be overwritten due to slow reading speeds, thereby avoiding the risk of memory waste and data loss.

[0035] In combination with the first aspect, in some possible implementations, correcting the real-time read address according to the real-time storage address includes:

[0036] Determining a reading speed when the first application reads the audio data from the target storage space;

[0037] Determine the storage speed when storing the audio data collected by the microphone into the target storage space;

[0038] When the reading speed is greater than the storage speed, the waiting time is determined according to the speed difference between the reading speed and the storage speed, and the first application is controlled to read the audio data from the target storage space after waiting for the waiting time.

[0039] In the embodiment of the present application, after the electronic control unit determines the reading speed and the storage speed, if the reading speed is greater than the storage speed, the waiting time is determined according to the speed difference between the reading speed and the storage speed, and the first application is controlled to read the audio data from the target storage space after waiting for the preset waiting time. In this way, when the reading speed is greater than the storage speed, the audio data may not be completely written to the storage space. By setting the waiting time before reading, it can be ensured that the data has been completely stored when reading, avoiding reading incomplete or inconsistent data, thereby ensuring the integrity and accuracy of the data.

[0040] In a second aspect, a recording device is provided, the device comprising:

[0041] A first determination module is used to determine whether the first application needs to occupy the audio focus if it is determined that the microphone is turned on by the second application when a recording request sent by the first application is received;

[0042] A second determination module, configured to determine whether a second application needs to occupy the audio focus if the first application needs to occupy the audio focus;

[0043] The enabling module is used to enable the recording permission of the first application if the second application does not need to occupy the audio focus, so that the first application can obtain the audio data currently collected by the microphone.

[0044] In a third aspect, an electronic device is provided, comprising a memory for storing executable program code;

[0045] The processor is used to call and run the executable program code from the memory, so that the electronic device executes the method in any possible implementation manner of the first aspect above.

[0046] In a fourth aspect, an executable program code product is provided, the executable program code product comprising: an executable program code, when the executable program code is run on a computer, the computer executes the method in any possible implementation of the first aspect above.

[0047] In a fifth aspect, a readable storage medium is provided, which stores executable program code. When the executable program code runs on a computer, the computer executes the method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a flowchart of a recording method provided by an embodiment of the present application;

[0049] Figure 2 It is a structural schematic diagram of a ring storage space provided in an embodiment of the present application;

[0050] Figure 3 is a flowchart of a recording method provided by an embodiment of the present application;

[0051] Figure 4 It is a structural schematic diagram of a recording device provided in an embodiment of the present application;

[0052] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0054] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0055] At present, with the continuous development of smart devices, the recording function has become an indispensable part of many applications. However, when multiple applications use the microphone for recording at the same time, it may cause the problem of audio focus preemption. For example, while the user is using the navigation application to record voice commands, he may need to wake up the voice assistant to perform other tasks. In this case, since the navigation application requires audio focus, and waking up the voice assistant also requires audio focus, the voice assistant may not be successfully woken up, resulting in a poor user experience.

[0056] In order to solve the above technical problems, an embodiment of the present application provides a recording method, which can be executed by an electronic control unit (Electronic Control Unit, ECU) for controlling an audio system. The electronic control unit can determine whether the microphone is turned on by the second application that does not need to occupy the audio focus when receiving a recording request sent by the first application that needs to occupy the audio focus. If the microphone is turned on by the second application that does not need to occupy the audio focus, the recording permission of the first application is enabled so that the first application can obtain the audio data currently collected by the microphone. In this way, after determining that the microphone is turned on by the second application that does not need to occupy the audio focus, the electronic control unit controls the opening of the recording permission of the first application, so that the first application and the second application can jointly use the audio data collected by the microphone, which is conducive to multiple applications to share microphone resources, thereby improving the user experience.

[0057] See also Figure 1 , Figure 1 is a flowchart of the steps of a recording method provided by an embodiment of the present application. The execution subject of the method may be an electronic control unit, such as Figure 1 As shown, the method may include the following steps.

[0058] S101, when receiving a recording request sent by a first application, if the microphone is turned on by a second application, determining whether the first application is a first type of application that needs to occupy audio focus.

[0059] S102: If the first application is a first-category application, determine whether the second application is a second-category application that does not need to occupy the audio focus.

[0060] S103: If the second application is a second type of application, enable the recording permission of the first application, so that the first application and the second application can jointly obtain the audio data currently collected by the microphone.

[0061] The recording request refers to a request sent by the first application, which is used to request to enable the access permission of the microphone for recording operation.

[0062] Audio focus is used to manage the priority of multiple real-time applications during recording. For applications with higher real-time requirements, such as real-time calls, users need to hear the other party's voice in real time, and their own voice also needs to be transmitted to the other party in real time. Therefore, applications with higher real-time requirements need to occupy the audio focus to ensure that only one real-time application controls the microphone at the same time. Correspondingly, for applications with lower real-time requirements, such as map navigation, the real-time requirements for audio are lower. These applications can tolerate certain delays or interruptions, so they do not need to apply for audio focus. Even when sharing microphone resources with applications with higher real-time requirements, these applications will not have a significant impact on the user experience.

[0063] Taking vehicles as an example, during the R&D and design stage, developers can divide the applications on the vehicle system into the first category, the second category, the third category and the fourth category. The first category refers to high-real-time applications that need to occupy the audio focus when recording and can share the microphone with other applications that do not need to occupy the audio focus. They may include but are not limited to Voice over Internet Protocol (VoIP) and voice assistants. The second category refers to non-real-time applications that do not need to occupy the audio focus when recording and can share the microphone with other applications. They may include but are not limited to map navigation and multimedia playback. The third category refers to real-time applications that need to occupy the audio focus when recording and do not share the microphone with other applications, including voice calls. The fourth category refers to non-real-time applications that do not need to occupy the audio focus when recording and do not share the microphone with other applications.

[0064] For example, different types of applications have different requirements and priorities for microphone resources. For the first type of application, such as network voice calls, although it is necessary to occupy the audio focus to ensure the continuity of the call, it can share microphone resources with applications that do not need to occupy the audio focus and have low real-time requirements (such as map navigation). This is because although network voice calls have certain requirements for real-time, compared with completely monopolizing microphone resources, network voice calls pay more attention to the continuity and stability of calls. When sharing microphone resources with other applications, network voice call applications can deal with possible interference through appropriate buffering and delay processing to maintain call quality. For the second type of application, such as map navigation, microphone resources are usually only needed for a short time at a specific moment (such as when the user enters a voice command). Most of the time, it is not necessary to monopolize the microphone, so microphone resources can be shared with other applications, thereby improving resource utilization, allowing users to run multiple applications at the same time without encountering obvious conflicts or performance degradation. For the third type of application (such as high-quality voice calls), it is necessary to monopolize microphone resources to ensure the real-time and clarity of audio. These applications have extremely high requirements for audio quality, and any slight interference or delay may affect the user experience. In this case, exclusive microphone resources can minimize external interference and ensure the integrity and clarity of the audio signal.

[0065] In one embodiment, when the first application needs to record, a recording request can be sent to the electronic control unit. After receiving the recording request, the electronic control unit determines whether the microphone has been turned on by the second application. If the microphone is turned on by the second application, the electronic control unit determines whether the first application needs to occupy the audio focus. After determining that the first application needs to occupy the audio focus, the electronic control unit also determines whether the second application needs to occupy the audio focus. After determining that the second application does not need to occupy the audio focus, the electronic control unit can allocate the audio focus to the first application and enable the recording permission of the first application, so that the first application obtains the audio data of the second application currently collected by the microphone.

[0066] For example, taking a vehicle as an example, during the operation of the vehicle, when the driver needs to use the Internet voice phone to make a call, a recording request can be sent to the electronic control unit. After receiving the recording request, the electronic control unit determines that the microphone has been turned on by the map navigation at the current moment, that is, the driver is inputting voice instructions to the map navigation through the microphone. Then, the electronic control unit determines that the Internet voice phone needs to occupy the audio focus for the call, while the map navigation does not need to occupy the audio focus for recording. Therefore, the electronic control unit can assign the audio focus to the Internet voice phone and turn on the recording permission of the Internet voice phone, allowing the Internet voice phone to obtain the audio data currently collected by the microphone, so that the map navigation and the Internet voice phone can perform recording operations at the same time.

[0067] In another embodiment, after receiving the recording request sent by the first application, the electronic control unit determines that the microphone has been turned on by the second application. After that, the electronic control unit determines whether the first application needs to occupy the audio focus. After determining that the first application needs to occupy the audio focus, it also determines whether the second application needs to occupy the audio focus. If it is determined that the second application needs to occupy the audio focus, the electronic control unit can determine which application to assign the audio focus to based on the priority of the first application and the second application. For example, if the priority of the first application is higher than that of the second application, the recording permission of the second application is turned off so that the second application stops obtaining the audio data collected by the microphone; at the same time, the audio focus is assigned to the first application, and the recording permission of the first application is turned on.

[0068] In another embodiment, after receiving the recording request sent by the first application, the electronic control unit determines whether the microphone has been turned on by the second application. If the electronic control unit determines that the microphone is not turned on at the current moment, the electronic control unit determines whether the first application needs to occupy the audio focus. If the first application needs to occupy the audio focus, the electronic control unit allocates the audio focus to the first application and turns on the recording permission of the first application so that the first application uses the microphone for recording.

[0069] On the contrary, if the first application does not need to occupy the audio focus, the electronic control unit does not need to allocate the audio focus to the first application, and directly calls the recording interface to enable the recording permission of the first application so that the first application uses the microphone for recording.

[0070] In another embodiment, after receiving the recording request sent by the first application, the electronic control unit determines whether the microphone has been turned on by the second application. If the microphone is turned on by the second application, the electronic control unit determines whether the first application needs to occupy the audio focus. After the electronic control unit determines that the first application does not need to occupy the audio focus, it can determine whether the second application needs to monopolize the audio focus of the microphone. If it is determined that the second application needs to monopolize the audio focus of the microphone, the first application is controlled to wait. After closing the recording permission of the second application and releasing the audio focus, the recording permission of the first application is turned on. If it is determined that the second application does not need to monopolize the audio focus of the microphone, the recording permission of the first application is directly turned on so that the first application can obtain the audio data of the second application currently collected by the microphone.

[0071] In an embodiment of the present application, when the electronic control unit receives a recording request sent by a first application that needs to occupy the audio focus, it determines whether the microphone is turned on by a second application that does not need to occupy the audio focus. If the microphone is turned on by the second application that does not need to occupy the audio focus, the recording permission of the first application is enabled so that the first application can obtain the audio data currently collected by the microphone. In this way, after determining that the microphone is turned on by the second application that does not need to occupy the focus, the electronic control unit controls the activation of the recording permission of the first application, so that the first application and the second application can jointly use the audio data collected by the microphone, which is conducive to multiple applications being able to share microphone resources, thereby improving the user experience.

[0072] Optionally, the recording method may further include the following steps.

[0073] Determine whether the first application needs to exclusively use the audio data collected by the microphone;

[0074] If the first application needs to exclusively use the audio data collected by the microphone, the recording permission of the second application is closed so that the second application stops obtaining the audio data collected by the microphone.

[0075] In one embodiment, after receiving a recording request sent by a first application and determining that the microphone has been turned on by a second application, the electronic control unit determines whether the first application is a third-category application that needs to exclusively use the audio data collected by the microphone; if the first application needs to exclusively use the audio data collected by the microphone, the electronic control unit closes the recording permission of the second application to stop the second application from obtaining the audio data collected by the microphone.

[0076] Furthermore, the electronic control unit allocates an audio focus to the first application, and enables the recording permission of the first application, so that the first application uses the microphone for recording operations.

[0077] Exemplarily, taking a vehicle as an example, during the operation of the vehicle, when the driver uses a voice phone to make a call, a recording request can be sent to the electronic control unit. After the electronic control unit receives the request and determines that the microphone has been turned on by the map navigation. The electronic control unit determines that the voice phone needs to exclusively occupy the audio focus, that is, to exclusively occupy the audio data collected by the microphone for the call. Therefore, the electronic control unit turns off the recording permission of the map navigation so that the map navigation stops using the microphone. Furthermore, the electronic control unit can assign the audio focus to the voice phone and turn on the recording permission of the voice phone, thereby allowing the voice phone to use the microphone for calls.

[0078] In another embodiment, after receiving a recording request sent by a first application and determining that the microphone has been turned on by a second application, the electronic control unit determines whether the first application is a third-category application that needs to exclusively use the audio data collected by the microphone; if the first application needs to exclusively use the audio data collected by the microphone, it also determines whether the second application needs to exclusively use the audio data collected by the microphone. After determining that the second application needs to exclusively use the audio data collected by the microphone, the electronic control unit can determine which application to assign the audio focus to based on the priority of the first application and the second application. For example, if the priority of the first application is higher than that of the second application, the recording permission of the second application is turned off so that the second application stops obtaining the audio data collected by the microphone; at the same time, the audio focus is assigned to the first application, and the recording permission of the first application is turned on.

[0079] On the contrary, if the first application needs to exclusively use the audio data collected by the microphone, and at the same time determines that the second application does not need to exclusively use the audio data collected by the microphone, the electronic control unit closes the recording permission of the second application to stop the second application from obtaining the audio data collected by the microphone.

[0080] In an embodiment of the present application, after receiving a recording request sent by a first application and determining that the microphone has been turned on by a second application, if the electronic control unit determines that the first application needs to monopolize the audio data collected by the microphone, the recording permission of the second application is turned off, so that the second application stops obtaining the audio data collected by the microphone. Since voice calls have high security and real-time requirements, by turning off the recording permission of the second application, it can be ensured that the first application can instantly obtain the audio data collected by the microphone, thereby meeting the real-time requirements of voice calls. At the same time, turning off the recording permission of other applications can reduce the risk of call information leakage.

[0081] Optionally, the audio data collected by the microphone is stored in the target storage space, and after the recording permission of the second application is disabled, the method further includes:

[0082] Determine a first address; wherein the first address is an address at which the second application reads audio data from the target storage space when the recording permission of the second application is disabled;

[0083] Determine a second address; wherein the second address is the address at which the first application starts to read audio data from the target storage space when the recording permission is enabled;

[0084] The audio data located between the first address and the second address is provided to the second application.

[0085] The target storage space refers to a storage space for storing audio data collected by a microphone. The audio data between the first address and the second address refers to audio data that the second application does not read when the recording permission is disabled.

[0086] In one embodiment, after the electronic control unit turns off the recording permission of the second application, it can determine the first address when the second application reads the audio data from the target storage space when the recording permission of the second application is turned off; further, after the recording permission of the first application is turned on, it can determine the second address when the first application reads the audio data from the target storage space. Afterwards, the electronic control unit sends the audio data between the first address and the second address to the second application, so that after the recording permission of the second application is turned off, the audio data not read by the second application in the target storage space can still be obtained.

[0087] For example, taking a vehicle as an example, during the operation of the vehicle, the driver uses the navigation application of the vehicle system to plan the route and inputs the destination information to the navigation application through voice commands. However, before the voice command input is completed, the recording permission of the navigation application is turned off because the voice call has enabled the recording permission. After the recording permission of the navigation application is turned off, the electronic control unit determines the location of the last audio data read by the navigation application in the target storage space, that is, the first address. After that, after the recording permission of the voice call is enabled, the electronic control unit determines the location where the voice call starts to read the audio data from the target storage space, that is, the second address. In order to ensure that the navigation application will not be immediately interrupted due to the closure of the recording permission, the electronic control unit can send the audio data between the first address and the second address to the navigation application. In this way, the navigation application can continue to process the unread audio data, thereby completing the input of the destination information.

[0088] In the embodiment of the present application, after closing the recording permission of the second application, the electronic control unit determines the first address and the second address; and provides the second application with audio data between the first address and the second address, and the audio data between the first address and the second address refers to the audio data that the second application has not read before the recording permission is closed. In this way, after closing the recording permission of the second application, the second application will not immediately interrupt the service due to the closing of the recording permission, thereby improving the overall performance and flexibility of the vehicle-mounted system.

[0089] Optionally, providing the second application with audio data located between the first address and the second address includes:

[0090] After the recording permission of the first application is disabled, re-enabling the recording permission of the second application;

[0091] The audio data located between the first address and the second address is provided to a second application with permission to restart recording.

[0092] In this embodiment, after determining that the recording permission of the first application is closed, the electronic control unit reopens the recording permission of the second application; and provides the audio data located between the first address and the second address to the second application that has resumed recording permission.

[0093] For example, taking a vehicle as an example, during the operation of the vehicle, since the voice phone has enabled the recording permission, the recording permission of the navigation application needs to be turned off. After the recording permission of the navigation application is turned off, the electronic control unit will determine the first address and the second address, and record the first address and the second address at the same time. Afterwards, after determining that the recording permission of the first application is turned off, the electronic control unit will reopen the recording permission of the navigation application and send the audio data between the first address and the second address to the navigation application. In this way, the navigation application can continue to process the unread audio data, thereby completing the input of the destination information.

[0094] In the embodiment of the present application, the electronic control unit reopens the recording permission of the second application after the recording permission of the first application is closed; and provides the audio data located between the first address and the second address to the second application that has resumed the recording permission. In this way, after the recording permission of the first application is closed, the recording permission of the second application is reopened, and the user does not need to reopen the second application; further, the second application can continue to process the unread audio data, avoiding the loss and repeated processing of audio data.

[0095] Optionally, the audio data collected by the microphone is stored in the target storage space. After enabling the recording permission of the first application, the method further includes:

[0096] Determine a real-time read address when the first application reads audio data from the target storage space;

[0097] When there is a deviation between the real-time storage address and the real-time read address, the real-time read address is corrected according to the real-time storage address.

[0098] The real-time storage address is the address of the audio data stored in the target storage space at the current moment; the real-time read address is the address of the audio data read from the target storage space at the current moment.

[0099] In one embodiment, the target storage space may include a storage pointer and a read pointer. After the electronic control unit turns on the recording permission of the first application, it uses the microphone to perform a recording operation, and stores the audio data collected by the microphone in the target storage space, and determines the real-time storage address according to the storage pointer. The electronic control unit can read the audio data from the target storage space and determine the real-time read address according to the read pointer. Afterwards, the electronic control unit can compare the real-time storage address with the real-time read address. If there is a deviation between the real-time storage address and the real-time read address, and the deviation between the two is greater than the preset deviation, the real-time storage address is used as the real-time read address.

[0100] Exemplarily, assuming that the preset deviation between the real-time storage address and the real-time read address is 50 bytes; after opening the recording permission of the first application, the electronic control unit stores the audio data collected by the microphone in the target storage space, and determines that the real-time storage address is 100 bytes. At the same time, the audio data is read from the target storage space, and the real-time read address is determined to be 20 bytes. The electronic control unit can calculate that the difference between the real-time storage address and the real-time read address is 80 bytes, which is greater than the preset deviation of 50 bytes, indicating that the reading speed is slow, and the real-time read address needs to be corrected. Therefore, the real-time storage address of 100 bytes is used as the real-time read address, that is, the read pointer continues to read the audio data from 100 bytes, and the audio data between the real-time storage address and the real-time read address is discarded.

[0101] In another exemplary embodiment, the electronic control unit determines that the real-time storage address is 100 bytes. At the same time, the audio data is read from the target storage space, and the real-time read address is determined to be 60 bytes. The electronic control unit can calculate that the difference between the real-time storage address and the real-time read address is 40 bytes, which is less than the preset deviation of 50 bytes. Therefore, there is no need to correct the real-time read address, that is, the read pointer continues to read the audio data from 60 bytes.

[0102] In another embodiment, after determining the real-time storage address and the real-time read address, the electronic control unit determines the deviation between the real-time storage address and the real-time read address. If the deviation between the real-time storage address and the real-time read address is greater than a preset deviation and the real-time storage address is before the real-time read address, that is, the real-time storage address is larger than the real-time read address, the real-time storage address is used as the real-time read address.

[0103] In the embodiment of the present application, after the electronic control unit enables the recording permission of the first application, it determines the real-time reading address and the real-time storage address when the first application reads the audio data; when there is a deviation between the real-time storage address and the real-time reading address, the real-time storage address is used as the real-time reading address. In this way, by correcting the real-time reading address when there is a deviation between the real-time storage address and the real-time reading address, it can be ensured that the read audio data is always close to the latest stored audio data, avoiding the audio lag problem caused by the reading delay, thereby improving the real-time experience of the application.

[0104] Optionally, when there is a deviation between the real-time storage address and the real-time read address, correcting the real-time read address according to the real-time storage address includes:

[0105] Determining a reading speed when the first application reads the audio data from the target storage space;

[0106] Determine the storage speed when storing the audio data collected by the microphone into the target storage space;

[0107] When the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time reading address, the real-time storage address is used as the real-time reading address.

[0108] The read speed refers to the rate at which the first application reads audio data from the target storage space, usually expressed in bytes per second. The storage speed refers to the rate at which the audio data collected by the microphone is written to the target storage space, usually expressed in bytes per second.

[0109] In one embodiment, after determining that there is a deviation between the real-time storage address and the real-time read address, the electronic control unit can determine the reading speed when the first application reads the audio data from the target storage space; and at the same time determine the storage speed when the audio data collected by the microphone is stored in the target storage space. Afterwards, the electronic control unit can compare the reading speed with the storage speed, and if the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address.

[0110] Exemplarily, assume that the real-time storage address and the real-time read address at the previous moment are both 0; at the current moment, the electronic control unit determines that the storage speed when storing the audio data collected by the microphone in the target storage space is 100 bytes / second; that is, the real-time storage address is 100 bytes. The electronic control unit determines that the reading speed when the first application reads the audio data from the target storage space is 60 bytes / second; that is, the real-time read address is 60 bytes. Afterwards, when the electronic control unit determines that the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time read address, it indicates that the reading speed is too slow, and the real-time read address needs to be corrected, and the real-time storage address of 100 bytes is used as the real-time read address, that is, the read pointer continues to read the audio data from 100 bytes, and the audio data between the real-time storage address and the real-time read address is discarded.

[0111] In another embodiment, after determining that there is a deviation between the real-time storage address and the real-time read address, the electronic control unit can determine the reading speed when the first application reads the audio data from the target storage space; and at the same time determine the storage speed when storing the audio data collected by the microphone in the target storage space. Afterwards, the electronic control unit can compare the reading speed with the storage speed to determine whether the storage speed is greater than the reading speed, and whether the difference between the storage speed and the reading speed is greater than a preset speed difference; further, the electronic control unit can determine whether the deviation between the real-time storage address and the real-time read address is greater than a preset deviation. If the difference between the storage speed and the reading speed is greater than the preset speed difference, and the deviation between the real-time storage address and the real-time read address is greater than the preset deviation, the real-time storage address is used as the real-time read address.

[0112] Exemplarily, the preset deviation is 80 bytes; the preset speed difference is 50 bytes / second; assuming that the real-time storage address at the previous moment is 100 bytes and the real-time read address is 60 bytes; at the current moment, the electronic control unit determines that the storage speed when storing the audio data collected by the microphone in the target storage space is 100 bytes / second; that is, the real-time storage address is 200 bytes. The electronic control unit determines that the reading speed when the first application reads the audio data from the target storage space is 40 bytes / second; that is, the real-time read address is 100 bytes. Afterwards, the electronic control unit determines that the deviation between the real-time storage address and the real-time read address at the current moment is 100 bytes, which is greater than the preset deviation of 80 bytes. In addition, the difference between the storage speed and the read speed is 60 bytes / second, which is greater than the preset speed difference of 50 bytes / second. Therefore, the electronic control unit needs to correct the real-time read address and use the real-time storage address 200 bytes as the real-time read address, that is, the read pointer continues to read the audio data from 200 bytes, and the audio data between the real-time storage address 200 bytes and the real-time read address 100 bytes are discarded.

[0113] In the embodiment of the present application, the electronic control unit can determine the reading speed and the storage speed; and when the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time reading address, the real-time storage address is used as the real-time reading address. In this way, when the real-time reading address is much smaller than the real-time storage address, outdated data may be read, affecting the effect and real-time performance of audio processing. By timely correcting the reading address, it can ensure that the read audio data is always the latest, avoiding the generation of invalid data, thereby improving the real-time performance and reliability of the recording of the application.

[0114] Optionally, the target storage space is a ring storage space, and when the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time reading address, the real-time storage address is used as the real-time reading address, including:

[0115] When the storage speed is greater than the reading speed, determining the number of storage overflows and the number of reading overflows of the annular storage space after the recording permission of the first application is enabled;

[0116] If the number of storage overflows is greater than the number of read overflows, and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address.

[0117] The annular storage space refers to a circular storage structure that is connected end to end and can store audio data in a space of a fixed size. When the storage space is full, new data will overwrite the earliest stored data, and the cycle will continue.

[0118] The number of storage overflows refers to the number of times the real-time storage address passes through the starting address of the ring storage space, that is, the number of times the old data is overwritten when new data is written. The number of read overflows refers to the number of times the real-time read address passes through the starting address of the ring storage space.

[0119] See also Figure 2 , Figure 2 It is a structural diagram of a ring storage space provided in an embodiment of the present application; the storage space is arranged in a ring form, connected end to end, to form a loop structure. When the ring storage space is of fixed size, the reuse of storage resources is achieved by overwriting old data. Exemplarily, the storage pointer A is used to indicate the storage position of the audio data, and it moves continuously as the data is written. When the storage pointer A reaches the boundary B of the ring storage space, it will automatically reset to the starting position to achieve cyclic writing, and the number of storage overflows will increase by 1. The read pointer H is used to indicate the reading position of the audio data. As the data is read, it moves continuously. When the read pointer H reaches the boundary B of the ring storage space, it will also reset to the starting position to achieve cyclic reading, and the number of read overflows will increase by 1.

[0120] After being collected by the microphone, the audio data is stored in the circular storage space, and the storage operation is controlled by the storage pointer A. When the application needs to process the audio data, it starts reading from the position indicated by the read pointer H, and the reading operation is controlled by the read pointer H. When the storage pointer A is greater than the read pointer H, it indicates that the audio data is backlogged, and the reading progress can be adjusted by correcting the pointer H.

[0121] In the research and development design stage, the researchers can reasonably design the size of the annular storage space according to actual needs, so as to avoid taking up too much memory and realize efficient reuse. Exemplarily, the researchers can calculate the amount of audio data that needs to be stored in 1 second through audio parameters, and the audio parameters may include but are not limited to sampling rate, number of channels, bit depth, etc. For example, if the sampling rate is 16000, single channel, and bit depth is 16 bits, the amount of audio data that needs to be stored in 1 second is 32000 bytes (32KB). If the sampling rate is 48000, dual channels, and bit depth is 16 bits, the amount of audio data that needs to be stored in 1 second is 192000 bytes (192KB). Therefore, the annular storage space can be designed to store about 30 seconds of audio data, and the data volume ranges between 937.5KB and 5625KB. The specific size can be adjusted according to actual needs, and this is not limited.

[0122] In this embodiment, when the electronic control unit determines that the storage speed is greater than the read speed, it can determine the number of storage overflows and the number of read overflows of the annular storage space after the recording permission of the first application is enabled. Afterwards, the electronic control unit can compare the number of storage overflows and the number of read overflows, and when the number of storage overflows is greater than the number of read overflows and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address.

[0123] Exemplarily, after the electronic control unit determines that the storage speed is greater than the reading speed, after starting the recording permission of the first application, the electronic control unit starts to monitor the number of storage overflows and the number of read overflows. Assuming that at the current moment, the electronic control unit determines that the number of storage overflows is 2 times and the number of read overflows is 0 times, that is, the storage pointer A has bypassed the annular storage space boundary 2 times, and the read pointer H has bypassed the annular storage space boundary 0 times, indicating that the speed of reading data is slow, and the real-time storage address 200 bytes is greater than the real-time read address 50 bytes, then the electronic control unit will correct the real-time read address and use the real-time storage address 200 bytes as the real-time read address, that is, the read pointer continues to read audio data from 200 bytes, and the audio data between the real-time storage address 200 bytes and the real-time read address 50 bytes is discarded.

[0124] In the embodiment of the present application, when the storage speed is greater than the reading speed, the electronic control unit determines the number of storage overflows and the number of read overflows of the annular storage space after the recording permission of the first application is enabled; if the number of storage overflows is greater than the number of read overflows, and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address. In this way, when the storage speed is faster than the reading speed, the electronic control unit can determine whether the read address needs to be corrected by comparing the number of storage overflows and the number of read overflows, thereby effectively utilizing the storage space, ensuring that the data will not be overwritten due to the slow reading speed, and avoiding the risk of memory waste and data loss.

[0125] Optionally, correcting the real-time read address according to the real-time storage address includes:

[0126] Determining a reading speed when the first application reads the audio data from the target storage space;

[0127] Determine the storage speed when storing the audio data collected by the microphone into the target storage space;

[0128] When the reading speed is greater than the storage speed, the waiting time is determined according to the speed difference between the reading speed and the storage speed, and the first application is controlled to read the audio data from the target storage space after waiting for the waiting time.

[0129] The waiting time is proportional to the speed difference between the reading speed and the storage speed.

[0130] In one embodiment, the electronic control unit can periodically determine the reading speed and the storage speed according to a preset time length, and compare the reading speed and the storage speed. When the reading speed is greater than the storage speed, the speed difference between the reading speed and the storage speed is calculated. The electronic control unit can then determine a target difference interval in which the speed difference between the reading speed and the storage speed is located from a plurality of preset difference intervals; wherein the plurality of difference intervals correspond to different waiting times. The electronic control unit can control the first application to read the audio data from the target storage space after waiting for the preset waiting time according to the preset waiting time corresponding to the target difference interval.

[0131] Among them, developers can pre-configure multiple difference intervals, and pre-configure waiting times corresponding to different difference intervals for the vehicle. For example, when the speed difference between the reading speed and the storage speed is greater than 10 bytes / second and less than 30 bytes / second, the current speed difference is determined to be the first difference interval; when the speed difference between the reading speed and the storage speed is greater than or equal to 30 bytes / second and less than 60 bytes / second, the current speed difference is determined to be the second difference interval; when the speed difference is greater than 60 bytes / second, the current speed difference is determined to be the third difference interval. Further, when the speed difference is in the first difference interval, the waiting time is determined to be 10ms; when the speed difference is in the second difference interval, the waiting time is determined to be 15ms; when the speed difference is in the third difference interval, the waiting time is determined to be 20ms.

[0132] For example, the electronic control unit determines that the reading speed is 100 bytes / second and the storage speed is 50 bytes / second, and compares the reading speed with the storage speed to determine that the reading speed is greater than the storage speed, and calculates the speed difference between the reading speed and the storage speed as 50 bytes / second, determines that the current speed difference is the second difference interval, and determines that the waiting time corresponding to the second difference interval is 15ms. Afterwards, the electronic control unit can control the first application to read the audio data from the target storage space after waiting for 15ms.

[0133] It should be noted that the developer can determine the waiting time of the first application based on a pre-set experiment, and the comparison is not limited.

[0134] In the embodiment of the present application, after the electronic control unit determines the reading speed and the storage speed, if the reading speed is greater than the storage speed, the waiting time is determined according to the speed difference between the reading speed and the storage speed, and the first application is controlled to read the audio data from the target storage space after waiting for the preset waiting time. In this way, when the reading speed is greater than the storage speed, the audio data may not be completely written to the storage space. By setting the waiting time before reading, it can be ensured that the data has been completely stored when reading, avoiding reading incomplete or inconsistent data, thereby ensuring the integrity and accuracy of the audio data.

[0135] See also Figure 3 , Figure 3 is a flowchart of a recording method provided by an embodiment of the present application, such as Figure 3 As shown, the method may include the following steps.

[0136] S301: Receive a recording request sent by a first application.

[0137] S302, determining whether the microphone is turned on by the second application, if so, executing step S303; otherwise, executing step S307.

[0138] S303, determine whether the first application needs to occupy the audio focus; if so, execute step S304; otherwise, execute step S307.

[0139] S304, determining whether the first application needs to exclusively use the audio data collected by the microphone; if so, executing step S305; otherwise, executing step S306.

[0140] S305: Disable the recording permission of the second application.

[0141] Among them, after closing the recording permission of the second application, the electronic control unit can make the second application stop obtaining the audio data collected by the microphone.

[0142] S306, determining whether the second application needs to occupy the audio focus; if so, executing step S308; otherwise, executing step S307.

[0143] S307: Enable the recording permission of the first application.

[0144] Among them, after the electronic control unit enables the first application to obtain the audio data currently collected by the microphone, the first application can obtain the audio data currently collected by the microphone.

[0145] S308: After disabling the recording permission of the second application, allocating audio focus to the first application, and enabling the recording permission of the first application.

[0146] It should be noted that the achievable methods and technical effects of each step in the embodiments of the present application can refer to the relevant contents in the above embodiments and will not be repeated here.

[0147] See also Figure 4 , Figure 4 It is a structural diagram of a recording device provided in an embodiment of the present application. The recording device can be arranged in an electronic control unit and can include: a first determination module 401, a second determination module 402 and an opening module 403.

[0148] A first determination module 401 is used to determine whether the first application is a first type of application that needs to occupy the audio focus if the microphone is turned on by the second application when a recording request sent by the first application is received;

[0149] A second determination module 402 is used to determine whether the second application is a second application that does not need to occupy the audio focus if the first application is a first application;

[0150] The enabling module 403 is used to enable the recording permission of the first application if the second application is a second type of application, so that the first application and the second application can jointly obtain the audio data currently collected by the microphone.

[0151] Optionally, the recording device further includes: a third determination module and a closing module;

[0152] A third determination module, used to determine whether the first application needs to exclusively use the audio data collected by the microphone;

[0153] The closing module is used to close the recording permission of the second application if the first application needs to exclusively use the audio data collected by the microphone, so that the second application stops obtaining the audio data collected by the microphone.

[0154] Optionally, the audio data collected by the microphone is stored in the target storage space, and the closing module is specifically used to determine a first address; wherein the first address is the address at which the second application reads audio data from the target storage space when the recording permission of the second application is turned off; determine a second address; wherein the second address is the address at which the first application starts to read audio data from the target storage space when the recording permission is turned on; and provide the second application with audio data located between the first address and the second address.

[0155] Optionally, the closing module is specifically used to reopen the recording permission of the second application after the recording permission of the first application is closed; and provide the audio data located between the first address and the second address to the second application that restarts the recording permission.

[0156] Optionally, the audio data collected by the microphone is stored in the target storage space, and the start module 403 is specifically used to determine the real-time read address when the first application reads the audio data from the target storage space; when there is a deviation between the real-time storage address and the real-time read address, the real-time read address is corrected according to the real-time storage address; wherein the real-time storage address is the address of the audio data stored in the target storage space at the current moment.

[0157] Optionally, the start module 403 is specifically used to determine the reading speed when the first application reads audio data from the target storage space; determine the storage speed when storing audio data collected by the microphone in the target storage space; when the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time reading address, use the real-time storage address as the real-time reading address.

[0158] Optionally, the target storage space is a ring storage space, and the enabling module 403 is specifically used to determine the number of storage overflows and the number of read overflows of the ring storage space after enabling the recording permission of the first application when the storage speed is greater than the read speed; if the number of storage overflows is greater than the number of read overflows, and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address.

[0159] Optionally, the start module 403 is specifically used to determine the reading speed when the first application reads audio data from the target storage space; determine the storage speed when storing audio data collected by the microphone in the target storage space; when the reading speed is greater than the storage speed, determine the waiting time according to the speed difference between the reading speed and the storage speed, and control the first application to read the audio data from the target storage space after the waiting time.

[0160] The recording device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0161] See also Figure 5 , Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0162] For example, Figure 5 As shown, the vehicle 500 includes: a memory 501 and a processor 502, wherein the memory 501 stores an executable program code 5011, and the processor 502 is used to call and execute the executable program code 5011 to perform a recording method.

[0163] In addition, an embodiment of the present application also protects a vehicle, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to perform a recording method provided by an embodiment of the present application.

[0164] This embodiment also provides a readable storage medium, in which executable program code is stored. When the executable program code is run on a computer, the computer executes the above-mentioned related method steps to implement a recording method provided in the above embodiment.

[0165] This embodiment also provides an executable program code product. When the executable program code product runs on a computer, the computer executes the above-mentioned related steps to implement a recording method provided in the above embodiment.

[0166] Among them, the device, readable storage medium, executable program code product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0167] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0168] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0169] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A recording method, characterized in that: The method comprises: In the case of receiving a recording request sent by a first application, if the microphone is turned on by a second application, determining whether the first application is a first type of application that needs to occupy the audio focus; If the first application is an application of the first category, determining whether the second application is an application of the second category that does not need to occupy the audio focus; If the second application is an application of the second category, the recording permission of the first application is enabled so that the first application and the second application can jointly obtain the audio data currently collected by the microphone.

2. The method according to claim 1, characterized in that The method further comprises: Determining whether the first application needs to exclusively use the audio data collected by the microphone; If the first application needs to exclusively use the audio data collected by the microphone, the recording permission of the second application is closed so that the second application stops obtaining the audio data collected by the microphone.

3. The method according to claim 2, characterized in that The audio data collected by the microphone is stored in the target storage space. After the recording permission of the second application is closed, the method further includes: Determine a first address; wherein the first address is an address at which the second application reads audio data from the target storage space when the recording permission of the second application is disabled; Determine a second address; wherein the second address is the address at which the first application starts to read audio data from the target storage space when the recording permission is enabled; The audio data located between the first address and the second address is provided to the second application.

4. The method according to claim 3, characterized in that The providing the second application with the audio data located between the first address and the second address comprises: After the recording permission of the first application is disabled, re-enabling the recording permission of the second application; The audio data located between the first address and the second address is provided to the second application having the permission to restart recording.

5. The method according to claim 1, characterized in that The audio data collected by the microphone is stored in the target storage space. After the recording permission of the first application is enabled, the method further includes: Determining a real-time read address when the first application reads audio data from the target storage space; When there is a deviation between the real-time storage address and the real-time read address, the real-time read address is corrected according to the real-time storage address; wherein the real-time storage address is the address of the audio data stored in the target storage space at the current moment.

6. The method according to claim 5, characterized in that When there is a deviation between the real-time storage address and the real-time read address, correcting the real-time read address according to the real-time storage address includes: determining a reading speed when the first application reads audio data from the target storage space; Determining a storage speed when storing the audio data collected by the microphone in the target storage space; When the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time reading address, the real-time storage address is used as the real-time reading address.

7. The method according to claim 6, characterized in that The target storage space is a ring storage space, and when the storage speed is greater than the reading speed and the real-time storage address is greater than the real-time reading address, the real-time storage address is used as the real-time reading address, including: In a case where the storage speed is greater than the reading speed, determining a number of storage overflows and a number of reading overflows of the annular storage space after enabling the recording permission of the first application; If the storage overflow number is greater than the read overflow number, and the real-time storage address is greater than the real-time read address, the real-time storage address is used as the real-time read address.

8. The method according to claim 5, characterized in that The step of correcting the real-time read address according to the real-time storage address comprises: determining a reading speed when the first application reads audio data from the target storage space; Determining a storage speed when storing the audio data collected by the microphone in the target storage space; When the reading speed is greater than the storage speed, a waiting time is determined according to a speed difference between the reading speed and the storage speed, and the first application is controlled to read audio data from the target storage space after waiting for the waiting time.

9. A recording device, characterized in that: The device comprises: A first determination module is used to determine whether the first application is a first type of application that needs to occupy the audio focus when receiving a recording request sent by the first application and if the microphone is turned on by the second application; A second determination module, configured to determine whether the second application is a second type of application that does not need to occupy the audio focus if the first application is the first type of application; An enabling module is used to enable the recording permission of the first application if the second application is the second type of application, so that the first application and the second application can jointly obtain the audio data currently collected by the microphone.

10. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Audio playing monitoring method and related equipment

    CN109634809A

  • Method, device and equipment for allocating use permission and storage medium

    CN111222124A

  • Microphone control method and device, intelligent terminal and storage medium

    CN112468934A

  • Arbitration method and arbitration device for vehicle-mounted audio focus and electronic equipment

    CN114995779A

  • Audio recording method, device and equipment and readable storage medium

    CN115334195A

Cited By

  • Mobile phone control method and device based on multiple rounds of voice interaction, equipment and medium

    CN122226889A