A method and apparatus for detecting a mute state of a UAC device, and an electronic device
By performing frame-by-frame processing and counting on the audio data collected by the UAC device, the cumbersome problem of silence detection in the existing technology is solved, achieving fast and accurate silence synchronization, simplifying the detection process and reducing the amount of computation.
Patent Information
- Application Number
- CN202310039386.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-13
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-01-13
AI Technical Summary
Existing methods for detecting the silent status of UAC devices rely on third-party libraries or require individual device adaptation, resulting in a cumbersome and time-consuming process that cannot efficiently synchronize the silent status of devices and applications.
By processing the audio data collected by the UAC device into frames, counting the silence and non-silence counts of each frame, and determining the silence status of the current frame based on a preset threshold, the detection process is simplified and dependence on third-party libraries and vendor SDKs is avoided.
It enables rapid and accurate determination of the silent state of UAC devices, simplifies the detection process, reduces computational load, and is suitable for more application scenarios.
Smart Images

Figure CN116339673B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of audio technology, in particular to a UAC device mute state detection method and device, a storage medium, an electronic device and a computer program product. BACKGROUND
[0002] In a real-time audio and video communication conference, a microphone device needs to be used when a user speaks. Most existing microphone devices are provided with a control button, through which mute, unmute, volume increase, volume decrease, power on / off and other operations can be performed. The most common microphone device is an omnidirectional microphone device with a USB interface. The omnidirectional microphone device is a common UAC (USB Audio Class) device. In a real-time audio and video communication conference, the most common operations are mute and unmute. For example, when a user speaks, the user needs to be unmuted; when the user does not need to speak, the user can turn off the mute. The above processes all need to synchronize the mute state of the application and the device.
[0003] When a user performs a mute / unmute operation on the interface, the system interface can be directly called for operation, at which time the microphone device synchronously performs the mute / unmute operation, and at this time, the state of the application and the state of the device are synchronized. However, when the mute / unmute operation is performed on the device, the application needs to adapt to obtain the mute / unmute state of the device, and then synchronize the mute / unmute state of the device to the application interface.
[0004] In actual application scenarios, a mute detection method is needed, which can synchronize the mute state of the device and the application.
[0005] For a UAC device, there are mainly two ways to synchronize the mute state. One way is to use the HID (Human Interface Device) specification to call the HidApi library to obtain the current mute state of the UAC device by capturing the report descriptor. The use of the HID specification needs to consult the relevant report descriptor, and since the formats used by different devices may not be consistent, the HidApi library needs to be called and loaded, and each device needs to be adapted one by one, which makes the process of obtaining the current mute state of the UAC device cumbersome and time-consuming.
[0006] Another way is to adapt the device according to the SDK (Software Development Kit) provided by the manufacturer of the microphone device used to obtain the mute state of the current UAC device. This method not only needs to adapt each device in turn, but also needs to load a third-party library. When using the SDK provided by the manufacturer to adapt, the manufacturer's device needs to be adapted one by one. In this adaptation process, if there are multiple different SDKs, different SDKs need to be loaded one by one, and the manufacturer's device needs to be adapted one by one. The entire operation process is extremely cumbersome. SUMMARY
[0007] Therefore, it is necessary to provide a UAC device mute state detection method, device, storage medium, electronic device and computer program product to solve the problem that the existing UAC device mute state detection method needs to rely on a third-party library or needs to adapt each device one by one.
[0008] In a first aspect, an embodiment of the present application provides a UAC device mute state detection method, which comprises:
[0009] frame processing the audio data collected by the UAC device according to a preset manner to obtain corresponding audio data of each frame;
[0010] comparing the amplitude of each sampling point set for each frame of data with a preset first threshold value one by one to determine whether the current frame corresponding to each sampling point is a silent frame, so as to count the silent count value or the non-silent count value, and the first threshold value is used to determine whether the current frame corresponding to each sampling point is a silent frame;
[0011] determining whether the current frame is in a silent state or a non-silent state according to the silent count value, the non-silent count value and a preset second threshold value, and the second threshold value is used to determine whether the current frame is in a silent state.
[0012] In an embodiment, the frame processing the audio data collected by the UAC device according to a preset manner to obtain corresponding audio data of each frame comprises:
[0013] calling back the corresponding audio data every first preset time interval for the audio data collected by the UAC device;
[0014] frame processing the audio data, and taking each audio data every second preset time interval as a frame of audio data.
[0015] In one implementation, the step of sequentially comparing the amplitude of each sampling point of a preset number of data points in each frame with a preset first threshold to determine whether the current frame corresponding to each sampling point is a silent frame, and to count silent or non-silent counts, includes:
[0016] Randomly select any sampling point from each of the preset number of sampling points as the current sampling point;
[0017] Obtain the first amplitude value at the current sampling point;
[0018] In response to the first amplitude at the current sampling point being less than or equal to the first threshold, the current sampling point is determined to be a silent frame, and a silent count value is calculated.
[0019] In one implementation, the statistical silence count includes:
[0020] The mute count is incremented by 1 based on the current value, and the corresponding non-mute count is reset to 0.
[0021] In one implementation, the step of sequentially comparing the amplitude of each sampling point of a preset number of data points in each frame with a preset first threshold to determine whether the current frame corresponding to each sampling point is a silent frame, and to count silent or non-silent counts, includes:
[0022] Randomly select any sampling point from each of the preset number of sampling points as the current sampling point;
[0023] Obtain the second amplitude value at the current sampling point;
[0024] In response to the second amplitude of the current sampling point being greater than the first threshold, the current sampling point is determined to be a non-silent frame, and the non-silent count value is counted.
[0025] In one implementation, the statistical non-silent count includes:
[0026] The non-silent count is incremented by 1 based on the current value, and the corresponding silent count is reset to 0.
[0027] In one implementation, determining whether the current frame is in a silent state or a non-silent state based on the silence count value, the non-silent count value, and a preset second threshold includes:
[0028] In response to the silence count value being equal to the second threshold, it is determined that the current frame is in a silent state.
[0029] In one implementation, after determining that the current frame is in a silent state, the method further includes:
[0030] In response to determining that the current frame is in the mute state, synchronizing the mute state of the current frame to the application to be synchronized.
[0031] In an embodiment, the determining that the current frame is in the mute state or in the non-mute state according to the mute count value, the non-mute count value, and a preset second threshold value comprises:
[0032] In response to the non-mute count value being equal to the second threshold value, determining that the current frame is in the non-mute state.
[0033] In a second aspect, an embodiment of the present application provides a device for detecting a mute state of a UAC device, the device comprising:
[0034] a frame processing module configured to perform frame processing on audio data collected by the UAC device according to a preset manner to obtain corresponding frame audio data;
[0035] a first determining module configured to compare the amplitude of each sampling point of a preset number of each frame of data with a preset first threshold value in sequence to determine whether the current frame corresponding to each sampling point is a mute frame, so as to count a mute count value or a non-mute count value, the first threshold value being used to determine whether the current frame corresponding to each sampling point is a mute frame;
[0036] a second determining module configured to determine that the current frame is in the mute state or in the non-mute state according to the mute count value, the non-mute count value, and a preset second threshold value, the second threshold value being used to determine whether the current frame is in the mute state.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0038] a processor;
[0039] a memory configured to store executable instructions of the processor;
[0040] the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method steps described above.
[0041] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being configured to execute the method steps described above.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program, the computer program being configured to implement the method steps described above when executed by a processor.
[0043] In the embodiment of the present application, the audio data collected by the UAC device is processed in a preset manner to obtain corresponding audio data of each frame; the amplitude of each sampling point of a preset number of each frame of data is compared with a preset first threshold value in sequence to determine whether the current frame corresponding to each sampling point is a silent frame, so as to count the silent count value or the non-silent count value, the first threshold value is used to determine whether the current frame corresponding to each sampling point is a silent frame; and according to the silent count value, the non-silent count value and a preset second threshold value, it is determined that the current frame is in a silent state or in a non-silent state, the second threshold value is used to determine whether the current frame is in a silent state. The detection method of the silent state of the UAC device provided in the embodiment of the present application does not need to rely on a third-party library, and does not need to adapt to devices one by one according to the SDK provided by the manufacturer, and can effectively simplify the process of the existing detection method. In addition, the detection method has small amount of calculation and high accuracy, and can determine whether the current frame is in a silent state in real time and accurately, so that the detection method is simple and easy to use, and can be applied to more application scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0044] The exemplary embodiments of this application can be more fully understood with reference to the following drawings. The drawings are provided for illustrative purposes and are part of the specification, together with the embodiments of the present application, to explain the application, and do not constitute a limitation on the application. In the drawings, the same reference numerals generally represent the same components or steps.
[0045] Figure 1 A flowchart of a detection method of a silent state of a UAC device according to an exemplary embodiment of the present application is provided;
[0046] Figure 2 A flowchart of a detection method of a silent state of a UAC device in a specific application scenario of the present application is provided;
[0047] Figure 3 A structural schematic diagram of a detection device 300 of a silent state of a UAC device according to an exemplary embodiment of the present application is provided;
[0048] Figure 4 A schematic diagram of an electronic device provided by an exemplary embodiment of the present application is shown;
[0049] Figure 5 A schematic diagram of a computer readable medium provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0050] Exemplary embodiments of the present disclosure will be described in greater detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms without being limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thoroughly and completely understood, and will fully convey the scope of the present disclosure to those skilled in the art.
[0051] It should be noted that the technical terms or scientific terms used in the present application should be understood as their general meanings understood by those skilled in the art, unless otherwise specified.
[0052] In addition, the terms "first" and "second" and the like are used to distinguish different objects, rather than to describe a particular order. Furthermore, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include other steps or units not listed or can optionally include other steps or units inherent to such processes, methods, products or devices.
[0053] Embodiments of the present application provide a UAC device mute state detection method and device, an electronic device and a computer readable medium, which will be described below with reference to the accompanying drawings.
[0054] Reference is made to Figure 1 which shows a UAC device mute state detection method provided by some embodiments of the present application. As shown in the figure, the UAC device mute state detection method can include the following steps:
[0055] Step S101: Frame processing is performed on audio data collected by the UAC device in a preset manner to obtain corresponding audio data for each frame.
[0056] In one possible implementation, frame processing is performed on audio data collected by the UAC device in a preset manner to obtain corresponding audio data for each frame, including the following steps:
[0057] The audio data collected by the UAC device is recalled every first preset time interval.
[0058] Frame processing is performed on the audio data, and every audio data every second preset time interval is taken as a frame of audio data.
[0059] In this step, the first preset time interval can be set according to different application scenarios. For example, in a specific application scenario, the first preset time interval is set to 10 ms, and the microphone device collects audio data once every 10 ms. In the detection method provided in the embodiments of the present application, the first preset time interval is not specifically limited and can be adjusted according to the needs of different application scenarios, which will not be described here.
[0060] Similarly, the second preset time interval in this step can also be set according to different application scenarios. For example, in a specific application scenario, the second preset time interval is set to 10 ms, and the collected audio data is processed by frame, and each 10 ms is taken as a frame of data. In the detection method provided in the embodiments of the present application, the second preset time interval is not specifically limited and can be adjusted according to the needs of different application scenarios, which will not be described here.
[0061] Step S102: The amplitude of each sample point of the preset number of each frame of data is compared with the preset first threshold value in sequence to determine whether the current frame corresponding to each sample point is a silent frame, so as to count the silent count value or the non-silent count value. The first threshold value is used to determine whether the current frame corresponding to each sample point is a silent frame.
[0062] In actual application scenarios, the preset number of sample points set for each frame of data is not specifically limited and can be adjusted according to the needs of different application scenarios. For example, in a specific application scenario, if the sampling rate is 48k, there are a total of 480 sample points in each frame of 10 ms.
[0063] When the sampling rate is 48k, 480 sample points in a frame are traversed, the amplitude of each sample point in the 480 sample points is obtained, and the amplitude of each sample point in the 480 sample points is compared with the preset first threshold value in sequence to sequentially determine whether the current frame corresponding to each sample point is a silent frame.
[0064] In the detection method provided in the embodiments of the present application, the first threshold value is not specifically limited and can be adjusted according to the needs of different application scenarios, which will not be described here.
[0065] In one possible implementation, the amplitude of each sample point of the preset number of each frame of data is compared with the preset first threshold value in sequence to determine whether the current frame corresponding to each sample point is a silent frame, so as to count the silent count value or the non-silent count value, including the following steps:
[0066] Randomly selecting any sample point from the preset number of sample points as a current sample point;
[0067] Obtaining the first amplitude of the current sample point;
[0068] In response to the first amplitude of the current sampling point being less than or equal to the first threshold value, the current sampling point is determined as a silence frame, so as to count the silence count value.
[0069] In a possible implementation, the silence count value is counted, including the following steps.
[0070] The silence count value is added by 1 based on a current value, and a value corresponding to the non-silence count is reset to 0.
[0071] In a possible implementation, the amplitude of each sampling point in a preset number of sampling points in each frame of data is compared with a preset first threshold value in sequence, to determine whether a current frame corresponding to each sampling point is a silence frame, so as to count the silence count value or the non-silence count value, including the following steps.
[0072] Any sampling point is randomly selected from each sampling point in the preset number of sampling points as a current sampling point.
[0073] The second amplitude of the current sampling point is obtained.
[0074] In response to the second amplitude of the current sampling point being greater than the first threshold value, the current sampling point is determined as a non-silence frame, so as to count the non-silence count value.
[0075] In a possible implementation, the non-silence count value is counted, including the following steps.
[0076] The non-silence count value is added by 1 based on a current value, and a value corresponding to the silence count is reset to 0.
[0077] Step S103: According to the silence count value, the non-silence count value and a preset second threshold value, it is determined that the current frame is in a silence state or in a non-silence state, and the second threshold value is used to determine whether the current frame is in the silence state.
[0078] In the detection method provided in the embodiments of the present application, the second threshold value is not specifically limited, and can be adjusted according to the requirements of different application scenarios, which will not be described here.
[0079] In a possible implementation, according to the silence count value, the non-silence count value and a preset second threshold value, it is determined that the current frame is in a silence state or in a non-silence state, including the following steps.
[0080] In response to the silence count value being equal to the second threshold value, it is determined that the current frame is in the silence state.
[0081] In a possible implementation, after it is determined that the current frame is in the silence state, the following steps are further included.
[0082] In response to determining that the current frame is in a silent state, the silent state of the current frame is synchronized to the application to be synchronized.
[0083] In one possible implementation, determining whether the current frame is in a silent state or a non-silent state based on a silence count value, a non-silent count value, and a preset second threshold includes the following steps:
[0084] In response to the non-silent count value being equal to the second threshold, it is determined that the current frame is in a non-silent state.
[0085] like Figure 2 The diagram shown is a flowchart of a method for detecting the silent state of a UAC device in a specific application scenario of this application.
[0086] As Figure 2 As shown, the method for detecting the silent state of a UAC device in a specific application scenario of this application, after counting the silent count value and the non-silent count value, only needs to compare the silent count value or the non-silent count value with a preset second threshold in sequence. The second threshold is used to determine whether the current frame is in a silent state, which can quickly and accurately determine whether the current frame is in a silent state. In this way, not only can the process of the existing detection method be effectively simplified, but it can also quickly and accurately determine whether the current frame is in a silent state. When it is determined that the current frame is in a silent state, the silent state of the current frame is synchronized to the application to be synchronized.
[0087] against Figure 2 For a description of the same or similar parts, see the foregoing. Figure 1 The relevant descriptions will not be repeated here.
[0088] The method for detecting the silent state of a UAC device provided in this application embodiment does not rely on third-party libraries, nor does it require individual device adaptation based on the manufacturer's SDK. After counting the silent and non-silent counts, the method simply compares the silent or non-silent counts sequentially with a preset second threshold. The second threshold is used to determine whether the current frame is in a silent state. This allows for quick and accurate determination of whether the current frame is in a silent state. Ultimately, it effectively simplifies the process of existing detection methods. Furthermore, this detection method has low computational complexity and high accuracy, and can determine whether the current frame is in a silent state in real time and accurately. Therefore, this detection method is simple and easy to use, and can be applied to more application scenarios.
[0089] In the above embodiments, a method for detecting a mute state of a UAC device is provided, and a device for detecting a mute state of a UAC device is also provided. The device for detecting a mute state of a UAC device can implement the method for detecting a mute state of a UAC device, and can be implemented by software, hardware or a combination of software and hardware. For example, the device for detecting a mute state of a UAC device can include integrated or separate functional modules or units to perform the corresponding steps in the above methods.
[0090] Reference is made to Figure 3 which shows a device for detecting a mute state of a UAC device according to some embodiments of the present application. Since the device embodiments are basically similar to the method embodiments, they are described more simply, and the related parts can be referred to the part of the description of the method embodiments. The device embodiments described below are only illustrative.
[0091] As shown in Figure 3 , the device for detecting a mute state of a UAC device 300 can include:
[0092] a frame processing module 301 configured to perform frame processing on audio data collected by the UAC device according to a preset manner to obtain corresponding audio data for each frame;
[0093] a first determination module 302 configured to compare the amplitude of each sampling point of a preset number of each frame of data with a preset first threshold value in sequence to determine whether the current frame corresponding to each sampling point is a mute frame, so as to count a mute count value or a non-mute count value, and the first threshold value is used to determine whether the current frame corresponding to each sampling point is a mute frame;
[0094] a second determination module 303 configured to determine whether the current frame is in a mute state or in a non-mute state according to the mute count value, the non-mute count value and a preset second threshold value, and the second threshold value is used to determine whether the current frame is in a mute state.
[0095] In some embodiments of the present application, the frame processing module 301 is specifically configured to:
[0096] call back the corresponding audio data every first preset time interval for the audio data collected by the UAC device;
[0097] perform frame processing on the audio data, and take each audio data every second preset time interval as a frame of audio data.
[0098] In some embodiments of the present application, the first determination module 302 is specifically configured to:
[0099] Randomly select any sampling point from each of the preset number of sampling points as the current sampling point;
[0100] Obtain the first amplitude value at the current sampling point;
[0101] In response to the first amplitude of the current sampling point being less than or equal to the first threshold, the current sampling point is determined to be a silent frame, and the silent count value is counted.
[0102] In some embodiments of this application, the first determining module 302 is specifically used for:
[0103] The mute count is incremented by 1 based on the current value, and the corresponding non-mute count is reset to 0.
[0104] In some embodiments of this application, the first determining module 302 is specifically used for:
[0105] Randomly select any sampling point from each of the preset number of sampling points as the current sampling point;
[0106] Obtain the second amplitude value at the current sampling point;
[0107] In response to the second amplitude of the current sampling point being greater than the first threshold, the current sampling point is determined to be a non-silent frame, and the non-silent count value is counted.
[0108] In some embodiments of this application, the first determining module 302 is specifically used for:
[0109] The non-silent count is incremented by 1 based on the current value, and the corresponding silent count is reset to 0.
[0110] In some embodiments of this application, the second determining module 303 is specifically used for:
[0111] In response to the silence count value being equal to the second threshold, it is determined that the current frame is in a silent state.
[0112] In some embodiments of this application, the device 300 may further include:
[0113] Synchronization module (in) Figure 3 (not shown in the image), used to synchronize the mute state of the current frame to the application to be synchronized after determining that the current frame is in a mute state.
[0114] In some embodiments of this application, the second determining module 303 is specifically used for:
[0115] In response to the non-silent count value being equal to the second threshold, it is determined that the current frame is in a non-silent state.
[0116] In some embodiments of the present application, the UAC device mute state detection apparatus 300 provided by the embodiments of the present application has the same inventive concept and the same beneficial effects as the UAC device mute state detection method provided by the aforementioned embodiments of the present application.
[0117] The embodiments of the present application also provide an electronic device corresponding to the UAC device mute state detection method provided by the aforementioned embodiments of the present application. The electronic device can be an electronic device for a server, such as a server, including a standalone server and a distributed server cluster, etc., to execute the UAC device mute state detection method. The electronic device can also be an electronic device for a client, such as a mobile phone, a notebook computer, a tablet computer, a desktop computer, etc., to execute the UAC device mute state detection method.
[0118] Please refer to Figure 4 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. As Figure 4 shown, the electronic device 40 includes a processor 400, a memory 401, a bus 402 and a communication interface 403, the processor 400, the communication interface 403 and the memory 401 are connected through the bus 402; the memory 401 stores a computer program executable on the processor 400, and the processor 400 executes the UAC device mute state detection method of the aforementioned embodiments of the present application when executing the computer program.
[0119] The memory 401 can include a high-speed random access memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. The communication between the system network element and at least one other network element is realized through at least one communication interface 403 (which can be wired or wireless), and the Internet, a wide area network, a local network, a metropolitan area network, etc. can be used.
[0120] The bus 402 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 401 is used to store programs, and the processor 400 executes the programs after receiving execution instructions. The UAC device mute state detection method disclosed in any of the aforementioned embodiments of the present application can be applied to the processor 400 or realized by the processor 400.
[0121] The processor 400 can be an integrated circuit chip with signal processing capability. In implementation, each step of the above method can be completed by integrated logic circuits or instructions in software form in the processor 400. The processor 400 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or can be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium in the memory 401 is read by the processor 400, and the hardware thereof is combined to complete the steps of the above method.
[0122] The electronic device provided by the embodiments of the present application and the method for detecting the mute state of the UAC device provided by the embodiments of the present application have the same beneficial effects as the method adopted, run or implemented by them.
[0123] The embodiments of the present application also provide a computer readable medium corresponding to the method for detecting the mute state of the UAC device provided by the preceding embodiments. Please refer to Figure 5 The computer readable storage medium shown in the figure is an optical disc 50, and a computer program (i.e. a program product) is stored on the optical disc 50. When the computer program is run by a processor, the method for detecting the mute state of the UAC device described above will be executed.
[0124] It should be noted that examples of the computer readable storage medium can also include, but are not limited to, a phase change memory (PRAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), other types of random access memory (RAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory or other optical, magnetic storage medium, which will not be described one by one here.
[0125] The computer readable storage medium provided by the above embodiments of the present application has the same inventive concept as the method for detecting the mute state of the UAC device provided by the embodiments of the present application, and has the same beneficial effects as the method adopted, run or implemented by the application stored in the computer readable storage medium.
[0126] It should be noted that the flowcharts and block diagrams in the accompanying drawings show the architectural, functional and operational aspects of possible implementations of systems, methods and computer program products according to embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than those shown in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0128] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, and for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, and can be electrical, mechanical or other forms.
[0129] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0130] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0131] The functions, if implemented in the form of software functional units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods according to the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various other media that can store program codes.
[0132] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should be covered in the scope of the claims and the specification of the present application.
Claims
1. A method for detecting a mute state of a UAC device, comprising: frame processing audio data collected by the UAC device according to a preset manner to obtain corresponding audio data of each frame; comparing amplitudes of each sample point of each frame of data with a preset first threshold value in sequence to determine whether the current frame corresponding to each sample point is a mute frame, to count a mute count value or a non-mute count value, the first threshold value being used to determine whether the current frame corresponding to each sample point is a mute frame; determining that the current frame is in a mute state or in a non-mute state according to the mute count value, the non-mute count value and a preset second threshold value, the second threshold value being used to determine whether the current frame is in a mute state; wherein the comparing the amplitudes of each sample point of each frame of data with the preset first threshold value in sequence to determine whether the current frame corresponding to each sample point is a mute frame, to count the mute count value or the non-mute count value, comprises: randomly selecting any sample point from the preset number of sample points as a current sample point; obtaining a first amplitude of the current sample point; in response to the first amplitude of the current sample point being less than or equal to the first threshold value, determining that the current sample point is a mute frame to count the mute count value; further comprising: randomly selecting any sample point from the preset number of sample points as a current sample point; obtaining a second amplitude of the current sample point; in response to the second amplitude of the current sample point being greater than the first threshold value, determining that the current sample point is a non-mute frame to count the non-mute count value; wherein the determining that the current frame is in a mute state or in a non-mute state according to the mute count value, the non-mute count value and the preset second threshold value, comprises: in response to the mute count value being equal to the second threshold value, determining that the current frame is in a mute state; further comprising: in response to the non-mute count value being equal to the second threshold value, determining that the current frame is in a non-mute state.
2. The method of claim 1, wherein, The frame processing audio data collected by the UAC device according to a preset manner to obtain corresponding audio data of each frame, comprises: calling back corresponding audio data every first preset time interval for the audio data collected by the UAC device; frame processing the audio data, taking every audio data every second preset time interval as a frame of audio data.
3. The method of claim 1, wherein, The counting the mute count value, comprises: adding 1 to the current value of the mute count value and resetting the value corresponding to the non-mute count to 0.
4. The method of claim 1, wherein, The counting the non-mute count value, comprises: adding 1 to the current value of the non-mute count value and resetting the value corresponding to the mute count to 0.
5. The method of claim 1, wherein, After the determining that the current frame is in a mute state, further comprising: in response to determining that the current frame is in a mute state, synchronizing the mute state of the current frame to an application to be synchronized. 6.A device for detecting a mute state of a UAC device, comprising: a frame processing module configured to frame process audio data collected by the UAC device according to a preset manner to obtain corresponding audio data of each frame; The first determining module is configured to compare the amplitude of each sampling point in a preset number of sampling points in each frame of data with a preset first threshold value in sequence, determine whether the current frame corresponding to each sampling point is a silence frame, and count a silence count value or a non-silence count value, wherein the first threshold value is used to determine whether the current frame corresponding to each sampling point is a silence frame. The second determining module is configured to determine whether the current frame is in a silence state or a non-silence state according to the silence count value, the non-silence count value and a preset second threshold value, wherein the second threshold value is used to determine whether the current frame is in a silence state. The comparison of the amplitude of each sampling point in a preset number of sampling points in each frame of data with a preset first threshold value in sequence, the determination of whether the current frame corresponding to each sampling point is a silence frame, and the counting of a silence count value or a non-silence count value include the following steps: randomly selecting any sampling point from the preset number of sampling points as a current sampling point; obtaining a first amplitude of the current sampling point; in response to the first amplitude of the current sampling point being less than or equal to the first threshold value, determining that the current sampling point is a silence frame to count a silence count value; The method further includes the following steps: randomly selecting any sampling point from the preset number of sampling points as a current sampling point; obtaining a second amplitude of the current sampling point; in response to the second amplitude of the current sampling point being greater than the first threshold value, determining that the current sampling point is a non-silence frame to count a non-silence count value; The determination of whether the current frame is in a silence state or a non-silence state according to the silence count value, the non-silence count value and a preset second threshold value includes the following steps: in response to the silence count value being equal to the second threshold value, determining that the current frame is in a silence state; The method further includes the following steps: in response to the non-silence count value being equal to the second threshold value, determining that the current frame is in a non-silence state.
Citation Information
Patent Citations
Voice endpoint detection method and circuit, audio processing chip and audio equipment
CN113284517A
Method for testing silent frame
CN1787071A