Voice quality detection method and device, medium and equipment
By using a speech activity detection algorithm in a head-mounted device to segment speech segments and non-speech segments and remove interference frames, the accuracy problem of speech quality detection in voice interaction scenarios is solved, and more accurate signal-to-noise ratio calculation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
- Filing Date
- 2026-01-05
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, voice activity detection algorithms struggle to adapt to complex and dynamic acoustic environments in voice interaction scenarios of head-mounted devices, leading to over-detection and under-detection, which affects the accuracy of voice quality detection.
The speech activity detection algorithm is used to divide speech segments into non-speech segments, identify and remove interference frames in the non-speech segments, and calculate the signal-to-noise ratio to determine the speech quality.
It improves the accuracy and reliability of speech quality detection, avoids problems such as overestimation of noise power and underestimation of signal-to-noise ratio, and ensures a true reflection of speech signal quality.
Smart Images

Figure CN121983031A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to a method, apparatus, storage medium and device for voice quality detection. Background Technology
[0002] In recent years, with the rapid development of technologies such as Augmented Reality (AR) and Virtual Reality (VR), wearable devices have become increasingly popular. Among them, head-mounted devices, such as smart glasses, have attracted much attention due to their portability and immersive experience. Voice interaction, with its naturalness and low power consumption, has become the mainstream interaction solution for smart glasses. During voice interaction, the voice quality can be evaluated beforehand so that the voice interaction process can be stopped in time if the voice quality is low, avoiding interaction failure and poor user experience due to low voice quality.
[0003] In existing technologies, the acquired audio data is typically first subjected to voice activity detection (VAD) to segment it into speech segments and non-speech segments. Then, by calculating the signal-to-noise ratio (SNR) of the speech segments relative to the non-speech segments, and combining this with the sound pressure level and duration of the speech segments, the speech quality is determined.
[0004] However, in voice interaction scenarios using head-mounted devices, directly applying the VAD algorithm struggles to adapt to the complex and dynamic acoustic environment, leading to frequent over-detection and under-detection. To ensure speech integrity, the extended duration strategy in the VAD algorithm can easily misclassify non-semantic human voices captured by the head-mounted device, such as breathing sounds, coughs, and interjections, into speech segments. Furthermore, to improve the purity of speech segments, the VAD algorithm has a high threshold for filtering low-energy audio, causing weak consonants or ending sounds captured by the head-mounted device to be incorrectly classified as non-speech segments.
[0005] Based on this, this specification provides a voice quality detection method to partially solve the problems existing in the prior art, especially in head-mounted devices. Summary of the Invention
[0006] This specification provides a voice quality detection method, apparatus, storage medium, and electronic device to partially solve the problems existing in the prior art.
[0007] The embodiments in this specification adopt the following technical solutions: This specification provides a voice quality detection method, which is applied to a head-mounted device, and the method includes: Obtain the audio data to be detected; The speech classification results of each frame are determined by a preset speech activity detection algorithm, so as to divide the audio data into speech segments and non-speech segments. Based on the speech classification results of each frame, the audio frames in the non-speech segments that are classified as speech data are determined as interference frames. After deleting the interfering frames in the non-speech segment, the signal-to-noise ratio (SNR) is calculated with the speech segment, and the speech quality detection result of the audio data is determined based at least on the SNR.
[0008] This specification provides a voice quality detection device for use in head-mounted devices, the device comprising: The acquisition module is used to acquire the audio data to be detected; The classification module is used to determine the speech classification result of each frame through a preset speech activity detection algorithm, so as to divide the audio data into speech segments and non-speech segments; An interference shielding module is used to determine, based on the speech classification results of each frame, each audio frame in the non-speech segment that is classified as speech data, as an interference frame. The quality detection module is used to delete interference frames in the non-speech segment, calculate the signal-to-noise ratio (SNR) with the speech segment, and determine the speech quality detection result of the audio data based at least on the SNR.
[0009] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described speech quality detection method.
[0010] This specification provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described voice quality detection method.
[0011] The above-described at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: This specification discloses a speech quality detection method. The method uses a preset speech activity detection algorithm to determine the speech classification result of each frame, dividing the audio data into speech segments and non-speech segments. Frames in the non-speech segments that are classified as speech data are discarded as interference frames. Then, the signal-to-noise ratio (SNR) of the speech segments is calculated to determine the quality detection result. By meticulously removing interference frames misclassified as speech from the non-speech segments, a cleaner noise estimate is obtained. Based on this calculated SNR, the speech signal quality is more accurately reflected, effectively solving the problem of overestimation of noise power and underestimation of SNR caused by false VAD detection, thereby improving the accuracy and reliability of speech quality detection. Attached Figure Description
[0012] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings: Figure 1 A flowchart for a speech quality detection method provided in the embodiments of this specification; Figure 2 A schematic diagram of the framework for voice quality detection provided in the embodiments of this specification; Figure 3 A schematic diagram of a speech quality detection device provided in the embodiments of this specification; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this specification. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0014] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0015] Figure 1 A flowchart for voice quality detection provided in the embodiments of this specification specifically includes the following steps: S100: Acquire the audio data to be detected.
[0016] The purpose of voice quality testing is generally to provide pre-processing quality assessment and screening for voice interaction systems, identify and block low-quality audio data with low signal-to-noise ratio or incomplete speech, and prevent it from entering subsequent computationally expensive processing modules such as voice recognition and voiceprint verification, thereby avoiding resource waste and improving the success rate and efficiency of the interaction process.
[0017] Therefore, in the embodiments of this specification, the voice quality detection method can be integrated locally into the head-mounted device as a front-end processing module, or deployed on a cloud server as a back-end service. Front-end deployment facilitates real-time response and privacy protection, while back-end deployment allows for the use of powerful computing power to run complex models and enables centralized maintenance and continuous optimization of the algorithm. Figure 1 The device used for voice quality testing shown can be any electronic device, such as a computer, server, or server cluster consisting of multiple servers. For ease of description, the following explanation uses a server as an example.
[0018] To address the issue of VAD algorithms struggling to adapt to complex and dynamic acoustic environments, leading to over-detection and under-detection problems, this specification provides a speech quality detection method based on noise segment cleanup. By identifying and removing short-duration interference frames from non-speech segments that exceed the speech threshold but have insufficient duration, cleaner noise reference data is obtained, thereby enabling more accurate calculation of the signal-to-noise ratio (SNR). This effectively solves the problem of overestimating noise power and underestimating the SNR caused by short-duration interference frames mixed into noise segments, significantly improving the accuracy and reliability of speech quality detection.
[0019] Specifically, the server obtains the audio data to be detected.
[0020] The server first obtains encoded audio data from the headset. Generally, voice quality detection is not random or unconditional, but rather a step in the voice interaction process. For example, when a user actively initiates a service requiring voice input through a specific physical or voice interaction method, the voice quality detection process will be automatically triggered. For instance, when a user intends to activate voice payment, voice search, or voice command functions through physical buttons, touch gestures, or by uttering a preset global wake-up word on the headset, the headset, after detecting that the activation condition is met, begins to collect audio and upload it to the server, which then initiates the voice quality detection process.
[0021] Another common scenario is that it is automatically triggered by specific application events or states. For example, when a navigation app on a device automatically enters a node that requires user confirmation of an intersection, or when a social app starts recording a voice message, these apps can invoke a voice service. Simultaneously, as the service begins collecting audio, a connection is established with the server and data is transmitted. The server then synchronously performs real-time quality checks on the data stream to assess whether it meets the availability requirements for that application scenario.
[0022] Furthermore, in a service mode where the headset maintains a persistent connection with the server, the server can also initiate voice quality detection via downlink commands. For example, in an architecture where a voice monitoring module is resident on the device, when the local module recognizes a valid wake word, the device uploads an audio file containing the wake word and subsequent commands. When the server receives this data packet, it triggers a voice quality detection process for the command portion after the wake word in that audio file to determine whether to initiate subsequent recognition and execution.
[0023] Regardless of the triggering mechanism, voice quality detection is invoked as a background service with a clear context and purpose. Its execution logic is deeply integrated with the business logic, ensuring that the audio entering subsequent business processing stages has usable signal quality, thereby guaranteeing the success rate of business execution and user experience.
[0024] S102: By using a preset speech activity detection algorithm, determine the speech classification results of each frame to divide the audio data into speech segments and non-speech segments.
[0025] In the embodiments of this specification, the VAD algorithm is first used to determine the speech segments and non-speech segments based on the classification results of each frame in the audio data, thus obtaining basic starting data for processing. Since the signal-to-noise ratio is usually an important indicator for evaluating speech quality, and its calculation depends on comparing the speech signal and the non-speech signal, accurate classification results are required. Therefore, the two can be initially separated in the time series.
[0026] Specifically, the server can determine the speech classification results for each frame using a preset VAD algorithm.
[0027] The VAD algorithm is used to analyze the acoustic features of audio signals and perform binary classification on each frame in the audio data stream.
[0028] The server sequentially divides the complete audio data into consecutive audio frames and inputs these frames one by one or in batches into the VAD algorithm. After analyzing each audio frame, the VAD algorithm outputs the speech classification result for that frame. This speech classification result identifies whether the content of the frame belongs to the speech category or the non-speech category. The speech category specifically refers to the frame's acoustic features conforming to the typical pattern of human speech, while the non-speech category means that the frame's acoustic features are more consistent with the typical pattern of background noise, silence, or other non-human noise interference.
[0029] Then, the server can determine several candidate speech segments based on the speech classification results of each frame. Based on the speech classification results of each frame, the server merges and marks the consecutive audio frames classified as speech categories in the audio data on the time axis. The interval formed by these consecutive frames is identified and recorded as an independent speech segment, i.e., the candidate speech segment.
[0030] Then, from all candidate speech segments, those with a duration not less than the preset pronunciation duration are selected as speech segments. Accordingly, all frames not classified as speech categories are merged and labeled, and the intervals formed by these frames are identified and recorded as non-speech segments.
[0031] Among these, candidate audio segments that are too short in duration are highly likely not to be valid user speech, but rather consist of transient environmental noise, device contact sounds, short breaths from the user, or other non-semantic human voices. Treating such segments as audio segments could lead to an overestimation of the overall duration of the audio segment and could distort the overall acoustic characteristics due to the properties of these short-term interference signals, resulting in distortion of key quality indicators such as signal-to-noise ratio. Therefore, the server filters out candidate audio segments shorter than a preset pronunciation duration, excluding them from the list of audio segments.
[0032] The preset pronunciation duration can be set as needed, for example, to the shortest time required to cover a clear monosyllable pronunciation, or to the shortest time required for an effective speech unit based on the actual business scenario.
[0033] By performing this type of segmentation on the entire audio data stream, the server effectively refines the preliminary classification results. This ensures that the speech segments entering the speech quality assessment stage first meet the basic requirements of valid speech in the time dimension, thus providing a reliable data foundation for subsequent calculations of indicators such as sound pressure level and signal-to-noise ratio, and improving the robustness and accuracy of the quality detection method.
[0034] S104: Based on the speech classification results of each frame, determine the audio frames in the non-speech segments that are classified as speech data, and use them as interference frames.
[0035] In the embodiments of this specification, the speech classification results typically include implicit or explicit requirements for the duration of speech to avoid misclassifying transient noise as speech. While this improves classification specificity, for very short-duration real human voice signals, such as brief interjections, attenuated portions of speech, or sudden monosyllables, because their duration is below the internal or associated duration determination threshold of the algorithm, they are highly likely to be classified as non-speech segments by the algorithm.
[0036] These short speech frames, categorized as non-speech segments, constitute a special type of interference within the non-speech segment. Although they do not meet the speech criteria for algorithmic judgment in terms of duration, their acoustic characteristics, such as energy spectrum and harmonic structure, are fundamentally different from non-speech segments, such as background noise. If non-speech segments containing such frames are directly used to estimate the power of background noise in subsequent steps, it will affect the accuracy of quality detection.
[0037] In other words, these frames with speech features significantly increase the overall power level of non-speech segments, resulting in an estimated background noise power value that is higher than the true value. When calculating the signal-to-noise ratio (SNR) based on this inflated noise power, the SNR evaluation result will be lower than the true level, which may incorrectly classify qualified audio as poor quality.
[0038] To address the issue of inaccurate noise estimation caused by the VAD algorithm missing short-term speech, this specification also describes a server that can identify interference frames that are included in non-speech segments, thereby purifying the non-speech segment data.
[0039] Specifically, firstly, the server determines the non-speech segments among the candidate speech segments based on the classification results of each frame recorded by the VAD algorithm, because the duration is insufficient.
[0040] Subsequently, all audio frames contained in this type of short-term candidate speech segment are extracted and uniformly labeled as interference frames. Therefore, in this specification, the interference frames are those audio frames that are located within the non-speech segment time interval, whose acoustic features are classified as speech data, but whose duration does not meet the conditions for being independently valid speech segments.
[0041] S106: After deleting the interference frames in the non-speech segment, calculate the signal-to-noise ratio (SNR) with the speech segment, and determine the speech quality detection result of the audio data based at least on the SNR.
[0042] In the embodiments of this specification, after identifying the interfering frames in the non-speech segment, the server can delete the interfering frames in the non-speech segment, calculate the signal-to-noise ratio (SNR) between the "cleaned" non-speech segment and the speech segment, and determine the speech quality detection result based at least on the SNR.
[0043] Specifically, first, the server processes the audio data marked as non-speech segments, removing all audio data identified as interference frames from that segment. After this operation, the remaining non-speech segment data is considered a "clean" noise reference segment that more closely resembles the real background noise.
[0044] The server then calculates the average signal power of the speech segment and the average noise power of the non-speech segment after deletion. According to the standard definition in communication theory, the server converts the ratio of the average signal power to the average noise power into a decibel value, which is the signal-to-noise ratio (SNR).
[0045] After obtaining the signal-to-noise ratio (SNR), the server determines the speech quality detection result of the audio data based at least on this SNR value. For example, the server compares the calculated SNR with one or more preset quality thresholds. These quality thresholds can be set according to the minimum requirements for speech clarity in the business scenario.
[0046] If the signal-to-noise ratio is not less than the quality threshold, the audio data is determined to have acceptable speech quality, or the speech quality test has passed. Otherwise, the quality is determined to be unacceptable or the test has failed.
[0047] In more complex implementations, the final result may also be a multidimensional score or grade label that integrates other derived indicators such as signal-to-noise ratio and effective speech duration.
[0048] If the detection passes, the server can send a command to the headset to enable subsequent services. Upon receiving the command, the headset can process the audio data locally. Alternatively, if the detection passes, the server can route the audio data to an internal or downstream business module to continue execution and notify the headset to wait for the execution result. Regardless of the method used, the server can continue the current voice interaction process and proceed to subsequent steps after the detection passes.
[0049] If the voice quality detection fails, it indicates that the current audio quality is poor, and continued processing will lead to recognition failure or misrecognition. The server can then generate a retransmission request and send it back to the head-mounted device. Upon receiving this request, the head-mounted device should trigger a user prompt mechanism.
[0050] For example, smart glasses can play specific prompts through their built-in speakers, generate haptic feedback through vibration motors in the temples, or display prompts on a connected mobile app to guide users to initiate voice commands again. Meanwhile, the low-quality audio data collected will be discarded by both the server and the head-mounted device and will not be included in subsequent business processing.
[0051] based on Figure 1 The illustrated speech quality detection method uses a pre-defined speech activity detection algorithm to determine the speech classification result of each frame, dividing the audio data into speech segments and non-speech segments. Frames in the non-speech segments that are classified as speech data are discarded as interference frames. Then, the signal-to-noise ratio (SNR) of the speech segments is calculated to determine the quality detection result. By meticulously removing interference frames misclassified as speech from the non-speech segments, a cleaner noise estimate is obtained. Based on this calculated SNR, the speech signal quality is more accurately reflected, effectively solving the problems of overestimation of noise power and underestimation of SNR caused by false VAD detection, thereby improving the accuracy and reliability of speech quality detection.
[0052] In one or more embodiments of this specification, in step S102, the VAD algorithm may not achieve high accuracy when classifying the start and end boundaries of speech segments due to gradual changes in speech energy, background noise interference, or the lag effect of the algorithm itself. This may result in the actual start point of the identified basic audio segment being slightly later than the user's actual speaking time, or the actual end point being slightly earlier than the user's actual ending time.
[0053] Therefore, directly using speech segments obtained from VAD classification for quality assessment may result in the loss of some effective speech signals, leading to shorter calculated speech durations and lower sound pressure levels, thus affecting the accuracy of the quality assessment. To address this issue and improve the completeness of speech segments used for quality assessment, the server can also appropriately expand the speech segments.
[0054] Specifically, the server first determines several candidate speech segments based on the speech classification results of each frame.
[0055] Then, from the candidate audio segments, those with a duration shorter than the preset pronunciation duration are recorded. And those with a duration not shorter than the preset pronunciation duration are used as the base audio segments.
[0056] Then, according to the preset extension duration, the basic audio segment is extended before and after to determine the speech segment, and the extended speech segment is recorded.
[0057] The extended duration can be an empirical value derived from statistical analysis of a large number of speech samples, used to compensate for the typical average delay of the VAD algorithm in start and end point detection.
[0058] When processing each basic audio segment, the server extends it forward and backward along the timeline by the preset extension duration, using the segment's start and end times as a reference. This operation extends the original basic audio segment in time, and the extended continuous time period is then used as the speech segment.
[0059] In addition, the server needs to handle two boundary scenarios when performing boundary expansion. First, when the starting point of forward expansion or the ending point of backward expansion exceeds the start or end timestamp of the entire audio data file, the server will limit the expansion boundary to the valid time range of the audio data. Second, when two different speech segments overlap in time or the distance between them is less than a set threshold after expansion, the server can merge them into a longer continuous speech segment for processing to avoid speech segment fragmentation.
[0060] It is worth noting that the newly added intervals during the expansion operation may include pure background noise, weak transitions in speech, or other non-steady-state sounds. To distinguish between the "core" and "edge" of speech segments in subsequent analysis, the server can accurately record the time intervals generated by the expansion in each speech segment while performing the expansion, and mark them as the expanded speech segments.
[0061] Furthermore, in the embodiments of this specification, when processing interference frames in non-speech segments, a special case needs to be considered: due to the forward and backward expansion of the basic audio segment, a short candidate speech segment may overlap temporally with the expanded portion of a certain speech segment. This means that some audio frames in the short candidate speech segment may have already been incorporated into the speech segment. For these frames that have been incorporated into the speech segment, their ownership is clear and they should no longer be treated as interference frames in non-speech segments.
[0062] Therefore, the server can process the recorded candidate audio segments as candidate interference segments first.
[0063] For each candidate interference segment, the server can compare its time range with the time ranges of all identified speech segments (including their extensions).
[0064] The server removes all portions from the candidate interference segments that fall within any speech segment interval in time. The remaining portions, those entirely within non-speech segment intervals, are identified as interference frames. Each audio frame constituting these interference audios is classified as speech data, but its time interval is defined as a non-speech segment and is not covered by speech segment extension; therefore, it is identified as an interference frame that needs to be identified and eliminated from the non-speech segment. This improves the accuracy of the identified interference frames, avoids the problems of repeated calculations or false removal caused by boundary extension, and provides more accurate data classification for subsequent calculations.
[0065] Furthermore, in the embodiments of this specification, after determining the speech segment and identifying the interfering frames in the non-speech segment, directly using these data for signal-to-noise ratio (SNR) calculation will still introduce errors. First, the extended portion contained in the speech segment may mainly consist of background noise or weak transitional sounds, rather than effective core speech signals. Including this portion in the speech signal power may lower the average power level of the speech segment. Second, residual interfering frames in the non-speech segment, due to their acoustic characteristics being similar to speech, will raise the average power level of the non-speech segment. Using both types of unpurified data for calculation will lead to an overestimation of noise power and an underestimation of signal power, thereby reducing the final SNR result and making it difficult to objectively reflect the true communication quality of the audio. Therefore, the server can also "purify" both the speech segment and the non-speech segment data simultaneously.
[0066] Specifically, in step S106, the server retrieves the extended speech segments recorded in step S102. This record explicitly identifies the time interval added by boundary extensions in each speech segment. Then, the server removes the audio frames contained in these identified extended speech segments from the complete speech segment. After the removal operation is complete, the remaining speech segment data is defined as the speech segment with the extended portion removed. This part is considered the core content of the user's effective pronunciation, and its signal power will represent the speech signal strength to be evaluated.
[0067] Simultaneously, the server removes interfering frames from the non-speech segment data based on the identified interfering frames. Short-term speech feature data mixed with noise is removed, and the purified non-speech segment is defined as the non-speech segment without interfering frames. This data will be used to represent the level of ambient background noise.
[0068] Finally, after completing the two-way purification, the average power of both is calculated to obtain the signal-to-noise ratio and determine the speech quality. The specific details have already been described in step S106 and will not be repeated here.
[0069] Furthermore, in the embodiments described in this specification, the VAD algorithm is primarily designed for processing and classifying audio data collected in traditional acoustic environments, such as handheld microphone recording and mobile phone microphone recording. However, for head-mounted devices, the audio sensor is highly sensitive to position and is more likely to capture audio data that would not be present in traditional acoustic environments. Therefore, directly applying the VAD algorithm to head-mounted device scenarios can easily lead to interference.
[0070] Specifically, in the actual use of head-mounted devices, there may be a special type of acoustic event in the non-speech segment—impulse noise. This type of noise is usually caused by physical collisions, device friction, switching transients, or sudden external sounds. It is characterized by an extremely short duration, but with abnormally high instantaneous energy or amplitude, far exceeding the level of stable background noise.
[0071] If such impulse noise is used together with stationary background noise to calculate the average noise power, its extremely high instantaneous value will severely distort the power statistics, causing the overall noise power estimate to be significantly inflated. Calculating the signal-to-noise ratio based on the overestimated noise power will result in inaccurate results that cannot stably reflect the true signal-to-noise ratio level of the speech segment relative to continuous background noise, and may misjudge high-quality speech as low-quality.
[0072] Therefore, in order to obtain a noise reference that can represent a stable acoustic background, the server can also identify and remove or neutralize impulse components in non-speech segments.
[0073] Specifically, the server can scan and analyze non-speech segments based on a preset threshold for pulses. This threshold is typically set based on amplitude, energy, or the ratio of difference from a short-term average, and its value is configured to effectively distinguish between stationary noise and sudden pulses.
[0074] The server can divide non-speech segments into continuous short-time analysis units, calculate the characteristic values of each unit, such as short-time energy and zero-crossing rate, and compare them with a preset pulse threshold. When the comparison determines that the characteristic values of one or more short-time analysis units exceed the preset pulse threshold, it is determined that there is pulse noise within that unit. For the non-speech segment data determined to contain pulses, the server will perform a cleanup process.
[0075] During the purification process, the server can directly delete the audio data corresponding to the identified pulse portion from the time series of non-speech segments, and these time points will no longer be considered in subsequent calculations. Alternatively, the server can set the amplitude value of the audio sample corresponding to the pulse portion to zero, i.e., perform zeroing, thereby eliminating its energy contribution and maintaining the continuity of the time axis. The specific choice between deletion or zeroing can be made based on the data continuity requirements of subsequent processing modules.
[0076] After pulse detection and processing, abnormal high-energy pulse components in the non-speech segment are effectively suppressed. Then, by deleting previously identified interference frames from the purified non-speech segment, the obtained data will be closer to the ideal stable background noise estimate, allowing for further steps.
[0077] In addition, in step S106 of this specification, besides calculating the speech quality based on the signal-to-noise ratio, the server can also calculate the speech quality based on the duration and sound pressure level of the speech segment.
[0078] Since the signal-to-noise ratio (SNR) primarily reflects the energy contrast between speech and noise, it cannot fully characterize the integrity, stability, and effectiveness of speech signals. For example, an audio clip with a acceptable SNR but extremely short duration might simply contain a meaningless interjection, or an audio clip with a decent SNR but excessively low sound pressure level might originate from a faint sound from a distant source, which is still insufficient to support subsequent operations. Therefore, a comprehensive approach using multi-dimensional acoustic features can determine speech quality and provide more complete and accurate speech quality detection results.
[0079] Specifically, the server first calculates the duration and sound pressure level of the speech segment. The server accesses its recorded "speech segment with extended portions" data and removes this portion from the complete speech segment, resulting in the "speech segment with extended portions removed." This operation ensures that the speech data upon which subsequent calculations are based is the core, effective speech after removing potentially noisy edge extensions. The server then calculates the total duration of this core, effective speech segment as the effective speech duration. Simultaneously, the server calculates the root mean square sound pressure level of the audio signal within this core, effective speech segment as the sound pressure level characterizing the speech intensity.
[0080] After obtaining the three core metrics—signal-to-noise ratio (SNR), effective speech duration, and sound pressure level (SPL)—the server invokes a pre-defined quality detection model. This model is a classification or regression model pre-trained based on a large number of labeled, high-quality speech samples. The server uses the calculated SNR, effective speech duration, and SPL values as input feature vectors and submits them to the quality detection model.
[0081] This quality detection model processes and analyzes the input feature vector and outputs a deterministic speech quality detection result. This result can be a binary classification label, such as "Pass" and "Fail," or a multi-level quality rating, such as "Excellent, Good, Average, Poor," or a continuous quality score. This manual does not impose any restrictions on this; it can be set as needed.
[0082] Figure 2 This is a schematic diagram of the speech quality detection framework provided in this specification. The speech signal is processed using the VAD algorithm, classifying it into speech segments and non-speech segments. For non-speech segments, interference frame detection and impulse detection are performed based on the classification results of each frame of the VAD algorithm to remove impulses and interference frames, resulting in purified non-speech segments. Simultaneously, the speech segments also need to have the speech portion extended by the VAD algorithm removed, and the duration and sound pressure level (SPL) are calculated based on this. The purified speech and non-speech segments are then used together to calculate the signal-to-noise ratio (SNR) of the speech signal. Finally, the speech signal quality detection result is obtained based on the duration, SPL, and SNR.
[0083] The above is a speech quality detection method provided by the embodiments of this specification. Based on the same idea, this specification also provides corresponding devices, storage media and electronic devices.
[0084] Figure 3 This is a schematic diagram of a speech quality detection device provided in an embodiment of this specification. The device is applied to a head-mounted device and includes: The acquisition module 301 is used to acquire the audio data to be detected; The classification module 302 is used to determine the speech classification result of each frame through a preset speech activity detection algorithm, so as to divide the audio data into speech segments and non-speech segments; The interference shielding module 303 is used to determine, based on the speech classification results of each frame, each frame of audio in the non-speech segment that is classified as speech data, as an interference frame. The quality detection module 304 is used to delete the interference frames in the non-speech segment, calculate the signal-to-noise ratio with the speech segment, and determine the speech quality detection result of the audio data based at least on the signal-to-noise ratio.
[0085] Optionally, the classification module 302 is used to determine several candidate speech segments based on the speech classification results of each frame; from the candidate speech segments, determine those with a duration shorter than a preset pronunciation duration and record them; and determine those with a duration not shorter than the preset pronunciation duration as basic audio segments; expand the basic audio segments before and after according to a preset expansion duration to determine speech segments, and record the expanded speech segments; and treat the remaining part of the audio data as non-speech segments.
[0086] Optionally, the interference shielding module 303 is used to determine, based on the recorded data, a candidate speech segment with a duration shorter than a preset pronunciation duration; and to use each frame in the recorded candidate speech segment as an interference frame in the non-speech segment.
[0087] Optionally, the interference shielding module 303 is used to take the recorded candidate audio segments as candidate interference segments; for each candidate interference segment, the part of the candidate interference segment that is not divided into audio segments is taken as interference audio, and each interference frame is determined.
[0088] Optionally, the quality detection module 304 is used to delete the extended portion in the recorded extended portion of the speech segment; delete the interference frames in the non-speech segment; and calculate the signal-to-noise ratio based on the speech segment with the deleted extended portion and the non-speech segment with the deleted interference frames.
[0089] Optionally, the quality detection module 304 is used to perform pulse detection on the non-speech segment according to the pulse set threshold; when a pulse is determined to exist, the pulse portion in the non-speech segment is deleted or set to zero.
[0090] Optionally, the quality detection module 304 is used to delete the extended portion in the recorded extended portion of the speech segment; determine the duration and sound pressure value of the speech segment with the extended portion deleted; and determine the speech quality detection result of the audio data based on the signal-to-noise ratio, the duration, and the sound pressure value through a preset quality detection model.
[0091] This specification also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can be used to perform the speech quality detection method provided above.
[0092] based on Figure 1 The speech quality detection method shown in this specification is further illustrated in the embodiments. Figure 4 The diagram shows the structure of the electronic device. Figure 4 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the aforementioned voice quality detection method.
[0093] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A voice quality detection method, the method being applied to a head-mounted device, the method comprising: Obtain the audio data to be detected; The speech classification results of each frame are determined by a preset speech activity detection algorithm, so as to divide the audio data into speech segments and non-speech segments. Based on the speech classification results of each frame, the audio frames in the non-speech segments that are classified as speech data are determined as interference frames. After deleting the interfering frames in the non-speech segment, the signal-to-noise ratio (SNR) is calculated with the speech segment, and the speech quality detection result of the audio data is determined based at least on the SNR.
2. The method as described in claim 1, wherein dividing the audio data into speech segments and non-speech segments specifically includes: Based on the speech classification results of each frame, several candidate speech segments are determined; From the candidate speech segments, those with a duration shorter than the preset pronunciation duration are recorded; In addition, the audio segments whose duration is not less than the preset pronunciation duration are used as the basic audio segments; According to the preset extension duration, the basic audio segment is extended before and after to determine the speech segment, and the extended speech segment is recorded. The remainder of the audio data is treated as a non-speech segment.
3. The method as described in claim 2, wherein, based on the speech classification results of each frame, each audio frame in the non-speech segment whose classification result is speech data is determined as an interference frame, specifically includes: Based on the recorded data, select candidate speech segments with a duration shorter than the preset pronunciation duration; Each frame in the recorded candidate audio segment is used as an interference frame in the non-audio segment.
4. The method as described in claim 3, wherein each frame in the recorded candidate speech segment is used as an interference frame in the non-speech segment, specifically includes: The recorded speech segments to be selected are used as interference segments to be selected. For each candidate interference segment, the portion of the candidate interference segment that is not divided into speech segments is taken as interference audio, and each interference frame is determined.
5. The method as described in claim 2, wherein after deleting the interfering frames in the non-speech segment, the signal-to-noise ratio is calculated with that of the speech segment, specifically includes: Based on the recorded extended portion of the speech segment, delete the extended portion in the speech segment; Interference frames in the non-speech segments are deleted, and the signal-to-noise ratio is calculated based on the speech segments with deleted extended portions and the non-speech segments with deleted interference frames.
6. The method as described in claim 1, wherein after deleting the interfering frames in the non-speech segment and before calculating the signal-to-noise ratio with the speech segment, the method further comprises: Based on the threshold set by the pulse, pulse detection is performed on the non-speech segment; When a pulse is detected, the pulse portion in the non-speech segment is deleted or set to zero.
7. The method of claim 2, wherein determining the speech quality detection result of the audio data is based at least on the signal-to-noise ratio, comprising: Based on the recorded extended portion of the speech segment, delete the extended portion in the speech segment; Determine the duration and sound pressure level based on the deleted extended portion of the speech segment; Based on the signal-to-noise ratio, the duration, and the sound pressure level, the speech quality detection result of the audio data is determined using a preset quality detection model.
8. A device for voice quality detection, applied to a head-mounted device, comprising: The acquisition module is used to acquire the audio data to be detected; The classification module is used to determine the speech classification result of each frame through a preset speech activity detection algorithm, so as to divide the audio data into speech segments and non-speech segments; An interference shielding module is used to determine, based on the speech classification results of each frame, each audio frame in the non-speech segment that is classified as speech data, as an interference frame. The quality detection module is used to delete interference frames in the non-speech segment, calculate the signal-to-noise ratio (SNR) with the speech segment, and determine the speech quality detection result of the audio data based at least on the SNR.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method described in any one of claims 1-7.