Audio data processing method, device, equipment and storage medium
By obtaining device information, automatically matching the audio encoding type, recording and detecting audio files, the voice encoding compatibility problem of mobile terminals is solved, and audio encoding adaptation is realized without redeveloping the code, improving compatibility and stability.
Patent Information
- Application Number
- CN202210505085.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-05-10
AI Technical Summary
In the voice encoding processing of mobile terminals, different manufacturers and models choose different encoding methods, resulting in frequent updates of application software and inability to be compatible with new models, reducing operational fluency and functional stability.
By obtaining device information, automatically find and match audio encoding types, record and detect audio files, the audio encoding automatically adapts to device information, reduce code development and testing, and improve compatibility and application diversity.
It realizes audio encoding that can adapt to new device information without redeveloping code, reduces cost and iteration frequency, and improves the compatibility and functional stability of mobile terminal applications.
Smart Images

Figure CN114913864B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of speech processing, and in particular to an audio data processing method, apparatus, device and storage medium. Background Art
[0002] At present, people's living standards are increasingly dependent on the convenience brought by mobile terminals. As a result, the brands of mobile terminals are also becoming more and more diverse, with numerous manufacturers and models emerging one after another. The voice recording and playback function plays an indispensable role in mobile terminals, which inevitably requires the mobile terminals to encode and process the collected voice. In the existing technology, mobile terminals have two voice encoding methods: hard coding and soft coding. Different manufacturers or models will select different voice encoding methods. If the application software (App) selects the wrong voice encoding method during operation, it will cause the application software to crash or the recording and uploading function to fail. In order to meet the voice encoding method requirements of various manufacturers and models, the current mainstream voice encoding methods of manufacturers and models are often passively written into the code during application development. That is, when a new manufacturer or model appears, it is necessary to collect the voice encoding methods of the new manufacturer or model, develop the new manufacturer or model code and test it, thereby constantly updating the application software. As a result, the application software in the mobile terminal is frequently updated, and there may be situations where the encoding cannot be performed for manufacturers or models that are not included, which greatly reduces the functionality and smoothness of the application software. Summary of the Invention
[0003] The present invention provides an audio data processing method, apparatus, computer equipment and storage medium, which realize automatic adaptation of audio coding types that match device information. For newly added device information, there is no need to redevelop code and test, and the effect of actively matching the corresponding audio coding type is achieved, thereby reducing costs and iteration frequency and improving compatibility and application diversity.
[0004] An audio data processing method, comprising:
[0005] Get device information and audio data to be processed;
[0006] Searching for an audio coding type that matches the device information, and determining the found audio coding type as an initial coding type;
[0007] Recording the audio data to be processed according to a preset recording format type to obtain a recording file;
[0008] Based on the initial encoding type, performing encoding detection on the recorded file to obtain a detection result of whether the encoding is qualified;
[0009] When a qualified encoding result is detected, the device information is associated with the initial encoding type and stored, and audio encoding is performed on the recording file based on the initial encoding type to obtain a voice file.
[0010] An audio data processing device, comprising:
[0011] The acquisition module is used to obtain device information and audio data to be processed;
[0012] A search module, configured to search for an audio coding type that matches the device information, and determine the found audio coding type as an initial coding type;
[0013] A recording module, configured to record the audio data to be processed according to a preset recording format type to obtain a recording file;
[0014] A detection module, configured to perform encoding detection on the recorded file based on the initial encoding type to obtain a detection result of whether the encoding is qualified;
[0015] The encoding module is used to associate the device information with the initial encoding type for storage when a qualified encoding result is detected, and perform audio encoding on the recording file based on the initial encoding type to obtain a voice file.
[0016] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned audio data processing method are implemented.
[0017] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned audio data processing method when executed by a processor.
[0018] The audio data processing method, apparatus, computer device, and storage medium provided by the present invention obtain device information and audio data to be processed; search for an audio coding type that matches the device information, and determine the found audio coding type as an initial coding type; record the audio data to be processed according to a preset recording format type to obtain a recording file; perform coding detection on the recording file based on the initial coding type to obtain a detection result of whether the coding is qualified; when the detection result of qualified coding is detected, the device information is associated with the initial coding type and stored, and audio encoding is performed on the recording file based on the initial coding type to obtain a voice file. Therefore, the method automatically searches for a matching audio coding type based on the device information, records based on the recording format type to obtain a recording file, and performs coding detection on the recording file based on the automatically adapted audio coding type. When the detection result is that the coding is qualified, the device information is automatically associated with the initial coding type and stored, and a voice file is output, thereby achieving automatic adaptation of the audio coding type to match the device information. For newly added device information, there is no need to redevelop code and test, and the effect of actively matching the corresponding audio coding type is achieved, reducing cost and iteration frequency, and improving compatibility and application diversity. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 is a schematic diagram of an application environment of an audio data processing method according to an embodiment of the present invention;
[0021] Figure 2 is a flow chart of an audio data processing method according to an embodiment of the present invention;
[0022] Figure 3 is a flowchart of step S20 of the audio data processing method according to one embodiment of the present invention;
[0023] Figure 4 is a flowchart of step S40 of the audio data processing method according to one embodiment of the present invention;
[0024] Figure 5 is a flowchart of an audio data processing method according to another embodiment of the present invention;
[0025] Figure 6 is a principle block diagram of an audio data processing device according to an embodiment of the present invention;
[0026] Figure 7 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0028] The audio data processing method provided by the present invention can be applied in Figure 1 In an application environment, a client (computer device or mobile terminal) communicates with a server via a network. The client (computer device or mobile terminal) includes, but is not limited to, various personal computers, laptops, smartphones, tablets, cameras, and portable wearable devices. The server can be implemented as a standalone server or a server cluster consisting of multiple servers.
[0029] The audio data processing method is executed by a client.
[0030] In one embodiment, if Figure 2 As shown, a method for processing audio data is provided, and its technical solution mainly includes the following steps S10-S50:
[0031] S10, obtaining device information and audio data to be processed.
[0032] It is understandable that when the application software (App, Application) in the mobile terminal is started for the first time or each time it is started and executed, the device information of the mobile terminal is obtained. The device information is the basic hardware or performance information related to the mobile terminal. The device information includes information on various device attributes, but is not limited to brand (brand), hardware (device), manufacturer (manufacture), model (model), system software version (osVersion), etc. The process of obtaining the device information can be a reading process through an interface (API) that is authorized to access permission after authentication, that is, the application software sends an authorization application to the system manager in the mobile terminal. The system manager manages the permission of the application software in the mobile terminal to access the resource information of the mobile terminal. The user can set the permission of each application software through the system manager. The audio data to be processed is the source data collected by the audio collection device of the mobile terminal.
[0033] S20: Search for an audio coding type that matches the device information, and determine the found audio coding type as an initial coding type.
[0034] Understandably, the process of searching for the audio encoding type that matches the device information can be to obtain a device comparison table from the local storage database of the application software, compare the device information with each standard device information in the device comparison table one by one, and compare the similarity between the content of each device attribute in the device information and the standard device information, that is, compare the brand content in the device information with the brand content in the standard device information to obtain the similarity of the brand device attributes, and compare the hardware content in the device information with the hardware content in the standard device information to obtain the hardware device attributes. The similarity of the device attributes is obtained by comparing the manufacturer (manufacture) content in the device information with the manufacturer (manufacture) content in the standard device information, and obtaining the similarity of the manufacturer device attributes; the model (model) content in the device information is compared with the model (model) content in the standard device information, and obtaining the similarity of the model device attributes; the system software version (osVersion) content in the device information is compared with the system software version (osVersion) content in the standard device information, and obtaining the similarity of the system software version device attributes. The comparison process is performed by using a similarity algorithm for comparison. Preferably, a text similarity algorithm is used, which is referred to as a text cosine similarity algorithm. It refers to converting Chinese characters, letters, and symbols in two texts into word embedding vectors to obtain two sets of texts after word embedding vector conversion, and then calculating the cosine value between the texts after the two sets of word embedding vector conversion, thereby measuring the similarity between the two texts through the cosine value. Finally, the similarities of various device attributes under the same standard device information are weighted and summed to obtain the similarity between the device information and the device attributes under the standard device information, that is, the similarity of brand device attributes, the similarity of hardware device attributes, the similarity of manufacturer device attributes, the similarity of model device attributes, and the similarity of system software version device attributes. The similarities of the brand device attributes, the hardware device attributes, the manufacturer device attributes, the model device attributes, and the system software version device attributes are multiplied by the corresponding weights and summed to obtain the similarity between the device information and the device attributes under the standard device information. The similarities between the device information and the device attributes under each of the standard device information are sorted, and the maximum similarity is obtained from all the sorted similarities. The maximum similarity is the maximum value among all the similarities between the device information and the device attributes under each of the standard device information. The standard device information corresponding to the maximum similarity is recorded as the standard device information that matches the device information.The audio coding type corresponding to the matching standard device information is recorded as the audio coding type matching the device information. If the device information is completely consistent with one of the standard device information, the similarity between the device information and the standard device information is 100%.
[0035] Among them, the device comparison table stores the mapping and comparison relationship between multiple collected standard device information and audio encoding types, and determines the found audio encoding type as the initial encoding type. The initial encoding type is the audio encoding type that best matches the device information. The audio encoding type includes but is not limited to audio hard coding and audio soft coding. The audio hard coding uses the MediaCodec class provided by the system running in the mobile terminal to provide encoding function from pcm to aac format for encoding. The audio soft coding is the application software (App) developer using open source code to implement audio encoding conversion.
[0036] In one embodiment, if Figure 3 As shown, in step S20, that is, searching for an audio coding type that matches the device information and determining the found audio coding type as the initial coding type, includes:
[0037] S201, searching a device comparison table for an audio coding type that is consistent with the device information.
[0038] It can be understood that the device comparison table can be obtained by accessing the cloud device comparison table in the cloud server corresponding to the application software, and downloading the cloud device comparison table to the local storage database of the application software, and recording the downloaded cloud device comparison table as the device comparison table. The cloud device comparison table can be updated in real time, and each new standard device information collected can be stored in the cloud device comparison table, so as to achieve real-time update of the device comparison table of each mobile terminal. The process of searching for the audio encoding type that is completely consistent with the device information is a process of using a complete matching algorithm to compare whether the content of the device information is completely consistent with that of each standard device information, and finding the audio encoding type corresponding to the standard device information that is completely consistent with the content of the device information.
[0039] The complete matching algorithm is an algorithm for comparing whether the contents of two texts are equal or identical.
[0040] S202: If an audio coding type consistent with the device information is found, the audio coding type is determined as the initial coding type.
[0041] Understandably, if standard device information consistent with the device information can be found, the audio encoding type corresponding to the found standard device information is recorded as the initial encoding type.
[0042] S203: If the audio coding type consistent with the device information is not found, perform coding type prediction on the device information, predict an audio coding type matching the device information, and determine the predicted audio coding type as the initial coding type.
[0043] It is understandable that if no standard device information consistent with the device information is found, it means that no audio encoding type consistent with the device information is found, then the trained encoding type prediction model is obtained from the local storage of the application software, and the device information is input into the encoding type prediction model. The type features of the device information are extracted by the encoding type prediction model. The type features are the characteristic relationship between the content or value of each device attribute of the mobile device and the audio encoding type. The device information is predicted based on the extracted type features. The prediction process can be to predict the probability of a separate audio encoding type for each device attribute in the device information, and determine the final prediction probability of each audio encoding type in combination with the prediction probability corresponding to each device attribute. Finally, the audio encoding type corresponding to the largest final prediction probability is determined as the initial encoding type.
[0044] The present invention realizes searching for an audio coding type consistent with the device information from a self-device comparison table; if an audio coding type consistent with the device information is found, the audio coding type is determined as the initial coding type; if an audio coding type consistent with the device information is not found, a coding type prediction is performed on the device information, an audio coding type matching the device information is predicted, and the predicted audio coding type is determined as the initial coding type. In this way, it is possible to first search the device comparison table for whether there is an audio coding type consistent with the device information. If not found, a matching audio coding type is automatically predicted. There is no need for manual identification and passive collection of audio coding types of new device information, and active identification of the audio coding type corresponding to the device information is achieved, so that it will not lag behind the release of new device information, is compatible with audio coding of various mobile terminals, greatly reduces labor costs, improves the initiative and reliability of audio coding type selection, and meets the diversity of users' mobile terminals.
[0045] In one embodiment, the step S203, i.e., predicting the encoding type of the device information to predict an audio encoding type that matches the device information, includes:
[0046] The device information is converted using a coding type prediction model to obtain a conversion array.
[0047] It can be understood that the coding type prediction model is a pre-trained neural network, and the coding type prediction model is a model trained through historical device information collected historically and the identified audio coding types corresponding one-to-one to the historical device information. The network structure of the coding type prediction model can be set according to demand. For example, the network structure of the coding type prediction model can be a VGG, CNN, RNN network structure, etc. During the training process, by extracting type features and learning based on the extracted type features, the predicted audio coding type continuously approaches the real audio coding type, thereby iteratively convergent. After convergence, the coding type prediction model is obtained. The historical device information is device information that has been recorded or identified for the audio coding type. The coding type prediction model is used to predict the audio coding type of the input device information.
[0048] The information is converted into a word vector conversion of the embedding layer of the input device information, that is, each device attribute in the device information is searched in the vector space through the Word2Vec model, and the word vector corresponding to each device attribute is found, and all the found word vectors are summarized, and the vacancies after the summary are filled with zeros to fill into an array of a preset size, and the array is recorded as the converted array.
[0049] The type features of the conversion array are extracted using the encoding type prediction model to obtain a feature map to be processed.
[0050] It can be understood that the type feature is a feature related to the audio encoding type, that is, the implicit feature containing the audio encoding type existing in each device attribute in the device information. The type feature of the conversion array is extracted through the encoding type prediction model, so that the feature map to be processed can be extracted.
[0051] The feature map to be processed is predicted to obtain an audio coding type that matches the device information.
[0052] It can be understood that the prediction process is based on the extracted type features. For example, the similarity between the various device attributes in the device information and the various device attributes of a certain historical device information is the greatest, and the probability of predicting the audio encoding type corresponding to the historical device information is the highest, so that the audio encoding type is recorded as the audio encoding type that matches the device information. For example: the device information is the same brand and manufacturer as a certain historical device information, and the model is from the same series (that is, the model is fixed in the same position, but the serial number is different), the system software is from the same series of software (such as Android system software), and the hardware device is from the same series, then the probability of predicting that the audio encoding type of the device information is the same as the audio encoding type of the historical device information is 99.5%, which is the highest probability, thereby obtaining the audio encoding type that matches the device information.
[0053] The present invention realizes information conversion of the device information through a coding type prediction model to obtain a conversion array; extracts type features of the conversion array through the coding type prediction model to obtain a feature map to be processed; predicts the feature map to be processed to obtain an audio coding type that matches the device information. In this way, type features can be extracted through the coding type prediction model, and an accurate audio coding type can be predicted, thereby improving the accuracy and reliability of identifying the audio coding type of device information.
[0054] S30: Record the audio data to be processed according to a preset recording format type to obtain a recording file.
[0055] Understandably, the recording format type is the preset PCM recording format. PCM (Pulse-code-modulation) is the representation of an analog signal converted into a digital signal at a fixed sampling frequency. The PCM recording format is a format for collecting data based on five indicators, including: Sampling frequency unit (Sample Rate): Hz; Sign: whether the audio data is signed, usually it is signed; Sample size (SampleSize): indicates the size of each sample data. Usually this value is 16-bit; Byte Ordering: refers to little-endian or big-endian, indicating the storage byte order of audio data, usually little-endian; Audio Identification (Number of Channels): whether it is mono (mono, 1 channel) or stereo (stereo, 2 channels).
[0056] The recording process is a process of decomposing and recording the audio data to be processed according to five indicators, thereby obtaining the recording file.
[0057] S40: Based on the initial encoding type, perform encoding detection on the recorded file to obtain a detection result of whether the encoding is qualified.
[0058] It can be understood that the encoding detection process is to encode the recorded file according to the initial encoding type, and then detect whether the encoded content is silent or crashes (cannot be played), so as to detect whether the encoding is qualified. The detection result reflects whether there is any encoding abnormality in the recorded file after encoding detection.
[0059] In one embodiment, if Figure 4 As shown, in step S40, that is, based on the initial encoding type, the encoding detection is performed on the recorded file to obtain a detection result of whether the encoding is qualified, including:
[0060] S401: extract segments from the recorded file to obtain an extracted file.
[0061] It can be understood that the process of extracting fragments is to extract several fragments from the recorded file, wherein the extraction process can extract files of preset length at a preset interval, or can extract files of preset length from the beginning, end and middle parts, thereby obtaining the process of extracting files, the extracted file is a collection of several extracted fragments, and the extracted file can be obtained by splicing all the extracted fragments.
[0062] S402: Encode the extracted file based on the initial encoding type and determine whether there is an encoding anomaly.
[0063] It can be understood that the extracted file is encoded according to the initial encoding type, and whether there is an encoding anomaly during the encoding process is determined. The encoding anomaly is a crash during the encoding process, that is, an unresponsive state, and whether the encoded content is silent or crashes (cannot be played).
[0064] S403: If there is a coding anomaly, the detection result is determined as unqualified coding.
[0065] It is understandable that if a coding abnormality occurs, the detection result is characterized as coding failure.
[0066] In one embodiment, after step S402, that is, after determining whether there is a coding anomaly, the method further includes:
[0067] If there is no encoding anomaly, obtain the encoded file corresponding to the extracted file after encoding.
[0068] Understandably, if no encoding abnormality occurs, the encoded file is obtained, where the encoded file is the file after the encoding operation on the extracted file.
[0069] Perform audio detection on the encoded file to obtain an audio detection result.
[0070] It can be understood that the audio detection is to detect whether the waveform of the intended playback output has regular and smooth characteristics except for the nodes where the fragments are spliced together, for the encoded file to be played. The audio detection process can be implemented by a trained neural network model, by extracting the smoothing features of the waveform to be played, the smoothing features are regular and smooth features of the waveform except for the nodes where the fragments are spliced together, and the audio detection result is identified based on the extracted smoothing features, and the audio detection result represents whether it is a playable audio content.
[0071] The simulated playback process is a process of collecting the waveform to be played but not emitting any sound.
[0072] The detection result is determined according to the audio detection result.
[0073] Understandably, if the audio detection result is a result of playable audio content, the detection result is determined to be encoding qualified; if the audio detection result is a result of unplayable audio content, the detection result is determined to be encoding unqualified.
[0074] S50: When a qualified encoding result is detected, the device information is associated with the initial encoding type and stored, and audio encoding is performed on the recording file based on the initial encoding type to obtain a voice file.
[0075] It is understandable that when a qualified encoding test result is detected, the device information is associated with the initial encoding type and stored in the device comparison table, or / and the cloud device comparison table in the cloud server corresponding to the application software, and the encoding code corresponding to the initial encoding type is obtained, and the recorded file is audio-encoded using the obtained encoding code to obtain the corresponding voice file.
[0076] The present invention achieves the following: obtaining device information and audio data to be processed; searching for an audio coding type that matches the device information, and determining the found audio coding type as an initial coding type; recording the audio data to be processed according to a preset recording format type to obtain a recording file; performing coding detection on the recording file based on the initial coding type to obtain a detection result of whether the coding is qualified; when the detection result of qualified coding is detected, the device information is associated with the initial coding type and stored, and audio coding is performed on the recording file based on the initial coding type to obtain a voice file. Therefore, the present invention achieves automatic searching for a matching audio coding type through device information, recording based on the recording format type to obtain a recording file, and coding detection on the recording file based on the automatically adapted audio coding type. After the detection result is that the coding is qualified, the device information is automatically associated with the initial coding type and stored, and a voice file is output, so as to achieve automatic adaptation of the audio coding type that matches the device information. For newly added device information, there is no need to redevelop code and test, and the effect of actively matching the corresponding audio coding type is achieved, thereby reducing costs and iteration frequency, and improving compatibility and application diversity.
[0077] In one embodiment, if Figure 5 As shown, after step S40, that is, after obtaining the detection result of whether the encoding is qualified, the following steps are also included:
[0078] S60: When an unqualified encoding result is detected, the encoding status flag is set to failure.
[0079] Understandably, the coding status identifier includes success and failure, and the coding status identifier distinguishes whether there is a coding abnormality. The coding status identifier set to failure indicates that there is a coding abnormality, and the coding status identifier set to success indicates that the coding is successful, that is, there is no coding abnormality.
[0080] S70: Determine a backup encoding type corresponding to the initial encoding type according to the initial encoding type and the failed encoding status identifier, and use the backup encoding type as a new initial encoding type.
[0081] It is understandable that the device comparison table also includes a backup coding type that corresponds one-to-one to each coding type in the case of a failed coding status identification. For example, the backup coding type corresponding to the audio hard-coded audio coding type in the case of a failed coding status identification is audio soft coding, and the backup coding type is used as the new initial coding type.
[0082] In one embodiment, in step S70, determining a backup encoding type corresponding to the initial encoding type based on the initial encoding type and the failed encoding status identifier includes:
[0083] The initial encoding type and the failed encoding status identifier are combined into a recommendation request, and the recommendation request is sent to a cloud server.
[0084] It can be understood that the recommendation request is a request that includes the initial encoding type and the failed encoding status identifier. The recommendation request is a request synthesized by inserting the initial encoding type and the failed encoding status identifier into the position corresponding to the protocol in accordance with the format of the communication protocol determined with the cloud server, and the recommendation request is sent to the cloud server.
[0085] The backup encoding type returned in response to the recommendation request is received; the backup encoding type is obtained after the cloud server recommends an encoding type for the recommendation request.
[0086] It is understandable that the cloud server finds out the backup encoding type corresponding to the initial encoding type and the failed encoding status identifier based on the recommendation request received, or inputs the initial encoding type and the failed encoding status identifier into a preset model, and recommends the corresponding backup encoding type through the preset model, and the preset model is a trained neural network model.
[0087] The backup encoding type is obtained after the cloud server recommends an encoding type for the recommendation request.
[0088] The present invention realizes the process of synthesizing the initial encoding type and the failed encoding status identifier into a recommendation request, and sending the recommendation request to the cloud server; receiving the backup encoding type returned for the recommendation request; the backup encoding type is obtained after the cloud server recommends the encoding type for the recommendation request. In this way, the comparison relationship between the initial encoding type and the backup encoding type can be updated in the cloud server in real time, and the backup encoding type recommended by the cloud server can be received in time without being limited to the local device comparison table, thereby achieving the effect of timely response.
[0089] S80: Based on the new initial encoding type, iteratively detect the recorded file until a detection result indicating that the encoding is qualified is obtained.
[0090] It can be understood that the iterative detection process is to perform encoding detection on the recorded file according to the new initial encoding type, that is, to adjust the execution process of steps S40 to S70. In the event of unqualified encoding, the initial encoding type is continuously updated until a qualified encoding detection result is output.
[0091] The present invention realizes the following steps: when a detection result of unqualified encoding is detected, setting the encoding status flag to failure; determining a backup encoding type corresponding to the initial encoding type according to the initial encoding type and the failed encoding status flag, and using the backup encoding type as a new initial encoding type; based on the new initial encoding type, iteratively detecting the recording file until a detection result of qualified encoding is obtained. In this way, the initial encoding type can be continuously updated until a detection result of qualified encoding is output, without the need for manual updating of the initial encoding type, and the initial encoding type of qualified encoding can be automatically found.
[0092] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0093] In one embodiment, an audio data processing device is provided, which corresponds to the audio data processing method in the above embodiment. Figure 6 As shown, the audio data processing device includes an acquisition module 11, a search module 12, a recording module 13, a detection module 14 and an encoding module 15.
[0094] The detailed description of each functional module is as follows:
[0095] An acquisition module 11 is used to acquire device information and audio data to be processed;
[0096] A search module 12 is configured to search for an audio coding type that matches the device information and determine the found audio coding type as an initial coding type;
[0097] The recording module 13 is used to record the audio data to be processed according to a preset recording format type to obtain a recording file;
[0098] A detection module 14 is configured to perform encoding detection on the recorded file based on the initial encoding type to obtain a detection result of whether the encoding is qualified;
[0099] The encoding module 15 is configured to associate the device information with the initial encoding type for storage when a qualified encoding result is detected, and perform audio encoding on the recording file based on the initial encoding type to obtain a voice file.
[0100] For specific definitions of the audio data processing device, please refer to the definitions of the audio data processing method above and will not be repeated here. Each module in the above-mentioned audio data processing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0101] In one embodiment, a computer device is provided. The computer device can be a client or a server. The internal structure diagram thereof can be as follows: Figure 7 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the readable storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an audio data processing method is implemented.
[0102] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the audio data processing method in the above embodiment is implemented.
[0103] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the audio data processing method in the above embodiment is implemented.
[0104] Those skilled in the art will appreciate that all or part of the processes in the above-described embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described embodiments. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAM bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0105] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0106] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A method for processing audio data, characterized in that: include: Get device information and audio data to be processed; Searching for an audio coding type that matches the device information, and determining the found audio coding type as an initial coding type; Recording the audio data to be processed according to a preset recording format type to obtain a recording file; The recording format type is a preset recording format that is converted into a digital signal at a fixed sampling frequency; The recording process is a process of decomposing and recording the audio data to be processed according to the five indicators; The five indicators include: sampling frequency unit; symbol identification; sampling size; byte order; identification audio; Based on the initial encoding type, performing encoding detection on the recorded file to obtain a detection result of whether the encoding is qualified; When a qualified encoding result is detected, the device information is associated with the initial encoding type and stored, and audio encoding is performed on the recording file based on the initial encoding type to obtain a voice file.
2. The audio data processing method according to claim 1, wherein: After obtaining the detection result of whether the encoding is qualified, the method further includes: When an unqualified encoding result is detected, the encoding status flag is set to failure; Determining a backup encoding type corresponding to the initial encoding type according to the initial encoding type and the failed encoding status identifier, and using the backup encoding type as a new initial encoding type; Based on the new initial encoding type, the recording file is iteratively tested until a qualified encoding test result is obtained.
3. The audio data processing method according to claim 2, wherein: The determining, according to the initial encoding type and the failed encoding status identifier, a backup encoding type corresponding to the initial encoding type includes: Combining the initial encoding type and the failed encoding status identifier into a recommendation request, and sending the recommendation request to a cloud server; The backup encoding type returned in response to the recommendation request is received; the backup encoding type is obtained after the cloud server recommends an encoding type for the recommendation request.
4. The audio data processing method according to claim 1, wherein: The searching for an audio coding type that matches the device information and determining the found audio coding type as the initial coding type includes: Searching for an audio encoding type consistent with the device information in a device comparison table; If an audio coding type that is consistent with the device information is found, the audio coding type is determined as the initial coding type; If the audio coding type consistent with the device information is not found, the coding type is predicted for the device information to predict the audio coding type matching the device information, and the predicted audio coding type is determined as the initial coding type.
5. The audio data processing method according to claim 4, wherein: The performing coding type prediction on the device information to predict an audio coding type matching the device information includes: Performing information conversion on the device information using a coding type prediction model to obtain a conversion array; Extracting type features of the conversion array using the encoding type prediction model to obtain a feature map to be processed; The feature map to be processed is predicted to obtain an audio coding type that matches the device information.
6. The audio data processing method according to claim 1, wherein: The encoding detection of the recorded file based on the initial encoding type to obtain a detection result of whether the encoding is qualified includes: Extracting fragments from the recorded file to obtain an extracted file; Encoding the extracted file based on the initial encoding type and determining whether there is an encoding anomaly; If there is a coding anomaly, the detection result is determined as coding failure.
7. The audio data processing method according to claim 6, wherein: After determining whether there is a coding anomaly, the method further includes: If there is no encoding anomaly, obtaining an encoded file corresponding to the extracted file after encoding; Performing audio detection on the encoded file to obtain an audio detection result; The detection result is determined according to the audio detection result.
8. An audio data processing device, characterized in that: include: The acquisition module is used to obtain device information and audio data to be processed; A search module, configured to search for an audio coding type that matches the device information, and determine the found audio coding type as an initial coding type; A recording module, configured to record the audio data to be processed according to a preset recording format type to obtain a recording file; The recording format type is a preset recording format that is converted into a digital signal at a fixed sampling frequency; The recording process is a process of decomposing and recording the audio data to be processed according to the five indicators; The five indicators include: sampling frequency unit; symbol identification; sampling size; byte order; identification audio; A detection module, configured to perform encoding detection on the recorded file based on the initial encoding type to obtain a detection result of whether the encoding is qualified; The encoding module is used to associate the device information with the initial encoding type for storage when a qualified encoding result is detected, and perform audio encoding on the recording file based on the initial encoding type to obtain a voice file.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the audio data processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the audio data processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data recording, recording and reproducing, reproducing and synchronous detecting device and method, recording medium
CN1265508A
Audio signal processor
JP2000200465A