+

CN116721678B - Audio data monitoring method, electronic equipment and medium - Google Patents

Audio data monitoring method, electronic equipment and medium Download PDF

Info

Publication number
CN116721678B
CN116721678B CN202211203793.8A CN202211203793A CN116721678B CN 116721678 B CN116721678 B CN 116721678B CN 202211203793 A CN202211203793 A CN 202211203793A CN 116721678 B CN116721678 B CN 116721678B
Authority
CN
China
Prior art keywords
audio data
audio
monitored
frame
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211203793.8A
Other languages
Chinese (zh)
Other versions
CN116721678A (en
Inventor
高张艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211203793.8A priority Critical patent/CN116721678B/en
Publication of CN116721678A publication Critical patent/CN116721678A/en
Application granted granted Critical
Publication of CN116721678B publication Critical patent/CN116721678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

本申请涉及计算机技术领域,公开了一种音频数据的监测方法、电子设备以及介质,该方法包括:获取待监测音频数据,待监测音频数据具有第一音频格式;基于第一音频格式,采用预设处理方式将待监测音频数据分为多个音频数据帧;确定各音频数据帧所属的声道类型;将每个声道对应的音频数据帧中数值满足预设条件的音频数据帧的信息打印到所述电子设备的日志中。基于此,可以避免由于待监测的音频数据的格式与格式处理方式不同,使得音频数据流检测模块得到的音频数据检测结果出现错误的情况。

The present application relates to the field of computer technology, and discloses a method for monitoring audio data, an electronic device, and a medium, the method comprising: obtaining audio data to be monitored, the audio data to be monitored having a first audio format; based on the first audio format, using a preset processing method to divide the audio data to be monitored into a plurality of audio data frames; determining the channel type to which each audio data frame belongs; and printing the information of the audio data frames whose values in the audio data frames corresponding to each channel meet preset conditions into the log of the electronic device. Based on this, it can be avoided that the audio data detection result obtained by the audio data stream detection module is erroneous due to the different formats of the audio data to be monitored and the different formats processing methods.

Description

音频数据的监测方法、电子设备以及介质Audio data monitoring method, electronic device and medium

技术领域Technical Field

本申请涉及计算机技术领域,特别涉及一种音频数据的监测方法、电子设备以及介质。The present application relates to the field of computer technology, and in particular to a method, electronic device and medium for monitoring audio data.

背景技术Background technique

音频数据可以作为信息传递的载体。在生活中,用户可以利用手机播放音频数据。例如,用户在听音乐时,利用手机播放媒体音频数据,用户在打电话时,利用手机播放电话音频数据等。然而,在用户的使用过程中,会出现手机无声或者声音的大小和预期差别很大的情况。所以,需要一种音频数据的监测方法,将当前音频数据流的信息实时的打印出来,以便于后台的维测人员能够根据打印出的音频数据流的信息解决无声或者声音的大小和预期差别很大的问题。Audio data can be used as a carrier for information transmission. In life, users can use mobile phones to play audio data. For example, when listening to music, users use mobile phones to play media audio data, and when making a call, users use mobile phones to play telephone audio data. However, during the user's use, the mobile phone may be silent or the volume of the sound may be very different from the expected. Therefore, a method for monitoring audio data is needed to print out the information of the current audio data stream in real time, so that the maintenance personnel in the background can solve the problem of silence or the volume of the sound being very different from the expected according to the information of the printed audio data stream.

现有技术中,在对待监测的音频数据流实时打印的过程中,由于音频数据的监测方法是基于特定平台开发的,所以会以固定的音频数据处理方式对待监测的音频数据进行处理,例如,以处理格式为PCM 32bit LE的音频数据的方式,处理所有的音频数据。但是,不同的平台支持不同的音频数据格式,例如,有PCM 24bit LE、PCM 16bit LE等格式,当以固定的音频数据处理方式处理不同格式的音频数据后,会致使打印出的音频数据的信息明显错误,例如,打印出的音频数据的大小错误,从而影响后台的维测人员解决出现无声以及声音的大小和预期差别很大的问题的效率。In the prior art, in the process of real-time printing of the monitored audio data stream, since the audio data monitoring method is developed based on a specific platform, the monitored audio data will be processed in a fixed audio data processing manner, for example, all audio data will be processed in the same manner as audio data in the PCM 32bit LE format. However, different platforms support different audio data formats, for example, there are PCM 24bit LE, PCM 16bit LE and other formats. When audio data of different formats are processed in a fixed audio data processing manner, the information of the printed audio data will be obviously wrong, for example, the size of the printed audio data is wrong, thereby affecting the efficiency of the back-end maintenance personnel in solving the problem of silence and the sound volume being very different from the expected.

发明内容Summary of the invention

本申请实施例的目的在于提供一种音频数据的监测方法、电子设备以及介质,使得在对音频数据监测时,可以以待监测的音频数据对应的处理方式处理,从而避免由于待监测的音频数据的格式与处理方式不同,使得音频数据检测结果出现错误的情况,进而提高后台的维测人员解决出现无声以及声音的大小和预期差别很大的问题的效率。The purpose of the embodiments of the present application is to provide an audio data monitoring method, electronic device and medium, so that when monitoring audio data, it can be processed in a processing method corresponding to the audio data to be monitored, thereby avoiding the situation where the audio data detection results are erroneous due to the different formats and processing methods of the audio data to be monitored, thereby improving the efficiency of back-end maintenance personnel in solving problems such as silence and sound volume being very different from expectations.

第一方面,本申请实施例提供了一种音频数据的监测方法,应用于电子设备,包括,In a first aspect, an embodiment of the present application provides a method for monitoring audio data, which is applied to an electronic device, comprising:

获取待监测音频数据,待监测音频数据具有第一音频格式;Acquire audio data to be monitored, where the audio data to be monitored has a first audio format;

基于第一音频格式,采用预设处理方式将待监测音频数据分为多个音频数据帧;Based on the first audio format, the audio data to be monitored is divided into a plurality of audio data frames by using a preset processing method;

确定各音频数据帧所属的声道类型;Determine the channel type to which each audio data frame belongs;

将每个声道对应的音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中。Information of the audio data frames corresponding to each channel whose values meet the preset conditions is printed into the log of the electronic device.

可以理解的,在电子设备获取到具有第一音频格式的待监测音频数据后,采用与第一音频格式相对应的预设处理方式将待监测音频数据分为多个音频数据帧,此时避免了对于不同音频格式采用同一处理方式带来的问题,然后再确定各音频数据帧所属的声道类型,将每个声道对应的音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中。此时,打印出来的音频数据帧的信息就是正确的,从而可以提高后台的维测人员根据监测结果解决音频数据播放过程中出现的声音大小和预期差别很大、或者产生无声的问题,提高维测人员解决问题的效率。It can be understood that after the electronic device obtains the audio data to be monitored in the first audio format, the preset processing method corresponding to the first audio format is used to divide the audio data to be monitored into multiple audio data frames, which avoids the problem of using the same processing method for different audio formats, and then determines the channel type to which each audio data frame belongs, and prints the information of the audio data frame whose value meets the preset conditions in the audio data frame corresponding to each channel into the log of the electronic device. At this time, the information of the printed audio data frame is correct, so that the maintenance personnel in the background can solve the problem of the sound volume being very different from the expected or the sound being silent during the audio data playback process according to the monitoring results, and improve the efficiency of the maintenance personnel in solving the problem.

在上述第一方面的一种可能实现中,基于第一音频格式,采用预设处理方式将待监测音频数据分为多个音频数据帧,包括,In a possible implementation of the first aspect, based on the first audio format, the audio data to be monitored is divided into a plurality of audio data frames using a preset processing method, including:

对应于第一音频格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特相同,从待监测音频数据中,将每次以预设数据读取量读取的音频数据作为一帧音频数据帧。The frame size N bits of the audio data frame corresponding to the first audio format is the same as the preset data reading amount M bits of the preset processing method. From the audio data to be monitored, the audio data read each time with the preset data reading amount is taken as an audio data frame.

在上述第一方面的一种可能实现中,基于第一音频格式,采用预设处理方式将待监测音频数据分为多个音频数据帧,包括,In a possible implementation of the first aspect, based on the first audio format, the audio data to be monitored is divided into a plurality of audio data frames using a preset processing method, including:

对应于第一音频格式对应的音频数据帧的帧大小N比特大于预设处理方式的预设数据读取量M比特,每次从待监测音频数据的N比特数据中,选取M比特高位的数据作为一帧音频数据帧。The frame size N bits of the audio data frame corresponding to the first audio format is greater than the preset data reading amount M bits of the preset processing method. Each time, M bits of high-order data are selected from the N bits of audio data to be monitored as a frame of audio data.

在上述第一方面的一种可能实现中,基于第一音频格式,采用预设处理方式将待监测音频数据分为多个音频数据帧,包括,In a possible implementation of the first aspect, based on the first audio format, the audio data to be monitored is divided into a plurality of audio data frames using a preset processing method, including:

对应于第一音频格式对应的音频数据帧的帧大小N比特小于预设处理方式的预设数据读取量M比特,每次从待监测音频数据中读取N比特音频数据作为一帧音频数据帧。The frame size N bits of the audio data frame corresponding to the first audio format is smaller than the preset data reading amount M bits of the preset processing method, and N bits of audio data are read from the audio data to be monitored each time as one audio data frame.

在上述第一方面的一种可能实现中,第一音频格式包括PCM 16bit LE、PCM 24bitLE、PCM 32bit LE中的任意一种;并且In a possible implementation of the first aspect, the first audio format includes any one of PCM 16bit LE, PCM 24bitLE, and PCM 32bit LE; and

预设数据读取量包括8bit、16bit、24bit、32bit中的任意一种。The preset data reading amount includes any one of 8 bits, 16 bits, 24 bits, and 32 bits.

在上述第一方面的一种可能实现中,音频数据帧所属的声道类型包括左声道和右声道;并且In a possible implementation of the first aspect, the channel type to which the audio data frame belongs includes a left channel and a right channel; and

将每个声道对应的音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中,包括:Printing information of the audio data frames corresponding to each channel whose values meet the preset conditions to the log of the electronic device, including:

将待监测数据中,属于左声道的音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中,并且,Print information of audio data frames belonging to the left channel in the data to be monitored, whose values meet the preset conditions, into the log of the electronic device, and,

将待监测数据中,属于右声道的音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中。The information of the audio data frames belonging to the right channel in the data to be monitored, whose values meet the preset conditions, is printed into the log of the electronic device.

在上述第一方面的一种可能实现中,音频数据帧所属的声道类型为单声道;并且In a possible implementation of the first aspect, the channel type to which the audio data frame belongs is mono; and

将每个声道对应的音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中,包括:Printing information of the audio data frames corresponding to each channel whose values meet the preset conditions to the log of the electronic device, including:

将音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中。Information of audio data frames whose values meet preset conditions in the audio data frames is printed into a log of the electronic device.

在上述第一方面的一种可能实现中,音频数据帧的信息,包括,满足预设条件的音频数据帧和/或满足预设条件的音频数据帧对应的分贝值。In a possible implementation of the first aspect above, the information of the audio data frame includes an audio data frame that meets a preset condition and/or a decibel value corresponding to the audio data frame that meets the preset condition.

在上述第一方面的一种可能实现中,数值满足预设条件包括:音频数据帧中的数值为最大值。In a possible implementation of the first aspect, the value satisfies a preset condition including: the value in the audio data frame is a maximum value.

第二方面,本申请实施例提供了一种音频数据的监测方法,应用于电子设备,电子设备包括音频流检测模块,并且音频流检测模块执行下述方法,包括:In a second aspect, an embodiment of the present application provides a method for monitoring audio data, which is applied to an electronic device, wherein the electronic device includes an audio stream detection module, and the audio stream detection module executes the following method, including:

获取待监测音频数据,待监测音频数据具有第一音频格式;Acquire audio data to be monitored, where the audio data to be monitored has a first audio format;

基于第一音频格式,采用预设处理方式将所述待监测音频数据分为多个音频数据帧;Based on the first audio format, the audio data to be monitored is divided into a plurality of audio data frames by using a preset processing method;

确定各音频数据帧所属的声道类型;Determine the channel type to which each audio data frame belongs;

将每个声道对应的音频数据帧中数值满足预设条件的音频数据帧的信息打印到电子设备的日志中。Information of the audio data frames corresponding to each channel whose values meet the preset conditions is printed into the log of the electronic device.

第三方面,本申请实施例提供了一种电子设备,包括:In a third aspect, an embodiment of the present application provides an electronic device, including:

一个或多个处理器;one or more processors;

一个或多个存储器;一个或多个存储器存储有一个或多个程序,当一个或者多个程序被一个或多个处理器执行时,使得电子设备执行上述第一方面以及第一方面的各种实现中的任一项所述音频数据的监测方法。One or more memories; one or more memories store one or more programs, and when one or more programs are executed by one or more processors, the electronic device executes the audio data monitoring method described in the first aspect and any one of the various implementations of the first aspect.

第四方面,本申请实施例提供了一种计算机可读存储介质,其特征在于,存储介质上存储有指令,指令在计算机上执行时使计算机执行上述第一方面以及第一方面的各种实现中的任一项所述音频数据的监测方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that instructions are stored on the storage medium, and when the instructions are executed on a computer, the computer executes the audio data monitoring method described in the first aspect and any one of the various implementations of the first aspect.

第五方面,本申请实施例提供了一种计算机程序产品,其特征在于,所述计算机程序产品包括指令,该指令在执行时使计算机执行上述第一方面以及第一方面的各种实现中的任一项所述音频数据的监测方法。In a fifth aspect, an embodiment of the present application provides a computer program product, characterized in that the computer program product includes instructions, which, when executed, enable a computer to execute the audio data monitoring method described in the first aspect and any one of the various implementations of the first aspect.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1根据本申请的一些实施例,示出了一种手机100播放音乐的场景示意图;FIG1 is a schematic diagram showing a scenario in which a mobile phone 100 plays music according to some embodiments of the present application;

图2A根据本申请的一些实施例,示出了一种PCM 32bit LE格式的数据示意图;FIG2A shows a data schematic diagram of a PCM 32-bit LE format according to some embodiments of the present application;

图2B根据本申请的一些实施例,示出了一种PCM 32bit LE格式的音频数据帧示意图;FIG2B shows a schematic diagram of an audio data frame in PCM 32-bit LE format according to some embodiments of the present application;

图2C根据本申请的一些实施例,示出了一种与声道数对应的PCM 32bit LE格式音频数据帧示意图;FIG2C shows a schematic diagram of a PCM 32-bit LE format audio data frame corresponding to the number of channels according to some embodiments of the present application;

图2D根据本申请的一些实施例,示出了一种PCM 16bit LE格式的数据示意图;FIG2D shows a data schematic diagram of a PCM 16-bit LE format according to some embodiments of the present application;

图2E根据本申请的一些实施例,示出了一种打印到日志中的结果示意图;FIG2E is a schematic diagram showing a result printed into a log according to some embodiments of the present application;

图2F根据本申请的一些实施例,示出了另一种打印到日志中的结果示意图;FIG2F shows another schematic diagram of a result printed into a log according to some embodiments of the present application;

图3根据本申请的一些实施例,示出了一种将PCM 24bit LE格式转换为每帧为16bit的音频数据的示意图;FIG3 is a schematic diagram showing a method of converting a PCM 24-bit LE format into audio data with 16 bits per frame according to some embodiments of the present application;

图4A根据本申请的一些实施例,示出了一种音频数据的监测方法流程示意图;FIG4A is a schematic diagram showing a flow chart of a method for monitoring audio data according to some embodiments of the present application;

图4B根据本申请的一些实施例,示出了一种与声道数对应的PCM 16bit LE格式音频数据帧示意图;FIG4B shows a schematic diagram of a PCM 16-bit LE format audio data frame corresponding to the number of channels according to some embodiments of the present application;

图4C根据本申请的一些实施例,示出了一种基于获取的格式信息,采用预设处理方式将待监测音频数据的具体方式流程示意图;FIG4C is a schematic diagram showing a specific method of processing the audio data to be monitored in a preset processing manner based on the acquired format information according to some embodiments of the present application;

图4D根据本申请的一些实施例,示出了一种对于24字节的PCM 16bit LE音频数据,将每次以预设数据读取量16bit读取的音频数据作为一帧音频数据帧;FIG. 4D shows a method for taking the audio data read at a preset data reading amount of 16 bits each time as an audio data frame for 24-byte PCM 16-bit LE audio data according to some embodiments of the present application;

图5A根据本申请的一些实施例,示出了一种音频系统软件结构示意图;FIG5A shows a schematic diagram of an audio system software structure according to some embodiments of the present application;

图5B根据本申请的一些实施例,示出了一种音频数据的监测的交互示意图;FIG5B shows an interactive schematic diagram of monitoring audio data according to some embodiments of the present application;

图6根据本申请的实施例,示出了一种手机100的硬件结构示意图。FIG6 shows a schematic diagram of the hardware structure of a mobile phone 100 according to an embodiment of the present application.

具体实施方式Detailed ways

本申请的说明性实施例包括但不限于一种音频数据的监测方法、电子设备以及介质。The illustrative embodiments of the present application include, but are not limited to, a method for monitoring audio data, an electronic device, and a medium.

为了方便理解,下面先对本申请中的术语进行介绍。For ease of understanding, the terms used in this application are first introduced below.

PCM(Pulse Code Modulation):也被称为脉冲编码调制。PCM音频数据是未经压缩的音频采样数据裸流,它是由模拟信号经过采样、量化、编码转换成的标准的数字音频数据。PCM (Pulse Code Modulation): also known as pulse code modulation. PCM audio data is an uncompressed audio sampling data stream. It is a standard digital audio data converted from analog signals through sampling, quantization, and encoding.

日志(log):通常是系统或者某些软件对已完成的某种处理的记录,以便将来作为参考,它并没有固定的格式,通常是文本文件,可以用记事本打开以查看内容,当然很可能是其它格式,直接打开就是乱码。Log: Usually a record of a certain process completed by the system or some software for future reference. It does not have a fixed format and is usually a text file that can be opened with Notepad to view the content. Of course, it may be in other formats and will be garbled if opened directly.

下面结合附图详细说明本申请实施例的技术方案。The technical solution of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

图1根据本申请的一些实施例,示出了手机100播放音乐的场景。在一些情况下,当用户利用手机100播放音乐时,会突然出现无声的情况。在另一些情况下,用户切换音频播放设备,例如将耳机切换到扬声器时,会产生音量突然变小的问题。为了解决前述两种情况下的涉及到的音频问题,手机100中的音频流检测(Audio Stream Detection,ASD)模块可以在手机100输出音频数据的同时,获取所要输出的音频数据,然后将所要输出的音频数据打印出来,保存到日志(log)中。从而,使得后台的维测人员可以能够根据打印出的音频数据流的信息实时监测音频数据的变化情况,从而解决无声以及声音的大小和预期差别很大的问题。FIG. 1 shows a scene of a mobile phone 100 playing music according to some embodiments of the present application. In some cases, when a user uses the mobile phone 100 to play music, silence may occur suddenly. In other cases, when a user switches an audio playback device, such as switching a headset to a speaker, the volume may suddenly decrease. In order to solve the audio problems involved in the above two cases, the audio stream detection (Audio Stream Detection, ASD) module in the mobile phone 100 can obtain the audio data to be output while the mobile phone 100 outputs the audio data, and then print out the audio data to be output and save it in a log. Thus, the maintenance personnel in the background can monitor the changes in the audio data in real time according to the information of the printed audio data stream, thereby solving the problems of silence and the sound size being very different from the expected.

在一些实施例中,ASD模块在接收到待监测的音频数据后,以固定的方式对待监测的音频数据进行处理,例如以处理格式为PCM 32bit LE的音频数据的方式,处理所有的音频数据。图2A示出了一种PCM 32bit LE格式的音频数据,其中,在该格式中,每帧音频数据的数据大小为32bit。并且,图2A中所示的音频数据的数据大小为48字节,声道数为2。当以PCM 32bit LE的处理格式处理该音频数据时,每次从待监测音频数据中读取32bit大小的数据,图2A所示的数据总共需要读取12次,最终得到如图2B所示的音频数据帧0、音频数据帧1、......、音频数据帧11,即12帧音频数据。In some embodiments, after receiving the audio data to be monitored, the ASD module processes the audio data to be monitored in a fixed manner, for example, in a manner of processing audio data in a PCM 32bit LE format, and processes all audio data. FIG. 2A shows audio data in a PCM 32bit LE format, wherein in this format, the data size of each frame of audio data is 32bit. Moreover, the data size of the audio data shown in FIG. 2A is 48 bytes, and the number of channels is 2. When the audio data is processed in the processing format of PCM 32bit LE, each time 32bit of data is read from the audio data to be monitored, the data shown in FIG. 2A needs to be read 12 times in total, and finally the audio data frame 0, audio data frame 1, ..., audio data frame 11, i.e., 12 frames of audio data, are obtained as shown in FIG. 2B.

然后,根据声道数为2,可以确定12帧音频数据分别所对应的左右声道。例如,如图2C所示,音频数据帧0对应于左声道为L0、音频数据帧1应于右声道为R1、......、音频数据帧10对应于左声道为L10、音频数据帧11对应于右声道为R11。Then, according to the number of channels being 2, the left and right channels corresponding to the 12 frames of audio data can be determined. For example, as shown in FIG2C , the audio data frame 0 corresponds to the left channel as L0, the audio data frame 1 corresponds to the right channel as R1, ..., the audio data frame 10 corresponds to the left channel as L10, and the audio data frame 11 corresponds to the right channel as R11.

由于每个声道的音频数据的最大值,可以代表该声道的所有音频数据的大小情况,故可以从左声道的音频数据中,即L0、L2......L10中找到最大的音频数据值,将其转换成分贝值打印出来,以及从右声道的音频数据中,即R1、......R11中找到最大的音频数据量,将其转换成分贝值打印出来以便于维测人员根据音频数据的分贝值更加直接的观察音频数据的大小变化情况。需要解释的,当打印出的最大的音频数据值为0时,则代表此时没有声音,并且音频数据正常情况下打印出的分贝值应该在-100~0dB范围内。Since the maximum value of the audio data of each channel can represent the size of all the audio data of the channel, the maximum audio data value can be found from the audio data of the left channel, i.e., L0, L2...L10, and converted into decibel values for printing, and the maximum audio data volume can be found from the audio data of the right channel, i.e., R1,...R11, and converted into decibel values for printing, so that the maintenance personnel can more directly observe the size changes of the audio data according to the decibel values of the audio data. It needs to be explained that when the maximum audio data value printed is 0, it means that there is no sound at this time, and the decibel value printed out of the audio data under normal circumstances should be within the range of -100 to 0dB.

但是,不同的手机平台的待监测的音频数据会存在不同的格式,或者同一平台会存在不同格式的音频数据。例如,有PCM 24bit LE、PCM 16bit LE等格式。但是对不同格式的音频数据会按照同一格式处理。例如,待监测的音频数据的格式为PCM 16bit LE格式,则每16bit为一帧音频数据,数据总量为24字节,声道数为2。在具体对音频数据处理的过程中,如果还是按照PCM 32bit LE格式进行处理,即每次从PCM 16bit LE格式的音频数据中读取32bit的音频数据,则会每次将两个音频帧的数据读取为一个音频帧的数据,从而使得读取出的数据出错。However, the audio data to be monitored may have different formats on different mobile phone platforms, or audio data of different formats may exist on the same platform. For example, there are formats such as PCM 24bit LE and PCM 16bit LE. However, audio data of different formats will be processed in the same format. For example, if the format of the audio data to be monitored is PCM 16bit LE, then each 16 bits is a frame of audio data, the total amount of data is 24 bytes, and the number of channels is 2. In the specific process of processing the audio data, if it is still processed according to the PCM 32bit LE format, that is, each time 32bit audio data is read from the audio data in the PCM 16bit LE format, the data of two audio frames will be read as the data of one audio frame each time, which will cause the read data to be erroneous.

例如,在处理如图2D所示的PCM 16bit LE格式的音频数据时,每次从待监测的音频数据中读取32bit的数据,会每次将两个16bit大小的音频数据帧读取为一个音频帧的数据,从而读取错误。然后,再从读取的数据中分别找到左右声道中最大的音频数据值,以及将其转化为分贝值打印出来时,打印结果会不正确。例如,图2E示出了一种以PCM 32bit LE的音频格式处理PCM 16bit LE的音频数据后,打印出来的结果,比如说框2001a中,左声道“L”中的最大的音频数据值为“8388485”,对应的分贝值为“48.164672db”,右声道“R”中的最大的音频数据值为“8388608”,对应的分贝值为“48.16799db”。可以理解的,16bit大小的数据所对应的最大10进制值数为32767,而“8388485”以及“8388608”大于32767,超过了16bit可表示的数据最大范围,并且左右声道所对应的分贝值超出了-100~0dB范围,所以打印出的数值是错误的,没有实际反映当前音频数据的大小,从而影响后台的维测人员解决无声问题或者解决在切换设备而没有调整音量的情况下,所播放的声音的大小发生变化的问题。For example, when processing the audio data of the PCM 16bit LE format as shown in Figure 2 D, read the data of 32bit from the audio data to be monitored at each time, can read the data of two 16bit audio data frames as an audio frame at each time, thereby read error.Then, find the maximum audio data value in the left and right channels respectively from the data read, and convert it into decibel value and print it out, the print result can be incorrect.For example, Fig. 2 E shows a kind of audio data of processing PCM 16bit LE with the audio format of PCM 32bit LE, the result printed out, for example in frame 2001a, the maximum audio data value in left channel " L " is " 8388485 ", corresponding decibel value is " 48.164672db ", the maximum audio data value in right channel " R " is " 8388608 ", corresponding decibel value is " 48.16799db ". It is understandable that the maximum decimal value corresponding to 16-bit data is 32767, while "8388485" and "8388608" are greater than 32767, exceeding the maximum range of data that can be represented by 16 bits, and the decibel values corresponding to the left and right channels exceed the range of -100 to 0dB, so the printed value is wrong and does not actually reflect the size of the current audio data, which affects the background maintenance personnel in solving the silent problem or solving the problem of changes in the volume of the sound played when switching devices without adjusting the volume.

为了解决上述问题,本申请提出了一种音频数据的监测方法,在获取待监测音频数据的同时,还获取待监测音频数据的格式信息,然后以获取的格式所对应的格式处理方式处理待监测的音频数据,从而避免打印出来的音频数据的大小由于格式处理方式不合适而出现错误的数值问题。In order to solve the above problems, the present application proposes a method for monitoring audio data. While obtaining the audio data to be monitored, the format information of the audio data to be monitored is also obtained, and then the audio data to be monitored is processed using a format processing method corresponding to the obtained format, thereby avoiding the problem of incorrect numerical values in the size of the printed audio data due to inappropriate format processing method.

例如,在获取到如图2D所示的待监测的音频数据以及对应的信息,包括格式、声道数和数据总量信息后,以与PCM 16bit LE格式相对应的格式处理方式进行处理,每次从待监测的音频数据中读取16bit大小的音频数据,总共读取12次。然后,根据声道数2,分别找到左右声道中的最大音频数据值,将找到的最大音频数据值转换成分贝值实时打印出来。例如,图2F中示出了一种以PCM 16bit LE的音频格式处理PCM 16bit LE的音频数据后,打印出来的结果。比如说框2002中,左声道“L”中最大音频数据为“1”,对应的分贝值为“-90.308999db”;右声道“R”中最大音频数据也为“1”,对应的分贝值也为“-90.308999db”。可以理解的,图2F中打印出的5组数据与图2E中的打印出的音频数据的值是不同的,变化很大。For example, after obtaining the audio data to be monitored as shown in Figure 2D and the corresponding information, including the format, the number of channels and the total amount of data information, the audio data to be monitored is processed in a format processing method corresponding to the PCM 16bit LE format, and the audio data of 16bit size is read from the audio data to be monitored each time, and a total of 12 times are read. Then, according to the number of channels 2, the maximum audio data values in the left and right channels are found respectively, and the maximum audio data values found are converted into decibel values and printed out in real time. For example, Figure 2F shows a result printed out after processing the audio data of PCM 16bit LE in the audio format of PCM 16bit LE. For example, in box 2002, the maximum audio data in the left channel "L" is "1", and the corresponding decibel value is "-90.308999db"; the maximum audio data in the right channel "R" is also "1", and the corresponding decibel value is also "-90.308999db". It can be understood that the values of the five sets of data printed out in FIG. 2F and the audio data printed out in FIG. 2E are different and vary greatly.

另外,可以设置一个数据读取量,将获取的音频数据格式对应的每帧数据大小与预设数据读取量比较,如果每帧数据大小比预设数据读取量大,则在将获取的音频数据划分为多个音频帧时,将每帧音频数据中与预设数据读取量对应的高位数据截取出来,得到与预设数据读取量大小对应的音频数据帧。然后,再根据声道数找到对应的声道中的满足预设条件的音频数据值,并且将找到的满足预设条件的音频数据信息实时打印出来,这种处理方式使得不同格式的音频数据值被处理后大小在一定范围内,以便统一打印。其中,预设条件包括最大值、次大值或者平均值等中的任意一种。In addition, a data reading amount can be set, and the size of each frame of data corresponding to the obtained audio data format is compared with the preset data reading amount. If the size of each frame of data is larger than the preset data reading amount, when the obtained audio data is divided into multiple audio frames, the high-order data corresponding to the preset data reading amount in each frame of audio data is intercepted to obtain an audio data frame corresponding to the preset data reading amount. Then, the audio data value that meets the preset conditions in the corresponding channel is found according to the number of channels, and the audio data information that meets the preset conditions is printed out in real time. This processing method makes the audio data values of different formats within a certain range after processing, so as to be printed uniformly. Among them, the preset conditions include any one of the maximum value, the second largest value or the average value.

例如,以预设条件为最大值为例,若预设数据读取量为16bit,如果当前获取的待监测的音频数据的格式为PCM 24bit LE,声道数2,数据总量为36字节,则可以确定获取的待监测的音频数据的每帧数据大小大于预设数据读取量。先根据获取的音频数据格式PCM24bit LE,将待监测的音频数据中每24bit数据中的16bit截取出来作为新的音频数据帧。图3中的数据总共截取出12帧16bit大小的音频数据,分别为音频数据0’,音频数据1’......音频数据11’。然后根据声道数2,可以确定各音频数据对应的声道,得到L0’、R1’......R11’,再分别确定左右声道中的最大值,将最大值以及最大值转化的分贝值打印出来。For example, taking the preset condition as the maximum value as an example, if the preset data reading amount is 16 bits, if the format of the currently acquired audio data to be monitored is PCM 24bit LE, the number of channels is 2, and the total amount of data is 36 bytes, then it can be determined that the data size of each frame of the acquired audio data to be monitored is greater than the preset data reading amount. First, according to the acquired audio data format PCM24bit LE, 16 bits of each 24bit data in the audio data to be monitored are intercepted as new audio data frames. The data in Figure 3 intercepts a total of 12 frames of 16bit audio data, which are audio data 0', audio data 1'...audio data 11'. Then, according to the number of channels 2, the channels corresponding to each audio data can be determined, and L0', R1'...R11' are obtained, and then the maximum values in the left and right channels are determined respectively, and the maximum value and the decibel value converted from the maximum value are printed out.

可以理解的,对不同格式的音频数据采用不同的处理方式,可以避免某个平台采用特定格式处理,使得打印出的音频数据出现错误,从而可以提高后台的维测人员根据监测结果解决音频数据播放过程中出现的声音大小和预期差别很大的情况、或者产生无声的问题,提高维测人员解决问题的效率。It is understandable that using different processing methods for audio data in different formats can avoid a certain platform using a specific format, which may cause errors in the printed audio data. This can improve the ability of back-end maintenance personnel to solve problems such as the sound volume being very different from expectations or silence during audio data playback based on monitoring results, thereby improving the efficiency of maintenance personnel in solving problems.

可以理解的,本申请的技术方案可以适用于不同平台,比如说,海思平台TM、MTKTM(MediaTek)平台、高通TM平台、TITM(Tencent Cloud TI Platform)、摩托罗拉TM、飞利浦TM、ADITM(Analog Devices,Inc.)、展讯TM、英飞凌TM、凯明TM等。It can be understood that the technical solution of the present application can be applicable to different platforms, for example, HiSilicon platform TM , MTK TM (MediaTek) platform, Qualcomm TM platform, TI TM (Tencent Cloud TI Platform), Motorola TM , Philips TM , ADI TM (Analog Devices, Inc.), Spreadtrum TM , Infineon TM , Kaiming TM , etc.

可以理解的,本申请的技术方案除了适用于如前文提到的手机,还适用于其他电子设备,例如,可以是平板电脑、智慧屏、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personalcomputer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备。可以理解的是,本申请实施例对电子设备的具体类型不作任何限制。It is understandable that the technical solution of the present application is applicable not only to the mobile phones mentioned above, but also to other electronic devices, for example, tablet computers, smart screens, augmented reality (AR)/virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. It is understandable that the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

图4A根据本申请的一些实施例,示出了一种以与接收到的格式相对应的处理方法处理待监测的音频数据的技术方法流程图。以ASD模块为执行主体,所述方法包括:FIG4A shows a flowchart of a technical method for processing the audio data to be monitored in a processing method corresponding to the received format according to some embodiments of the present application. With the ASD module as the execution body, the method includes:

S401,获取待监测的音频数据以及对应的信息,包括格式、声道数和数据总量。S401, obtaining audio data to be monitored and corresponding information, including format, number of channels and total amount of data.

例如,获取的待监测的音频数据的格式为PCM 24bit LE,声道数为2,数据总量为36字节。For example, the format of the acquired audio data to be monitored is PCM 24bit LE, the number of channels is 2, and the total amount of data is 36 bytes.

又例如,获取的待监测的音频数据的格式为PCM 16bit LE,声道数为2,数据总量为24字节。For another example, the format of the acquired audio data to be monitored is PCM 16bit LE, the number of channels is 2, and the total amount of data is 24 bytes.

S402,基于获取的格式,采用预设处理方式将待监测音频数据分为多个音频数据帧。S402: Based on the acquired format, the audio data to be monitored is divided into a plurality of audio data frames by using a preset processing method.

可以理解的,预设处理方式是基于预设数据读取量M比特确定的。根据对应于获取的格式对应的音频数据帧的帧大小N比特与预设处理方式中的预设数据读取量M比特大小关系不同,可以设定不同的处理方式。例如,当对应于获取的格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特相同时,从待监测音频数据中,确定每次以预设数据读取量读取的音频数据作为一帧音频数据帧;也可以当对应于获取的格式对应的音频数据帧的帧大小N比特大于预设处理方式的预设数据读取量M比特,每次从待监测音频数据的N比特数据中,选取M比特高位的数据作为一帧音频数据帧,还可以对应于第一音频格式对应的音频数据帧的帧大小N比特小于预设处理方式的预设数据读取量M比特,每次从待监测音频数据中读取N比特音频数据作为一帧音频数据帧。It can be understood that the preset processing method is determined based on the preset data reading amount M bits. Different processing methods can be set according to the different size relationship between the frame size N bits of the audio data frame corresponding to the acquired format and the preset data reading amount M bits in the preset processing method. For example, when the frame size N bits of the audio data frame corresponding to the acquired format is the same as the preset data reading amount M bits of the preset processing method, the audio data read each time with the preset data reading amount is determined from the audio data to be monitored as a frame of audio data frame; it is also possible that when the frame size N bits of the audio data frame corresponding to the acquired format is greater than the preset data reading amount M bits of the preset processing method, each time from the N bits of the audio data to be monitored, M bits of high-order data are selected as a frame of audio data frame; it is also possible that the frame size N bits of the audio data frame corresponding to the first audio format is less than the preset data reading amount M bits of the preset processing method, and N bits of audio data are read from the audio data to be monitored each time as a frame of audio data frame.

上述S402所示例的具体执行过程在下文图4C中将进行具体说明,在此不再赘述。The specific execution process of the above-mentioned S402 example will be specifically described in FIG. 4C below, and will not be repeated here.

S403,根据声道数确定各声道对应的音频数据。S403: Determine the audio data corresponding to each channel according to the number of channels.

可以理解,在已知声道数信息和音频帧数,就可以知道音频数据帧的排列规律,从而可以确定对应的声道的音频数据帧的位置,例如,声道数为2,则声道包括左声道和右声道,而音频数据帧的排列规律为左声道、右声道依次交替排列的。所以根据声道数,就可以知道左声道的音频数据帧的位置,以及右声道的音频数据帧的位置,从而确定各声道对应的音频数据。若声道数为1,则是单声道。It can be understood that when the number of channels and the number of audio frames are known, the arrangement rule of the audio data frames can be known, so that the position of the audio data frames of the corresponding channels can be determined. For example, if the number of channels is 2, the channels include the left channel and the right channel, and the arrangement rule of the audio data frames is that the left channel and the right channel are arranged alternately in sequence. Therefore, according to the number of channels, the position of the audio data frame of the left channel and the position of the audio data frame of the right channel can be known, so as to determine the audio data corresponding to each channel. If the number of channels is 1, it is mono.

例如,以在当对应于获取的格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特相同的情况为例,图4B示出了在对PCM 16bit LE音频数据采用预设处理方式分为了12个音频数据帧后,根据声道数2确定各声道对应的音频数据帧为,音频数据0对应于左声道为L0、音频数据1对应于右声道为R1......、音频数据11对应于右声道为R11。For example, taking the case where the frame size N bits of the audio data frame corresponding to the acquired format is the same as the preset data reading amount M bits of the preset processing method, Figure 4B shows that after the PCM 16bit LE audio data is divided into 12 audio data frames using the preset processing method, the audio data frames corresponding to each channel are determined according to the channel number 2, audio data 0 corresponds to the left channel as L0, audio data 1 corresponds to the right channel as R1..., and audio data 11 corresponds to the right channel as R11.

S404,找到对应声道中的最大音频数据值,将找到的最大值以及该最大值转换的分贝值打印出来。S404, finding the maximum audio data value in the corresponding channel, and printing out the found maximum value and the decibel value converted from the maximum value.

当音频数据为双声道时,分别找到左右声道中的最大音频数据值,将找到的最大值以及该最大值转换的分贝值打印出来;当音频数据为单声道时,找到音频数据中的最大音频数据值,将找到的最大值以及该最大值转换的分贝值打印出来。When the audio data is dual-channel, find the maximum audio data value in the left and right channels respectively, and print out the maximum value found and the decibel value converted from the maximum value; when the audio data is monophonic, find the maximum audio data value in the audio data, and print out the maximum value found and the decibel value converted from the maximum value.

例如,找到图4B示出的左声道中L0、L2、......、L10的最大音频数据值为L10,将找到的最大值L10以及将该最大值L10转换的分贝值打印出来,找到图4B示出的右声道中R1、R3、......、R11的最大音频数据值为R3,将找到的最大值R3以及将该最大值R3转换的分贝值打印出来。For example, find out that the maximum audio data value of L0, L2, ..., L10 in the left channel shown in Figure 4B is L10, and print out the maximum value L10 and the decibel value converted from the maximum value L10; find out that the maximum audio data value of R1, R3, ..., R11 in the right channel shown in Figure 4B is R3, and print out the maximum value R3 and the decibel value converted from the maximum value R3.

可以理解,上述步骤S401至步骤S404的执行顺序只是一种示例,在另一些实施例中,也可以采用其他执行顺序,还可以拆分或合并部分步骤,在此不做限定。It can be understood that the execution order of the above steps S401 to S404 is only an example. In other embodiments, other execution orders may be adopted, and some steps may be split or combined, which is not limited here.

图4C根据本申请的一些实施例,示出了一种基于获取的格式信息,采用预设处理方式将待监测音频数据分为多个音频数据帧的具体方式。可以理解的前述方式为关于上述S402中的一些实施例的具体阐述,该方法包括:FIG4C shows a specific method of dividing the monitored audio data into multiple audio data frames using a preset processing method based on the acquired format information according to some embodiments of the present application. It can be understood that the aforementioned method is a specific description of some embodiments in the above S402, and the method includes:

S4021,判断获取的格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特是否相同。S4021, determining whether the frame size N bits of the audio data frame corresponding to the acquired format is the same as the preset data reading amount M bits of the preset processing method.

可以理解的,当获取的格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特相同时,则可以直接按照预设数据读取量M比特作为每次读取的数据量,从而进入S4022;否则,则进入S4023,继续判断获取的格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特的大小关系,再根据对应的处理方式进行处理。It can be understood that when the frame size N bits of the audio data frame corresponding to the acquired format is the same as the preset data reading amount M bits of the preset processing method, the preset data reading amount M bits can be directly used as the data amount read each time, thereby entering S4022; otherwise, enter S4023, continue to judge the size relationship between the frame size N bits of the audio data frame corresponding to the acquired format and the preset data reading amount M bits of the preset processing method, and then process according to the corresponding processing method.

可以理解的,预设数据读取量M比特可以为8bit、16bit、24bit以及32bit等,在此不再赘述。It can be understood that the preset data reading amount M bits can be 8 bits, 16 bits, 24 bits, 32 bits, etc., which will not be repeated here.

例如,预设数据读取量M比特为16bit,获取的待检测的音频数据的格式为PCM16bit LE,则获取的格式对应的音频数据帧的帧大小N比特为16bit,可以判断到获取的格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特相同,进入S4022;又例如,获取的待检测的音频数据的格式为PCM 8bit LE或者PCM 24bit LE,则获取的格式对应的音频数据帧的帧大小N比特对应为8bit以及24bit,则获取的格式对应的音频数据帧的帧大小N比特与预设处理方式的预设数据读取量M比特不同,进入S4023。For example, the preset data reading amount M bits is 16 bits, and the format of the acquired audio data to be detected is PCM16bit LE, then the frame size N bits of the audio data frame corresponding to the acquired format is 16 bits, and it can be judged that the frame size N bits of the audio data frame corresponding to the acquired format is the same as the preset data reading amount M bits of the preset processing method, and the process goes to S4022; for another example, the format of the acquired audio data to be detected is PCM 8bit LE or PCM 24bit LE, then the frame size N bits of the audio data frame corresponding to the acquired format are 8bit and 24bit respectively, and the frame size N bits of the audio data frame corresponding to the acquired format are different from the preset data reading amount M bits of the preset processing method, and the process goes to S4023.

S4022,从待监测音频数据中,将每次以预设数据读取量读取的音频数据作为一帧音频数据帧。S4022: From the audio data to be monitored, audio data read each time with a preset data reading amount is taken as an audio data frame.

例如,如图4D所示,对于24字节的PCM 16bit LE音频数据,将每次以预设数据读取量16bit读取的音频数据作为一帧音频数据帧。For example, as shown in FIG. 4D , for 24-byte PCM 16-bit LE audio data, the audio data read each time with a preset data reading amount of 16 bits is taken as one audio data frame.

S4023,判断获取的格式对应的音频数据帧的帧大小N比特是否大于预设处理方式的预设数据读取量M比特。S4023, determining whether the frame size N bits of the audio data frame corresponding to the acquired format is greater than the preset data reading amount M bits of the preset processing method.

可以理解的,当获取的格式对应的音频数据帧的帧大小N比特大于预设处理方式的预设数据读取量M比特时,由于用于维测人员查看的音频数据值的精度不需要特别高,可以进入S4025,每次从待监测音频数据的N比特数据中,选取M比特高位的数据作为一帧音频数据帧;否则,进入S4024,每次从待监测音频数据中读取N比特音频数据作为一帧音频数据帧。It can be understood that when the frame size N bits of the audio data frame corresponding to the acquired format is greater than the preset data reading amount M bits of the preset processing method, since the accuracy of the audio data values viewed by maintenance personnel does not need to be particularly high, S4025 can be entered, and each time from the N bits of audio data to be monitored, M bits of high-order data are selected as a frame of audio data frame; otherwise, S4024 is entered, and N bits of audio data are read from the audio data to be monitored each time as a frame of audio data frame.

例如,当获取的格式对应的音频数据帧的帧大小N比特为24bit,大于预设处理方式的预设数据读取量M比特为16bit时,则进入S4025;又例如,当获取的格式对应的音频数据帧的帧大小N比特为8bit,小于预设处理方式的预设数据读取量M比特为16bit时,则进入S4024。For example, when the frame size N bits of the audio data frame corresponding to the acquired format is 24 bits, which is greater than the preset data reading amount M bits of the preset processing method, which is 16 bits, then enter S4025; for another example, when the frame size N bits of the audio data frame corresponding to the acquired format is 8 bits, which is less than the preset data reading amount M bits of the preset processing method, which is 16 bits, then enter S4024.

S4024,每次从待监测音频数据中读取N比特音频数据作为一帧音频数据帧。S4024, reading N bits of audio data from the audio data to be monitored each time as one frame of audio data.

例如,对于PCM 8bit LE音频数据,将每次从待监测音频数据中读取8bit的音频数据作为一帧音频数据帧。For example, for PCM 8-bit LE audio data, 8-bit audio data is read from the audio data to be monitored each time as one audio data frame.

S4025,每次从待监测音频数据的N比特数据中,选取M比特高位的数据作为一帧音频数据帧。S4025, each time, select M bits of high-order data from the N bits of audio data to be monitored as a frame of audio data.

例如,对于PCM 24bit LE的待监测音频数据中,如图3所示,每次从的24bit的数据中,选取高16bit的数据作为一帧音频数据。For example, for the PCM 24-bit LE audio data to be monitored, as shown in FIG3 , each time, high 16-bit data is selected from the 24-bit data as a frame of audio data.

可以理解,上述步骤S4021至步骤S4025的执行顺序只是一种示例,在另一些实施例中,也可以采用其他执行顺序,还可以拆分或合并部分步骤,在此不做限定。It can be understood that the execution order of the above steps S4021 to S4025 is only an example. In other embodiments, other execution orders may be adopted, and some steps may be split or combined, which is not limited here.

进一步,为便于更深入理解本申请实施例提供的技术方案,图5A根据本申请的一些实施例,示出了一种电子设备的音频系统软件结构示意图。如图5A所示,音频系统结构是一个多层结构,从上到下依次为音频应用层01、音频框架层02、音频硬件抽象层03。Further, to facilitate a deeper understanding of the technical solutions provided by the embodiments of the present application, FIG5A shows a schematic diagram of the audio system software structure of an electronic device according to some embodiments of the present application. As shown in FIG5A , the audio system structure is a multi-layer structure, which includes, from top to bottom, an audio application layer 01, an audio framework layer 02, and an audio hardware abstraction layer 03.

在本申请一些实施例中,音频应用层01包含音频播放功能的应用软件,例如,音乐、媒体播放器等(图中未示出),以及可用于应用软件播放音频数据的音频播放功能模块,例如,音频轨道(AudioTrack)011、媒体播放机(Media Player)012等。具体地,音频轨道(AudioTrack)011可以用来管理、播放PCM数据裸流,其他音频格式(例如,AAC、AMR、OPUS、FLAC等)需要经过解码成PCM数据裸流格式才能使用。媒体播放机(Media Player)012则可以播放MP3,WAV,OGG,AAC,MIDI等音频格式数据。In some embodiments of the present application, the audio application layer 01 includes application software with audio playback functions, such as music, media players, etc. (not shown in the figure), and audio playback function modules that can be used for application software to play audio data, such as audio tracks (AudioTrack) 011, media players (Media Player) 012, etc. Specifically, audio tracks (AudioTrack) 011 can be used to manage and play PCM data raw streams, and other audio formats (such as AAC, AMR, OPUS, FLAC, etc.) need to be decoded into PCM data raw stream formats before they can be used. Media Player (Media Player) 012 can play audio format data such as MP3, WAV, OGG, AAC, MIDI, etc.

音频框架层02可以调用音频功能库模块(Audio Lib)播放音频数据,例如,音频混合(AudioMixer)模块022,以及包括用于存储接收到的音频应用层01传递的待播放的音频数据的音频缓存模块021等。其中,音频缓存模块021用于存储音频数据,作为音频应用层01与音频框架层02之间的交互通道。音频混合(AudioMixer)模块022作为音频框架层02与音频硬件抽象层03之间的交互通道,可以将多个通过音频轨道012发送到音频框架层02中的音频流数据混合处理,。The audio framework layer 02 can call the audio function library module (Audio Lib) to play audio data, for example, the audio mixer (AudioMixer) module 022, and the audio cache module 021 for storing the audio data to be played transmitted by the received audio application layer 01. Among them, the audio cache module 021 is used to store audio data as an interactive channel between the audio application layer 01 and the audio framework layer 02. The audio mixer (AudioMixer) module 022 serves as an interactive channel between the audio framework layer 02 and the audio hardware abstraction layer 03, and can mix and process multiple audio stream data sent to the audio framework layer 02 through the audio track 012.

音频硬件抽象层03是为适配不同硬件而独立封装的一层,从而将待播放的音频数据输出。图中示出的音频硬件抽象层03包括了音频输出模块031,以及音频流检测(AudioStream Detection,ASD)模块032。其中,音频输出模块031是用于接收音频框架层02发送的待播放的音频数据,并将待播放的音频数据输出。音频流检测(Audio Stream Detection,ASD)模块032用于将待播放的音频数据打印出来,从而实时监测待播放的音频数据,进而辅助维测人员处理问题。The audio hardware abstraction layer 03 is a layer that is independently encapsulated to adapt to different hardware, so as to output the audio data to be played. The audio hardware abstraction layer 03 shown in the figure includes an audio output module 031 and an audio stream detection (Audio Stream Detection, ASD) module 032. Among them, the audio output module 031 is used to receive the audio data to be played sent by the audio framework layer 02, and output the audio data to be played. The audio stream detection (Audio Stream Detection, ASD) module 032 is used to print out the audio data to be played, so as to monitor the audio data to be played in real time, and then assist the maintenance personnel to deal with the problem.

可以理解的,在对音频数据的监测过程中,图5A中阐述的待播放音频数据就为待监测的音频数据。图5A中箭头示出了,在一些实施例中,待监测的音频数据的流向关系。音频轨道(AudioTrack)011将待监测的音频数据发送给音频缓存模块021。音频缓存模块021接收后将待监测的音频数据发送给音频混合模块022混合处理。音频混合模块022将处理后的音频数据发送给音频输出模块031以便于后续输出。音频输出模块031在接收到待监测的音频数据后在输出的同时,并且将待监测的音频数据发送给音频流检测模块032。音频流检测模块032将接收的待监测的音频数据进行处理,从而成功打印出来。It is understandable that in the process of monitoring audio data, the audio data to be played described in Figure 5A is the audio data to be monitored. The arrow in Figure 5A shows, in some embodiments, the flow relationship of the audio data to be monitored. The audio track (AudioTrack) 011 sends the audio data to be monitored to the audio cache module 021. After receiving, the audio cache module 021 sends the audio data to be monitored to the audio mixing module 022 for mixing. The audio mixing module 022 sends the processed audio data to the audio output module 031 for subsequent output. After receiving the audio data to be monitored, the audio output module 031 outputs and sends the audio data to be monitored to the audio stream detection module 032. The audio stream detection module 032 processes the received audio data to be monitored, thereby successfully printing it out.

可以理解,图5A示出了音频系统软件结构只是一种示例,在另一些实施例中,电子设备也可以采用其他形式的了音频系统软件结构,本申请实施例不做限定。It can be understood that the audio system software structure shown in FIG. 5A is only an example. In other embodiments, the electronic device may also adopt other forms of audio system software structure, which is not limited in the embodiments of the present application.

下面结合图5A示出音频系统软件结构中的模块,进一步介绍本申请的方案。如图5B示出的音频输出模块031在输出待监测的音频数据的同时向音频流检测模块032发送待监测的音频数据,然后音频流检测模块032将待监测的音频数据打印出来的交互示意图,具体交互过程如下:The following further describes the solution of the present application in conjunction with the modules in the audio system software structure shown in FIG5A. As shown in FIG5B, the audio output module 031 sends the audio data to be monitored to the audio stream detection module 032 while outputting the audio data to be monitored, and then the audio stream detection module 032 prints out the audio data to be monitored. The specific interaction process is as follows:

S501,音频输出模块031向音频流检测模块032发送初始化线程指令。S501 , the audio output module 031 sends an initialization thread instruction to the audio stream detection module 032 .

可以理解的,音频流检测模块032需要开启一个线程来完成处理待监测的音频数据,并且将其打印出来的任务。It can be understood that the audio stream detection module 032 needs to start a thread to complete the task of processing the audio data to be monitored and printing it out.

S502,音频流检测模块032初始化线程。S502, the audio stream detection module 032 initializes a thread.

音频流检测模块032在接收到初始化线程的指令后,进行接口挂载,然后再创建线程。After receiving the instruction to initialize the thread, the audio stream detection module 032 mounts the interface and then creates a thread.

S503,音频输出模块031向音频流检测模块032发送开始处理待监测的音频数据的指令。S503, the audio output module 031 sends an instruction to the audio stream detection module 032 to start processing the audio data to be monitored.

可以理解的,在音频流检测模块032需要为打印音频数据的过程做准备,例如准备存储空间等。所以,音频输出模块031需要向音频流检测模块032发送开始处理待监测的音频数据的指令。It is understandable that the audio stream detection module 032 needs to prepare for the process of printing the audio data, such as preparing storage space, etc. Therefore, the audio output module 031 needs to send an instruction to the audio stream detection module 032 to start processing the audio data to be monitored.

S504,音频流检测模块032为处理待监测的音频数据做准备。S504: the audio stream detection module 032 prepares to process the audio data to be monitored.

可以理解的,音频流检测模块032在接收到音频输出模块031发送的处理待监测的音频数据的指令后,则会为处理待监测的音频数据做准备,比如说准备存储空间等。It is understandable that after receiving the instruction to process the audio data to be monitored sent by the audio output module 031, the audio stream detection module 032 will prepare for processing the audio data to be monitored, such as preparing storage space.

S505,音频输出模块031向音频流检测模块032发送待监测的音频数据以及对应的信息,包括格式、声道数以及数据总量。S505 , the audio output module 031 sends the audio data to be monitored and corresponding information, including the format, the number of channels and the total amount of data, to the audio stream detection module 032 .

可以理解的,音频输出模块031已经向音频流检测模块032发送了发送开始处理待监测的音频数据的指令,所以音频输出模块031就可以向音频流检测模块032发送待监测的音频数据以及对应的信息,包括格式、声道数以及数据总量。It can be understood that the audio output module 031 has sent an instruction to the audio stream detection module 032 to start processing the audio data to be monitored, so the audio output module 031 can send the audio data to be monitored and corresponding information to the audio stream detection module 032, including the format, number of channels and total amount of data.

例如,音频输出模块031向音频流检测模块032发送格式为PCM 24bit LE、数据总量为24字节、声道数为2的待监测音频数据。For example, the audio output module 031 sends the audio data to be monitored, which has a format of PCM 24bit LE, a total data amount of 24 bytes, and a number of channels of 2, to the audio stream detection module 032 .

S506,音频流检测模块032接收待监测的音频数据以及对应的信息。S506: The audio stream detection module 032 receives the audio data to be monitored and the corresponding information.

S507,音频流检测模块032基于获取的格式,采用预设处理方式将待监测音频数据分为多个音频数据帧。S507: The audio stream detection module 032 divides the audio data to be monitored into multiple audio data frames based on the acquired format using a preset processing method.

S508,音频流检测模块032根据声道数确定各声道对应的音频数据。S508: The audio stream detection module 032 determines the audio data corresponding to each channel according to the number of channels.

S509,音频流检测模块032根据找到对应声道中的最大音频数据值,将找到的最大值以及该最大值转换的分贝值打印出来。S509, the audio stream detection module 032 prints out the maximum value and the decibel value converted from the maximum value according to the maximum audio data value found in the corresponding channel.

可以理解的,上述S506至S509将待监测的音频数据中的对应声道的最大值打印出来的方式,与上述图4A以及图4C中阐述的S401至S405的过程相同,因此在此不再详细赘述。It can be understood that the manner in which the maximum value of the corresponding channel in the audio data to be monitored is printed out in S506 to S509 is the same as the process of S401 to S405 described in FIG. 4A and FIG. 4C , and thus will not be described in detail here.

S510,音频输出模块031向音频流检测模块032发送停止处理音频数据的指令。S510, the audio output module 031 sends an instruction to the audio stream detection module 032 to stop processing audio data.

可以理解的,音频流检测模块032打印待监测的音频数据的过程是一个实时的过程,音频输出模块031会向音频流检测模块032不断的发送待监测音频数据。所以,当音频输出模块031接收到结束输出音频数据,或者接收到需要停止使用音频流检测模块032监测输出的音频数据后,可以向音频流检测模块032发送停止监测音频数据的指令,从而中止线程处理过程,节省资源。It is understandable that the process of the audio stream detection module 032 printing the audio data to be monitored is a real-time process, and the audio output module 031 will continuously send the audio data to be monitored to the audio stream detection module 032. Therefore, when the audio output module 031 receives the end of outputting audio data, or receives the need to stop using the audio stream detection module 032 to monitor the output audio data, it can send an instruction to stop monitoring the audio data to the audio stream detection module 032, thereby terminating the thread processing process and saving resources.

可以理解,上述步骤S501至步骤S510的执行顺序只是一种示例,在另一些实施例中,也可以采用其他执行顺序,还可以拆分或合并部分步骤,在此不做限定。It can be understood that the execution order of the above steps S501 to S510 is only an example. In other embodiments, other execution orders may be adopted, and some steps may be split or combined, which is not limited here.

图6根据本申请的实施例,示出了一种手机100的硬件结构示意图。图6示出的手机100的硬件结构示意图可以是手机100的硬件结构示意图。Fig. 6 shows a schematic diagram of the hardware structure of a mobile phone 100 according to an embodiment of the present application. The schematic diagram of the hardware structure of the mobile phone 100 shown in Fig. 6 may be a schematic diagram of the hardware structure of the mobile phone 100.

手机100能够执行本申请实施例提供的音频数据的监测方法。如图6所示,手机100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(UniversalSerial Bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(Subscriber Identification Module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The mobile phone 100 can execute the audio data monitoring method provided in the embodiment of the present application. As shown in Figure 6, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (Subscriber Identification Module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

可以理解的是,本发明实施例示意的结构并不构成对手机100的具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如,可以包括中央处理器CPU(Central Processing Unit)、图像处理器GPU(Graphics Processing Unit)、数字信号处理器DSP(Digital Signal Processor)、微处理器MCU(Micro-programmed Control Unit)、AI(Artificial Intelligence,人工智能)处理器或可编程逻辑器件FPGA(FieldProgrammable Gate Array)等的处理模块或处理电路。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), a microprocessor (MCU), an AI (Artificial Intelligence) processor, or a processing module or processing circuit of a programmable logic device (FPGA). Different processing units may be independent devices or integrated in one or more processors.

存储器可用于存储数据、软件程序以及模块,可以是易失性存储器(VolatileMemory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(Non-Volatile Memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(FlashMemory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,或者也可以是可移动存储介质,例如安全数字(Secure Digital,SD)存储卡。The memory can be used to store data, software programs and modules, and can be a volatile memory (Volatile Memory), such as a random-access memory (Random-Access Memory, RAM); or a non-volatile memory (Non-Volatile Memory), such as a read-only memory (Read-Only Memory, ROM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, or it can also be a removable storage medium, such as a secure digital (Secure Digital, SD) memory card.

充电管理模块140可以包括电池142、电源管理模块141等。电源管理模块141用于管理电源的充电和电源向其他模块的供电。充电管理模块140用于从充电器接收充电输入;电源管理模块141用于连接电池142,充电管理模块与处理器110。The charging management module 140 may include a battery 142, a power management module 141, etc. The power management module 141 is used to manage the charging of the power source and the power supply of the power source to other modules. The charging management module 140 is used to receive charging input from the charger; the power management module 141 is used to connect the battery 142, the charging management module and the processor 110.

移动通信模块150可以包括但不限于天线、功率放大器、滤波器、低噪声放大器(Low Noise Amplify,LNA)等。移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以由天线接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 may include, but is not limited to, an antenna, a power amplifier, a filter, a low noise amplifier (LNA), etc. The mobile communication module 150 may provide solutions for wireless communications including 2G/3G/4G/5G applied to the mobile phone 100. The mobile communication module 150 may receive electromagnetic waves by an antenna, filter, amplify, and process the received electromagnetic waves, and transmit them to a modulation and demodulation processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be arranged in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be arranged in the same device as at least some of the modules of the processor 110.

无线通信模块160可以包括天线,并经由天线实现对电磁波的收发。无线通信模块160可以提供应用在手机100上的包括无线局域网(Wireless Local Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络),蓝牙(Bluetooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等无线通信的解决方案。手机100可以通过无线通信技术与网络以及其他设备进行通信。The wireless communication module 160 may include an antenna, and transmit and receive electromagnetic waves via the antenna. The wireless communication module 160 may provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., which are applied to the mobile phone 100. The mobile phone 100 may communicate with the network and other devices through wireless communication technology.

在一些实施例中,手机100的移动通信模块150和无线通信模块160也可以位于同一模块中。In some embodiments, the mobile communication module 150 and the wireless communication module 160 of the mobile phone 100 may also be located in the same module.

摄像头193用于捕获静态图像或视频。景物通过镜头生成的光学图像投射到感光元件。感光元件把光信号转换成电信号,之后将电信号传递给ISP(Image SignalProcessor,图像信号处理器)转换成数字图像信号。手机100可以通过ISP,摄像头193,视频编解码器,GPU(Graphic Processing Unit,图形处理器),显示屏以及应用处理器等实现拍摄功能。其中,摄像头可以是N个,N为正整数。The camera 193 is used to capture still images or videos. The optical image generated by the lens is projected onto the photosensitive element. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP (Image Signal Processor) to be converted into a digital image signal. The mobile phone 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU (Graphic Processing Unit), the display screen and the application processor. Among them, there can be N cameras, where N is a positive integer.

显示屏194包括显示面板。显示面板可以采用液晶显示屏(Liquid CrystalDisplay,LCD),有机发光二极管(Organic Light-emitting Diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(Active-matrix Organic Light-emitting Diode的,AMOLED),柔性发光二极管(Flex Light-emitting Diode,FLED),Mini LED,Micro LED,Micro OLED,量子点发光二极管(Quantum Dot Light-emitting Diodes,QLED)等。其中,显示屏可以是N个,N为正整数。The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a Micro LED, a Micro OLED, a quantum dot light-emitting diode (QLED), etc. The number of display screens may be N, where N is a positive integer.

音频模块170可以将数字音频信息转换成模拟音频信号输出,或者将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。其中,音频模块170可以包括扬声器170A、受话器170B、麦克风170C、耳机接口170D。The audio module 170 can convert digital audio information into analog audio signal output, or convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. Among them, the audio module 170 can include a speaker 170A, a receiver 170B, a microphone 170C, and an earphone interface 170D.

接口模块包括外部存储器接口120、通用串行总线(Universal Serial Bus,USB)接口130及用户标识模块(Subscriber Identification Module,SIM)卡接口195等。其中,SIM卡接口可以是N个,N为正整数。外部存储器接口可以用于连接外部存储卡,例如MicroSD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口与处理器110通信,实现数据存储功能。通用串行总线接口用于手机100和其他手机进行通信。用户标识模块卡接口用于与安装至手机100的SIM卡进行通信,例如读取SIM卡中存储的电话号码,或将电话号码写入SIM卡中。The interface module includes an external memory interface 120, a Universal Serial Bus (USB) interface 130, and a Subscriber Identification Module (SIM) card interface 195, etc. Among them, there can be N SIM card interfaces, where N is a positive integer. The external memory interface can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 via the external memory interface to implement a data storage function. The universal serial bus interface is used for the mobile phone 100 to communicate with other mobile phones. The Subscriber Identification Module card interface is used to communicate with a SIM card installed in the mobile phone 100, for example, to read a phone number stored in the SIM card, or to write a phone number into the SIM card.

在一些实施例中,手机100还包括按键190、马达191以及指示器192等。其中,按键可以包括音量键、开/关机键等。马达用于使手机100产生振动效果,例如在用户的手机100收到新的IM APP消息时产生振动,以提示用户查看消息。指示器可以包括激光指示器、射频指示器、LED指示器等。In some embodiments, the mobile phone 100 further includes a button 190, a motor 191, and an indicator 192. The button may include a volume button, a power on/off button, etc. The motor is used to make the mobile phone 100 vibrate, for example, when the user's mobile phone 100 receives a new IM APP message, vibration is generated to prompt the user to check the message. The indicator may include a laser indicator, a radio frequency indicator, an LED indicator, etc.

可以理解的是,本发明实施例示意的结构并不构成对手机100具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

本申请公开的机制的各实施例可以被实现在硬件、软件、固件或这些实现方法的组合中。本申请的实施例可实现为在可编程系统上执行的计算机程序或程序代码,该可编程系统包括至少一个处理器、存储系统(包括易失性和非易失性存储器和/或存储元件)、至少一个输入设备以及至少一个输出设备。The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements), at least one input device and at least one output device.

可将程序代码应用于输入指令,以执行本申请描述的各功能并生成输出信息。可以按已知方式将输出信息应用于一个或多个输出设备。为了本申请的目的,处理系统包括具有诸如例如数字信号处理器(DSP)、微控制器、专用集成电路(ASIC)或微处理器之类的处理器的任何系统。Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

程序代码可以用高级程序化语言或面向对象的编程语言来实现,以便与处理系统通信。在需要时,也可用汇编语言或机器语言来实现程序代码。事实上,本申请中描述的机制不限于任何特定编程语言的范围。在任一情形下,该语言可以是编译语言或解释语言。Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

在一些情况下,所公开的实施例可以以硬件、固件、软件或其任何组合来实现。所公开的实施例还可以被实现为由一个或多个暂时或非暂时性机器可读(例如,计算机可读)存储介质承载或存储在其上的指令,其可以由一个或多个处理器读取和执行。例如,指令可以通过网络或通过其他计算机可读介质分发。因此,机器可读介质可以包括用于以机器(例如,计算机)可读的形式存储或传输信息的任何机制,包括但不限于,软盘、光盘、光碟、只读存储器(CD-ROMs)、磁光盘、只读存储器(ROM)、随机存取存储器(RAM)、可擦除可编程只读存储器(EPROM)、电可擦除可编程只读存储器(EEPROM)、磁卡或光卡、闪存、或用于利用因特网以电、光、声或其他形式的传播信号来传输信息(例如,载波、红外信号数字信号等)的有形的机器可读存储器。因此,机器可读介质包括适合于以机器(例如,计算机)可读的形式存储或传输电子指令或信息的任何类型的机器可读介质。In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.

在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明性附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其他特征组合。In the accompanying drawings, some structural or method features may be shown in a specific arrangement and/or order. However, it should be understood that such a specific arrangement and/or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and/or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。It should be noted that the units/modules mentioned in the various device embodiments of the present application are all logical units/modules. Physically, a logical unit/module can be a physical unit/module, or a part of a physical unit/module, or can be implemented as a combination of multiple physical units/modules. The physical implementation method of these logical units/modules themselves is not the most important. The combination of functions implemented by these logical units/modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units/modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units/modules in the above-mentioned device embodiments.

需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims (11)

1. A method for monitoring audio data is applied to electronic equipment and is characterized by comprising the following steps of,
Acquiring audio data to be monitored, wherein the audio data to be monitored has a first audio format;
Based on the first audio format, dividing the audio data to be monitored into a plurality of audio data frames by adopting a preset processing mode;
determining the channel type of each audio data frame;
Printing information of audio data frames, of which the numerical value meets a preset condition, in the audio data frames corresponding to each sound channel into a log of the electronic equipment, wherein the numerical value meets the preset condition and comprises any one of the numerical value being the maximum value, the next-largest value or the average value;
And the audio data to be monitored is divided into a plurality of audio data frames by adopting a preset processing mode based on the first audio format, comprising,
The frame size N bits of the audio data frame corresponding to the first audio format is smaller than the preset data reading amount M bits of the preset processing mode, and N bits of audio data are read from the audio data to be monitored each time to serve as a frame of audio data frame;
And selecting M-bit high-order data from the N-bit data of the audio data to be monitored each time as a frame of audio data frame, wherein the frame size N bits of the audio data frame corresponding to the first audio format is larger than the preset data reading amount M bits of the preset processing mode, and the preset data reading amount M meets the corresponding first precision when the audio data frame is printed.
2. The method of claim 1, wherein dividing the audio data to be monitored into a plurality of audio data frames based on the first audio format using a predetermined processing scheme comprises,
And taking the audio data read by the preset data reading amount each time as a frame of audio data frame from the audio data to be monitored.
3. The method according to any of claims 1-2, wherein the first audio format comprises any of PCM 16bit LE, PCM 24bit LE, PCM 32bit LE; and
The preset data reading quantity comprises any one of 8 bits, 16 bits, 24 bits and 32 bits.
4. The method of claim 1, wherein the channel types to which the frame of audio data belongs include a left channel and a right channel; and
The printing the information of the audio data frames with the digital values meeting the preset conditions in the audio data frames corresponding to each sound channel into the log of the electronic equipment comprises the following steps:
Printing information of audio data frames with digital values meeting preset conditions in the audio data frames belonging to the left channel in the data to be monitored into a log of the electronic equipment, and
And printing information of the audio data frames with the numerical value meeting the preset condition in the audio data frames belonging to the right channel in the data to be monitored into a log of the electronic equipment.
5. The method of claim 1, wherein the channel type to which the frame of audio data belongs is mono; and
The printing the information of the audio data frames with the digital values meeting the preset conditions in the audio data frames corresponding to each sound channel into the log of the electronic equipment comprises the following steps:
and printing information of the audio data frames with the digital values meeting preset conditions in the audio data frames into a log of the electronic equipment.
6. The method according to claim 4 or 5, wherein the information of the audio data frame includes a decibel value corresponding to the audio data frame satisfying the preset condition and/or the audio data frame satisfying the preset condition.
7. The method according to claim 4 or 5, wherein the value satisfying a preset condition comprises: the value in the frame of audio data is a maximum value.
8. The audio data monitoring method is applied to electronic equipment, the electronic equipment comprises an audio stream detection module, and the audio stream detection module performs the following steps:
Acquiring audio data to be monitored, wherein the audio data to be monitored has a first audio format;
Based on the first audio format, dividing the audio data to be monitored into a plurality of audio data frames by adopting a preset processing mode;
determining the channel type of each audio data frame;
Printing information of audio data frames, of which the numerical value meets a preset condition, in the audio data frames corresponding to each sound channel into a log of the electronic equipment, wherein the numerical value meets the preset condition and comprises any one of the numerical value being the maximum value, the next-largest value or the average value;
And the audio data to be monitored is divided into a plurality of audio data frames by adopting a preset processing mode based on the first audio format, comprising,
The frame size N bits of the audio data frame corresponding to the first audio format is smaller than the preset data reading amount M bits of the preset processing mode, and N bits of audio data are read from the audio data to be monitored each time to serve as a frame of audio data frame;
And selecting M-bit high-order data from the N-bit data of the audio data to be monitored each time as a frame of audio data frame, wherein the frame size N bits of the audio data frame corresponding to the first audio format is larger than the preset data reading amount M bits of the preset processing mode, and the preset data reading amount M meets the corresponding first precision when the audio data frame is printed.
9. An electronic device, comprising:
one or more processors;
One or more memories; the one or more memories stores one or more programs that, when executed by the one or more processors, cause the electronic device to perform the method of monitoring audio data of any of claims 1-7.
10. A computer readable storage medium having stored thereon instructions which, when executed on a computer, cause the computer to perform the method of monitoring audio data according to any of claims 1 to 7.
11. A computer program product, characterized in that the computer program product comprises instructions which, when executed, cause a computer to perform the method of monitoring audio data according to any of claims 1 to 7.
CN202211203793.8A 2022-09-29 2022-09-29 Audio data monitoring method, electronic equipment and medium Active CN116721678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211203793.8A CN116721678B (en) 2022-09-29 2022-09-29 Audio data monitoring method, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211203793.8A CN116721678B (en) 2022-09-29 2022-09-29 Audio data monitoring method, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN116721678A CN116721678A (en) 2023-09-08
CN116721678B true CN116721678B (en) 2024-07-05

Family

ID=87868499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211203793.8A Active CN116721678B (en) 2022-09-29 2022-09-29 Audio data monitoring method, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN116721678B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108877837A (en) * 2018-06-12 2018-11-23 北京小米移动软件有限公司 Audio signal abnormality recognition method, device and storage medium
CN114697817A (en) * 2020-12-30 2022-07-01 华为技术有限公司 Audio data processing systems and electronic equipment

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20000074709A (en) * 1999-05-25 2000-12-15 구자홍 Reception data structure and apparatus for image communication apparatus
DE602004029717D1 (en) * 2003-12-19 2010-12-02 Creative Tech Ltd DIGITAL STILL IMAGE CAMERA WITH AUDIO DECODING AND CODING, A PRINTABLE AUDIO FORMAT AND METHOD
JP4378714B2 (en) * 2006-07-07 2009-12-09 日本ビクター株式会社 Speech encoding method and speech decoding method
US7876244B2 (en) * 2009-05-29 2011-01-25 Telefonaktiebolaget L M Ericsson (Publ) Method for aligning a serial bit stream with a parallel output
US10019223B2 (en) * 2015-09-03 2018-07-10 Shure Acquisition Holdings, Inc. Soft decision audio decoding system
CN106375820B (en) * 2016-08-30 2018-07-06 京东方科技集团股份有限公司 The method and apparatus synchronized to audio and video frequency signal
CN108449567B (en) * 2018-03-23 2019-03-19 广州市奥威亚电子科技有限公司 A kind of method and device being used for transmission digital video
CN109243488B (en) * 2018-10-30 2021-07-06 腾讯音乐娱乐科技(深圳)有限公司 Audio detection method, device and storage medium
CN110096612A (en) * 2019-05-06 2019-08-06 苏州思必驰信息科技有限公司 The acquisition methods and system of the online audio analysis data of voice log
CN111245734B (en) * 2020-01-08 2022-03-08 腾讯科技(深圳)有限公司 Audio data transmission method, device, processing equipment and storage medium
CN111489522A (en) * 2020-05-29 2020-08-04 北京百度网讯科技有限公司 Method, apparatus and system for outputting information
CN111986694B (en) * 2020-09-01 2023-12-22 平安科技(深圳)有限公司 Audio processing method, device, equipment and medium based on transient noise suppression
CN114205336A (en) * 2020-09-01 2022-03-18 华为技术有限公司 Cross-device audio playback method, mobile terminal, electronic device and storage medium
CN114466238B (en) * 2020-11-09 2023-09-29 华为技术有限公司 Frame demultiplexing method, electronic device and storage medium
CN113392233A (en) * 2021-01-29 2021-09-14 腾讯科技(深圳)有限公司 Multimedia data detection method, device, storage medium and computer equipment
CN113963707B (en) * 2021-10-14 2025-09-30 腾讯音乐娱乐科技(深圳)有限公司 Audio processing method, device, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108877837A (en) * 2018-06-12 2018-11-23 北京小米移动软件有限公司 Audio signal abnormality recognition method, device and storage medium
CN114697817A (en) * 2020-12-30 2022-07-01 华为技术有限公司 Audio data processing systems and electronic equipment

Also Published As

Publication number Publication date
CN116721678A (en) 2023-09-08

Similar Documents

Publication Publication Date Title
US11798566B2 (en) Data transmission method and apparatus, terminal, and storage medium
WO2020173391A1 (en) Song recording method, sound correction method and electronic device
CN112470217A (en) Method for determining electronic device to perform speech recognition and electronic device
US20170048615A1 (en) Audio signal processing method and electronic device for supporting the same
JP7347728B2 (en) Voiceprint recognition methods and devices
CN114398020A (en) A kind of audio playback method and related equipment
CN115396520B (en) Control method, device, electronic device and readable storage medium
WO2022143258A1 (en) Voice interaction processing method and related apparatus
CN111078930A (en) Audio file data processing method and device
CN114996168B (en) Multi-device cooperative testing method, testing device and readable storage medium
CN114783452A (en) Audio playback method, device and storage medium
CN108289146B (en) Electronic device and operation control method thereof
CN116795753A (en) Audio data transmission and processing method and electronic equipment
CN116721678B (en) Audio data monitoring method, electronic equipment and medium
CN116055615B (en) Audio playing method, electronic equipment and medium
CN113950037B (en) A kind of audio playback method and terminal device
CN117692845A (en) Sound field calibration method, electronic equipment and system
WO2023273904A1 (en) Method for storing audio data and related device thereof
CN115086855A (en) Test system, method and related apparatus
CN114443109A (en) Patch repair method, electronic device and storage medium
CN117880885B (en) Audio playback optimization method and electronic device
CN110246495A (en) Information processing method and electronic equipment
CN116013334B (en) Audio data processing method, electronic device and storage medium
CN115529491B (en) A method for decoding audio and video, an apparatus for decoding audio and video, and a terminal device
CN117271170A (en) Activity event processing method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载