CN111078930A - Audio file data processing method and device - Google Patents

Audio file data processing method and device Download PDF

Info

Publication number
CN111078930A
CN111078930A CN201911284620.1A CN201911284620A CN111078930A CN 111078930 A CN111078930 A CN 111078930A CN 201911284620 A CN201911284620 A CN 201911284620A CN 111078930 A CN111078930 A CN 111078930A
Authority
CN
China
Prior art keywords
audio file
sampling rate
format
audio
file
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.)
Pending
Application number
CN201911284620.1A
Other languages
Chinese (zh)
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.)
Jeo Polymerization Beijing Artificial Intelligence Technology Co ltd
Original Assignee
Jeo Polymerization Beijing Artificial Intelligence Technology 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 Jeo Polymerization Beijing Artificial Intelligence Technology Co ltd filed Critical Jeo Polymerization Beijing Artificial Intelligence Technology Co ltd
Priority to CN201911284620.1A priority Critical patent/CN111078930A/en
Publication of CN111078930A publication Critical patent/CN111078930A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data

Abstract

The embodiment of the application provides an audio file data processing method and device, wherein the method comprises the following steps: acquiring an audio file and performing audio analysis; judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file; judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate or not, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing; the method and the device can standardize the format of the audio file, correct the sampling rate of the audio file, optimize the track (sound channel) of the audio file, and enable the conversion of the audio file to be more standardized and convenient.

Description

Audio file data processing method and device
Technical Field
The present application relates to the field of audio processing, and in particular, to a method and an apparatus for processing audio file data.
Background
There are many types of audio file formats, and there are 15 common formats, including CD, WAVE, AIFF, MPEG, MP3, MPEG-4, MIDI, WMA, RealAudio, VQF, OggVorbis, AMR, APE, FLAC, AAC. Since there are too many audio file formats, it is necessary for the application system to convert the audio format, sampling rate, and track to meet the needs of the system functionality.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides an audio file data processing method and device, which can standardize the format of an audio file, correct the sampling rate of the audio file, optimize the track (sound channel) of the audio file and enable the conversion of the audio file to be more standardized and convenient.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides an audio file data processing method, including:
acquiring an audio file and performing audio analysis;
judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file;
and judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
Further, the determining whether the file format of the audio file subjected to the audio analysis meets a preset file format requirement, and if not, performing format conversion processing on the audio file includes:
judging whether the suffix name of the audio file belongs to any one of ". mp 3", ". wav", and ". pcm";
if not, judging that the format of the audio file is abnormal, and converting the format of the audio file into a 'wav' format.
Further, before said converting said audio file into ". wav" format, comprising:
judging whether the suffix name of the audio file is ". m4 a";
and if so, converting the sound channel of the audio file into a single sound channel.
Further, the determining whether the sampling rate of the audio file after the format conversion processing meets a preset sampling rate requirement, and if not, performing sampling rate conversion processing on the audio file includes:
judging whether the sampling rate of the audio file belongs to any one of 8000 and 16000;
if not, judging that the sampling rate of the audio file is abnormal, and converting the sampling rate of the audio file into 8000.
In a second aspect, the present application provides an audio file data processing apparatus comprising:
the audio file analysis module is used for acquiring an audio file and performing audio analysis;
the file format judging module is used for judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format or not, and if not, performing format conversion processing on the audio file;
and the file sampling rate judging module is used for judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, and if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
Further, the file format determining module includes:
a suffix name judging unit for judging whether a suffix name of the audio file belongs to any one of ". mp 3", ". wav", and ". pcm";
a suffix name replacing unit, configured to determine that the format of the audio file is abnormal if the suffix name of the audio file does not belong to any one of ". mp 3", ". wav", and ". pcm", and convert the format of the audio file into ". wav" format.
Further, still include:
a binaural judgment unit operable to judge whether a suffix name of the audio file is ". m4 a";
and the sound channel conversion unit is used for converting the sound channel of the audio file into a single sound channel if the suffix name of the audio file is judged to be ". m4 a".
Further, the file sampling rate judgment module includes:
a sampling rate judging unit for judging whether the sampling rate of the audio file belongs to any one of 8000 and 16000;
and the sampling rate conversion unit is used for judging that the sampling rate of the audio file is abnormal if the sampling rate of the audio file is judged not to belong to any one of 8000 and 16000, and converting the sampling rate of the audio file into 8000.
In a third aspect, the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the audio file data processing method.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the audio file data processing method described.
According to the technical scheme, the audio file data processing method and the device are used for obtaining the audio file and analyzing the audio; judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file; judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing, and therefore, the format of the audio file can be standardized, the sampling rate of the audio file can be corrected, the track (sound channel) of the audio file can be optimized, and the conversion of the audio file is more standardized and more convenient.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart illustrating an audio file data processing method according to an embodiment of the present application;
FIG. 2 is a second flowchart illustrating an audio file data processing method according to an embodiment of the present application;
FIG. 3 is a third flowchart illustrating an audio file data processing method according to an embodiment of the present application;
FIG. 4 is a fourth flowchart illustrating an audio file data processing method according to an embodiment of the present application;
FIG. 5 is a block diagram of an audio file data processing apparatus according to an embodiment of the present application;
FIG. 6 is a second block diagram of an audio file data processing apparatus according to an embodiment of the present application;
FIG. 7 is a third block diagram of an audio file data processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Considering that there are many kinds of audio file formats, there are 15 kinds of common formats, including CD, WAVE, AIFF, MPEG, MP3, MPEG-4, MIDI, WMA, RealAudio, VQF, OggVorbis, AMR, APE, FLAC, AAC. The method and the device for processing the audio file data have the advantages that due to the fact that the audio file formats are too many, the audio formats, the sampling rates and the tracks need to be converted for an application system, and the requirement of system functionality is met; judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file; judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing, and therefore, the format of the audio file can be standardized, the sampling rate of the audio file can be corrected, the track (sound channel) of the audio file can be optimized, and the conversion of the audio file is more standardized and more convenient.
In order to standardize the format of an audio file, correct the sampling rate of the audio file, optimize the track (audio channel) of the audio file, and make the conversion of the audio file more standardized and convenient, the present application provides an embodiment of an audio file data processing method, which specifically includes the following contents, referring to fig. 1:
step S101: and acquiring an audio file and performing audio analysis.
Optionally, the audio file is processed by a jar packet named "jar-1.0.2. jar", the jar packet is used for audio parsing, the prior art can be used for specific implementation, what is needed is parsed audio data, the parsed audio data is stored in an object class named AudioAttributes, the attributes contained in the class include a sampling rate (samplingRate), a track (channels) and a bit rate (bitRate), and attribute values can be obtained and set according to a get method and a set method.
Step S102: and judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file.
Optionally, according to the uploaded audio file, obtaining a suffix of the uploaded audio file name, namely traversing the audio file name character strings in a for loop mode, wherein each character string is composed of characters, each character has a character subscript, the last four characters of the file name are intercepted through the character subscript, whether the suffix name of the audio file is one of three, namely, mp3, wav and pcm is judged, and if the suffix meets the condition, namely, one of the three formats is specified, the next step of verifying the sampling rate is continuously executed; if the condition is not met, i.e. the audio file suffix is neither ". mp 3" nor ". wav" and ". pcm", then a string type variable audioExtension is defined and assigned "wav". The wav format is encoded in pcm _ s16le, because different formats are encoded in different manners. And replacing the suffix of the intercepted audio file by 'wav' by a repolaceall method carried by the character string class, and assigning the encoding mode 'pcm _ s16 le' of the audio file to the rule class AudioAttributes at the moment. Meanwhile, whether the suffix of the audio file is'm 4 a' or not is judged, the format is slightly different from other formats, the format is two-channel, and the audio file needs to be converted into single channel, otherwise, two identical channels can appear by directly converting the 'wav' format, and the processing of the audio file is just one channel. The processing of the sound channel is completed after the audio analysis, and only the suffix judgment of the audio file is made here.
Optionally, the audio with the suffix of the audio file determined as ". m4 a" is used to obtain the track number of the original audio by the getChannels method, and then the setChannels method provided by the AudioAttributes class is called to set the channel number to 1.
Step S103: and judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
Optionally, the sample rate (samplingRateSource) of the parsed audio is obtained by the get method. Judging whether the sampling rate of the audio is equal to 8000 or 16000, if the condition is met, namely the sampling rate (samplingRateSource) is equal to 8000 or the sampling rate (samplingRateSource) is equal to 16000, not performing any processing at this time; if the condition is not met, i.e. the sampling rate (samplingsource) is neither 8000 nor 16000, then a constant samplingRate is defined and assigned to 8000, and this constant is added to the rule class (AudioAttributes), which has three attribute values: sampling rate, track and format, and then applying the encoding rule AudioAttributes to the original audio file by an encode method, thereby completing the conversion of the sampling rate, the format and a single track.
As can be seen from the above description, the audio file data processing method provided in the embodiment of the present application can perform audio analysis by acquiring an audio file; judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file; judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing, and therefore, the format of the audio file can be standardized, the sampling rate of the audio file can be corrected, the track (sound channel) of the audio file can be optimized, and the conversion of the audio file is more standardized and more convenient.
In order to accurately judge and replace the format of the audio file, in an embodiment of the audio file data processing method of the present application, referring to fig. 2, the following may be further included:
step S201: it is determined whether the suffix name of the audio file belongs to any one of ". mp 3", ". wav", and ". pcm".
Step S201: if not, judging that the format of the audio file is abnormal, and converting the format of the audio file into a 'wav' format.
In order to accurately judge and replace the two-channel audio file, in an embodiment of the audio file data processing method of the present application, referring to fig. 3, the following may be further included:
step S301: it is determined whether the suffix name of the audio file is ". m4 a".
Step S302: and if so, converting the sound channel of the audio file into a single sound channel.
In order to accurately judge and replace the sampling rate of the audio file, in an embodiment of the audio file data processing method of the present application, referring to fig. 4, the following may be further included:
step S401: it is determined whether the sampling rate of the audio file belongs to any one of 8000 and 16000.
Step S402: if not, judging that the sampling rate of the audio file is abnormal, and converting the sampling rate of the audio file into 8000.
In order to standardize the format of an audio file, correct the sampling rate of the audio file, optimize the tracks (channels) of the audio file, and make the conversion of the audio file more standardized and convenient, the present application provides an embodiment of an audio file data processing apparatus for implementing all or part of the content of the audio file data processing method, and referring to fig. 5, the audio file data processing apparatus specifically includes the following contents:
and the audio file analysis module 10 is configured to obtain an audio file and perform audio analysis.
The file format determining module 20 is configured to determine whether the file format of the audio file subjected to the audio analysis meets a preset file format requirement, and if not, perform format conversion processing on the audio file.
And the file sampling rate judging module 30 is configured to judge whether the sampling rate of the audio file subjected to the format conversion processing meets a preset sampling rate requirement, and if not, perform sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
As can be seen from the above description, the audio file data processing apparatus provided in the embodiment of the present application can perform audio analysis by acquiring an audio file; judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file; judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing, and therefore, the format of the audio file can be standardized, the sampling rate of the audio file can be corrected, the track (sound channel) of the audio file can be optimized, and the conversion of the audio file is more standardized and more convenient.
In order to accurately judge and replace the format of the audio file, in an embodiment of the audio file data processing apparatus of the present application, referring to fig. 6, the file format judging module 20 includes:
a suffix name judging unit 21 for judging whether or not a suffix name of the audio file belongs to any one of ". mp 3", ". wav", and ". pcm".
A suffix name replacing unit 22, configured to determine that the format of the audio file is abnormal if the suffix name of the audio file does not belong to any one of ". mp 3", ". wav", and ". pcm", and convert the format of the audio file into ". wav" format.
In order to accurately judge and replace the two-channel audio file, in an embodiment of the audio file data processing apparatus of the present application, the audio file data processing apparatus further includes:
a binaural judgment unit operable to judge whether a suffix name of the audio file is ". m4 a";
and the sound channel conversion unit is used for converting the sound channel of the audio file into a single sound channel if the suffix name of the audio file is judged to be ". m4 a".
In order to accurately judge and replace the sampling rate of the audio file, in an embodiment of the audio file data processing apparatus of the present application, referring to fig. 8, the file sampling rate judging module 30 includes:
a sampling rate judging unit 31 for judging whether the sampling rate of the audio file belongs to any one of 8000 and 16000.
And the sampling rate conversion unit 32 is used for judging that the sampling rate of the audio file is abnormal if the sampling rate of the audio file is judged not to belong to any one of 8000 and 16000, and converting the sampling rate of the audio file into 8000.
In order to standardize the format of an audio file, correct the sampling rate of the audio file, optimize the tracks (channels) of the audio file, and make the conversion of the audio file more standardized and convenient, an embodiment of an electronic device for implementing all or part of the contents in the audio file data processing method is provided in the present application, and the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the audio file data processing device and relevant equipment such as a core service system, a user terminal, a relevant database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the logic controller may be implemented with reference to the embodiment of the audio file data processing method and the embodiment of the audio file data processing apparatus in the embodiment, and the contents thereof are incorporated herein, and repeated descriptions are omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the audio file data processing method may be executed on the electronic device side as described above, or all operations may be completed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 8 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 8, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this FIG. 8 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the audio file data processing method functions may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
step S101: and acquiring an audio file and performing audio analysis.
Step S102: and judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file.
Step S103: and judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
As can be seen from the above description, the electronic device provided in the embodiment of the present application obtains an audio file and performs audio analysis; judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file; judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing, and therefore, the format of the audio file can be standardized, the sampling rate of the audio file can be corrected, the track (sound channel) of the audio file can be optimized, and the conversion of the audio file is more standardized and more convenient.
In another embodiment, the audio file data processing apparatus may be configured separately from the central processor 9100, for example, the audio file data processing apparatus may be configured as a chip connected to the central processor 9100, and the function of the audio file data processing method may be realized by the control of the central processor.
As shown in fig. 8, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 8; further, the electronic device 9600 may further include components not shown in fig. 8, which may be referred to in the art.
As shown in fig. 8, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the audio file data processing method with the server or the client as an execution subject in the foregoing embodiments, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the audio file data processing method with the server or the client as an execution subject in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
step S101: and acquiring an audio file and performing audio analysis.
Step S102: and judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file.
Step S103: and judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
As can be seen from the above description, the computer-readable storage medium provided in the embodiment of the present application obtains an audio file and performs audio analysis; judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file; judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing, and therefore, the format of the audio file can be standardized, the sampling rate of the audio file can be corrected, the track (sound channel) of the audio file can be optimized, and the conversion of the audio file is more standardized and more convenient.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method of audio file data processing, the method comprising:
acquiring an audio file and performing audio analysis;
judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format, and if not, performing format conversion processing on the audio file;
and judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
2. The method for processing the audio file data according to claim 1, wherein the step of determining whether the file format of the audio file subjected to the audio analysis meets a preset file format requirement, and if not, performing format conversion processing on the audio file comprises:
judging whether the suffix name of the audio file belongs to any one of ". mp 3", ". wav", and ". pcm";
if not, judging that the format of the audio file is abnormal, and converting the format of the audio file into a 'wav' format.
3. The audio file data processing method according to claim 2, comprising, before said converting said audio file into ". wav" format:
judging whether the suffix name of the audio file is ". m4 a";
and if so, converting the sound channel of the audio file into a single sound channel.
4. The method for processing the data of the audio file according to claim 1, wherein the determining whether the sampling rate of the audio file after the format conversion processing meets a preset sampling rate requirement, and if not, performing the sampling rate conversion processing on the audio file comprises:
judging whether the sampling rate of the audio file belongs to any one of 8000 and 16000;
if not, judging that the sampling rate of the audio file is abnormal, and converting the sampling rate of the audio file into 8000.
5. An audio file data processing apparatus characterized by comprising:
the audio file analysis module is used for acquiring an audio file and performing audio analysis;
the file format judging module is used for judging whether the file format of the audio file subjected to the audio analysis meets the requirement of a preset file format or not, and if not, performing format conversion processing on the audio file;
and the file sampling rate judging module is used for judging whether the sampling rate of the audio file subjected to the format conversion processing meets the requirement of a preset sampling rate, and if not, performing sampling rate conversion processing on the audio file to obtain a target audio file subjected to the sampling rate conversion processing.
6. The audio file data processing apparatus according to claim 5, wherein the file format determining module comprises:
a suffix name judging unit for judging whether a suffix name of the audio file belongs to any one of ". mp 3", ". wav", and ". pcm";
a suffix name replacing unit, configured to determine that the format of the audio file is abnormal if the suffix name of the audio file does not belong to any one of ". mp 3", ". wav", and ". pcm", and convert the format of the audio file into ". wav" format.
7. The audio file data processing apparatus according to claim 6, further comprising:
a binaural judgment unit operable to judge whether a suffix name of the audio file is ". m4 a";
and the sound channel conversion unit is used for converting the sound channel of the audio file into a single sound channel if the suffix name of the audio file is judged to be ". m4 a".
8. The audio file data processing apparatus of claim 5, wherein the file sampling rate determining module comprises:
a sampling rate judging unit for judging whether the sampling rate of the audio file belongs to any one of 8000 and 16000;
and the sampling rate conversion unit is used for judging that the sampling rate of the audio file is abnormal if the sampling rate of the audio file is judged not to belong to any one of 8000 and 16000, and converting the sampling rate of the audio file into 8000.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the audio file data processing method according to any one of claims 1 to 4 are implemented when the processor executes the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the audio file data processing method of any one of claims 1 to 4.
CN201911284620.1A 2019-12-13 2019-12-13 Audio file data processing method and device Pending CN111078930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911284620.1A CN111078930A (en) 2019-12-13 2019-12-13 Audio file data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911284620.1A CN111078930A (en) 2019-12-13 2019-12-13 Audio file data processing method and device

Publications (1)

Publication Number Publication Date
CN111078930A true CN111078930A (en) 2020-04-28

Family

ID=70314520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911284620.1A Pending CN111078930A (en) 2019-12-13 2019-12-13 Audio file data processing method and device

Country Status (1)

Country Link
CN (1) CN111078930A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111601157A (en) * 2020-05-11 2020-08-28 海信视像科技股份有限公司 Audio output method and display device
CN111863041A (en) * 2020-07-17 2020-10-30 东软集团股份有限公司 Sound signal processing method, device and equipment
CN111883152A (en) * 2020-06-23 2020-11-03 海信视像科技股份有限公司 Audio signal processing method and electronic equipment
CN112261140A (en) * 2020-10-23 2021-01-22 深圳市泰祺科技有限公司 Audio data processing method, device, equipment and storage medium
CN112383618A (en) * 2020-11-12 2021-02-19 平安普惠企业管理有限公司 Audio file optimization method and device, computer equipment and storage medium
CN112948326A (en) * 2021-03-09 2021-06-11 浙江百应科技有限公司 Method and device for unifying audio file formats based on ffmpeg and sox
CN113747236A (en) * 2021-10-19 2021-12-03 江下信息科技(惠州)有限公司 Multithreading-based high-speed audio format conversion method and system
CN116013334A (en) * 2023-01-28 2023-04-25 荣耀终端有限公司 Audio data processing method, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280179A (en) * 2018-01-22 2018-07-13 百度在线网络技术(北京)有限公司 Method and system, terminal and the computer readable storage medium of audio advertisement detection
CN110047472A (en) * 2019-03-15 2019-07-23 平安科技(深圳)有限公司 Batch conversion method, apparatus, computer equipment and the storage medium of voice messaging

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280179A (en) * 2018-01-22 2018-07-13 百度在线网络技术(北京)有限公司 Method and system, terminal and the computer readable storage medium of audio advertisement detection
CN110047472A (en) * 2019-03-15 2019-07-23 平安科技(深圳)有限公司 Batch conversion method, apparatus, computer equipment and the storage medium of voice messaging

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111601157A (en) * 2020-05-11 2020-08-28 海信视像科技股份有限公司 Audio output method and display device
CN111883152A (en) * 2020-06-23 2020-11-03 海信视像科技股份有限公司 Audio signal processing method and electronic equipment
CN111863041A (en) * 2020-07-17 2020-10-30 东软集团股份有限公司 Sound signal processing method, device and equipment
CN112261140A (en) * 2020-10-23 2021-01-22 深圳市泰祺科技有限公司 Audio data processing method, device, equipment and storage medium
CN112383618A (en) * 2020-11-12 2021-02-19 平安普惠企业管理有限公司 Audio file optimization method and device, computer equipment and storage medium
CN112383618B (en) * 2020-11-12 2022-09-13 平安普惠企业管理有限公司 Audio file optimization method and device, computer equipment and storage medium
CN112948326A (en) * 2021-03-09 2021-06-11 浙江百应科技有限公司 Method and device for unifying audio file formats based on ffmpeg and sox
CN113747236A (en) * 2021-10-19 2021-12-03 江下信息科技(惠州)有限公司 Multithreading-based high-speed audio format conversion method and system
CN116013334A (en) * 2023-01-28 2023-04-25 荣耀终端有限公司 Audio data processing method, electronic device and storage medium
CN116013334B (en) * 2023-01-28 2023-08-18 荣耀终端有限公司 Audio data processing method, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN111078930A (en) Audio file data processing method and device
CN108738006A (en) Data transmission method based on bluetooth and device
US8776244B2 (en) System and method for the generation of a content fingerprint for content identification
US11270690B2 (en) Method and apparatus for waking up device
CN110956956A (en) Voice recognition method and device based on policy rules
CN108062212A (en) A kind of voice operating method and device based on scene
EP2079030A1 (en) System and method for filtering user supplied video content using fingerprints
CN111782470B (en) Distributed container log data processing method and device
CN106776039A (en) A kind of data processing method and device
CN110602338B (en) Audio processing method, device, system, storage medium and equipment
CN111736772A (en) Storage space data processing method and device of distributed file system
CN113485952A (en) Data batch transmission method and device
CN111352605A (en) Audio playing and sending method and device
CN112259076A (en) Voice interaction method and device, electronic equipment and computer readable storage medium
CN116863935A (en) Speech recognition method, device, electronic equipment and computer readable medium
CN111460211A (en) Audio information playing method and device and electronic equipment
CN113299285A (en) Device control method, device, electronic device and computer-readable storage medium
CN115495519A (en) Report data processing method and device
CN110383797A (en) Terminal installation and communication means
CN113035246B (en) Audio data synchronous processing method and device, computer equipment and storage medium
CN111048063A (en) Audio synthesis method and device
CN109375892B (en) Method and apparatus for playing audio
CN113791984A (en) Automatic interface testing method and device
CN114067800A (en) Voice recognition method and device and electronic equipment
CN113206997B (en) Method and device for simultaneously detecting quality of multi-service recorded audio data

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200428

RJ01 Rejection of invention patent application after publication