CN111933190B - Recording method, device, system and medium - Google Patents

Recording method, device, system and medium Download PDF

Info

Publication number
CN111933190B
CN111933190B CN202011087665.2A CN202011087665A CN111933190B CN 111933190 B CN111933190 B CN 111933190B CN 202011087665 A CN202011087665 A CN 202011087665A CN 111933190 B CN111933190 B CN 111933190B
Authority
CN
China
Prior art keywords
recording
clock signals
frequency
audio data
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.)
Active
Application number
CN202011087665.2A
Other languages
Chinese (zh)
Other versions
CN111933190A (en
Inventor
王治和
姜滨
迟小羽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Optical 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 Goertek Optical Technology Co Ltd filed Critical Goertek Optical Technology Co Ltd
Priority to CN202011087665.2A priority Critical patent/CN111933190B/en
Publication of CN111933190A publication Critical patent/CN111933190A/en
Application granted granted Critical
Publication of CN111933190B publication Critical patent/CN111933190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • G11B2020/10537Audio or video recording
    • G11B2020/10546Audio or video recording specifically adapted for audio data

Abstract

The application discloses a recording method, a device, a system and a medium, wherein the method comprises the following steps: and respectively acquiring the recording parameters and the frequency of the clock signals contained in the audio data, and storing the frequency of the clock signals and the number of the clock signals into a specified area of the recording file after acquiring the number of the clock signals. The method comprises the steps of acquiring the frequency of a clock signal and the number of the clock signals, calculating the time length of a recording file according to the ratio of the number of the clock signals in a file header field to the frequency of the clock signals under the condition of playing the recording, wherein the number of the clock signals is calculated in advance, so that the number of the clock signals is not required to be calculated when the recording is played, the calculation time is short, and in addition, the calculation method only needs two data to calculate the time length of the recording file, so the calculation method has small workload, is simple and convenient, and accelerates the starting speed of the file. In addition, the recording device, the recording system and the recording medium correspond to the recording method, and the effect is the same as that of the recording method.

Description

Recording method, device, system and medium
Technical Field
The present application relates to the field of voice storage technologies, and in particular, to a recording method, apparatus, system, and medium.
Background
With the development of science and technology and economy, people pay more and more attention to the satisfaction brought by the spirit world and enjoy music, movies and the like, so that the quality of sound recording is more and more paid more and more attention to people.
The existing recording Format is mainly a lossless Audio Format (WAV), the WAV adopts a Resource exchange archive standard (Resource exchange File Format) File Format structure, a WAV File header generally consists of a RIFF block (RIFF chunk), a Format block (Format chunk), and a Data chunk (Data chunk), the Format block includes a sampling rate, a channel number, a sampling depth, and the like, the Data chunk includes the size of recorded Data, and when a signal for playing a recording is acquired, the duration of the recording File is calculated through a formula, wherein the formula specifically is:
Figure 672370DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 685325DEST_PATH_IMAGE002
in order to capture the size of the data,
Figure 98989DEST_PATH_IMAGE003
in order to be able to sample the rate,
Figure 481167DEST_PATH_IMAGE004
the number of the channels is the number of channels,
Figure 689294DEST_PATH_IMAGE005
is the sampling depth.
Because a plurality of data are needed to calculate the duration of the sound recording file, the calculation method is complex, the calculation time is slow, and the starting speed of the sound recording file is slow.
Disclosure of Invention
The invention aims to provide a recording method, which is used for saving clock signals into audio data so as to obtain the frequency of the clock signals and the number of the clock signals and quickly calculate the duration of a recording file according to the number of the clock signals and the signals. The application aims to further provide a recording device, a recording system and a recording medium.
In order to solve the above technical problem, the present application provides a recording method, including:
acquiring the frequency of a clock signal contained in the recording parameter and the audio data; the frequency of the clock signal is obtained by connecting a target microphone with a clock pin of a main chip;
calculating the number of the clock signals according to the recording parameters;
and saving the frequency of the clock signal and the number of the clock signals to a designated area of the sound recording file so as to calculate the duration of the sound recording file according to the ratio of the frequency of the clock signal to the number of the clock signals.
Preferably, the calculating the number of the clock signals according to the recording parameter specifically includes calculating the number of the clock signals according to the recording parameter after a recording end signal is obtained.
Preferably, the acquisition recording parameters are acquisition sampling rate, channel number and sampling depth.
Preferably, the method further comprises the following steps:
acquiring first audio data of the target microphone under the condition that the ratio of the frequency of the clock signal to the sampling rate is equal to a first preset ratio;
judging whether the first audio data are all FF;
if not, determining that audio data loss exists in the recording process;
and if so, returning to the step of acquiring the first audio data of the target microphone under the condition that the ratio of the frequency of the clock signal to the sampling rate is equal to a first preset ratio. Preferably, after determining that there is audio data loss in the recording process, the method further includes:
and sending an early warning signal so as to remind the user to record again.
Preferably, the method further comprises the following steps:
extracting second audio data of microphones other than the target microphone in the case that a ratio of the frequency of the clock signal to the sampling rate is equal to a second preset ratio; the second audio data is corresponding to the target microphone when the audio data is all FF or all 00;
creating a new sound recording file;
and saving the second audio data to the new sound recording file.
In order to solve the above technical problem, the present application further provides a recording apparatus, including:
the first acquisition module is used for acquiring the frequency of a clock signal contained in the recording parameter and the audio data; the frequency of the clock signal is obtained by connecting a target microphone with a clock pin of a main chip;
the calculation module is used for calculating the number of the clock signals according to the recording parameters;
the first saving module is used for saving the frequency of the clock signals and the number of the clock signals to a designated area of the sound recording file so as to calculate the duration of the sound recording file according to the ratio of the frequency of the clock signals to the number of the clock signals.
In order to solve the above technical problem, the present application further provides a recording apparatus, including:
a memory for storing a computer program;
a processor for implementing the steps of the sound recording method as described in any one of the above when the computer program is executed.
In order to solve the above technical problem, the present application further provides a recording system, including a microphone and a main chip connected to an output pin of the microphone, where a target microphone in the microphone is further connected to a clock signal pin of the main chip, so as to add a frequency of a clock signal of the main chip to the acquired audio data;
the main chip is used for acquiring recording parameters, calculating the number of the clock signals according to the recording parameters, storing the audio data into a recording file, and storing the frequency of the clock signals and the number of the clock signals into a designated area of the recording file, so that the duration of the recording file can be calculated according to the ratio of the frequency of the clock signals to the number of the clock signals.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of the sound recording method as described in any one of the above.
According to the recording method, the recording parameters and the frequency of the clock signals contained in the audio data are respectively obtained, and after the number of the clock signals is obtained, the frequency of the clock signals and the number of the clock signals are stored in the specified area of the recording file. The method comprises the steps of acquiring the frequency of a clock signal and the number of the clock signals, calculating the time length of a recording file according to the ratio of the number of the clock signals in a file header field to the frequency of the clock signals under the condition of playing the recording, wherein the number of the clock signals is calculated in advance, so that the number of the clock signals is not required to be calculated when the recording is played, the calculation time is short, and in addition, the calculation method only needs two data to calculate the time length of the recording file, so the calculation method has small workload, is simple and convenient, and accelerates the starting speed of the file.
In addition, the recording device, the recording system and the recording medium correspond to the recording method, and the effect is the same as that of the recording method.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a recording method according to an embodiment of the present application;
FIG. 2 is a flowchart of another recording method according to an embodiment of the present application;
FIG. 3 is a flowchart of another recording method according to an embodiment of the present application;
FIG. 4 is a diagram of audio data of a sound recording file when a ratio of a frequency of a clock signal to a sampling rate is equal to 0.5 according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a recording method in an application scenario according to an embodiment of the present application;
fig. 6 is a structural diagram of a recording apparatus according to an embodiment of the present application;
FIG. 7 is a block diagram of another audio recording device according to an embodiment of the present application;
FIG. 8 is a block diagram of a recording system according to an embodiment of the present application;
fig. 9 is a block diagram of another sound recording system according to an embodiment of the present application.
Detailed Description
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 only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a recording method, device, system and medium.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
Fig. 1 is a flowchart of a recording method according to an embodiment of the present application. As shown in fig. 1, the method includes:
s10: and acquiring the frequency of the clock signal contained in the recording parameter and the audio data.
It should be noted that the frequency of the clock signal is obtained by connecting the target microphone to the clock pin of the main chip, and the clock signal is saved as a part of the audio data in the recording file during recording. The frequency of the clock signal is not particularly limited, and in a specific implementation, the frequency of the clock signal may be set according to a recording requirement. The target microphone is a microphone connected with a clock pin of the main chip.
It should be noted that the type of the recording parameter is not limited, and the number of the clock signals may be calculated according to the recording parameter. In addition, the numerical value of the recording parameter is not particularly limited, and may be matched with the recording requirement in specific implementation.
As a preferred embodiment, the recording parameters specifically include a sampling rate, a channel number and a sampling depth, but it does not mean that the recording data includes only these three types of data. In addition, the values of the sampling rate, the number of channels and the sampling depth are not limited specifically, and in an implementation, the sampling rate may be 48000, the number of channels may be 8, and the sampling depth may be 32.
It should be noted that, the data related to the recording parameters and the frequency of the clock signal can be known before the recording starts.
S11: and calculating the number of the clock signals according to the recording parameters.
It should be noted that the number of clock signals is not limited to be calculated.
As a preferred embodiment, when the recording parameters specifically include a sampling rate, a channel number and a sampling depth, the number of clock signals is calculated as follows:
Figure 658387DEST_PATH_IMAGE006
wherein the content of the first and second substances,
Figure 344583DEST_PATH_IMAGE007
which represents the number of clock signals that are to be clocked,
Figure 348311DEST_PATH_IMAGE008
representing the size (amount of occupied storage space) of the current sound recording file,
Figure 727340DEST_PATH_IMAGE009
which represents the sampling rate of the sample, is,
Figure 183729DEST_PATH_IMAGE010
which represents the number of channels,
Figure 673616DEST_PATH_IMAGE011
which represents the depth of the sample and which,
Figure 531851DEST_PATH_IMAGE012
representing the frequency of the clock signal.
It should be noted that, the time for calculating the number of the clock signals is not specifically limited, and the number of the clock signals may be calculated periodically during the recording process, or may be calculated after the recording is finished.
S12: and saving the frequency of the clock signals and the number of the clock signals to a designated area of the sound recording file.
It should be noted that, when playing the audio record, the frequency of the clock signal and the number of the clock signal in the designated area of the audio record file can be directly extracted, and the duration of the audio record file can be directly calculated by the ratio of the number of the clock signal to the frequency of the clock signal. In addition, the specified area of the sound recording file is not specifically limited, and is matched with the user requirement, and in a general case, the specified area of the sound recording file is specifically a header field of the sound recording file, namely the foremost end of the sound recording file.
Note that table 1 shows data of a specified area of the audio record file and its byte size. As shown in table 1, during the saving process, the frequency of the clock signal occupies 4 bytes in the file designation area, and the number of the clock signals occupies 4 bytes in the file designation area. In addition, when the recording parameters specifically include a sampling rate, a channel number, and a sampling depth, the sampling rate occupies 4 bytes in the file designation area, the channel number occupies 2 bytes in the file designation area, and the sampling depth occupies 2 bytes in the file designation area.
TABLE 1
Figure 81781DEST_PATH_IMAGE013
As a preferred embodiment, after the recording parameters are collected, creating a recording file; when saving the frequency of the clock signal and the number of the clock signals to the designated area of the recording file, the audio data can be saved to the recording file.
In the recording method provided in this embodiment, the recording parameter and the frequency of the clock signal included in the audio data are respectively obtained, and after the number of the clock signal is obtained, the frequency of the clock signal and the number of the clock signal are saved in the specified area of the recording file. The method comprises the steps of acquiring the frequency of a clock signal and the number of the clock signals, calculating the time length of a recording file according to the ratio of the number of the clock signals in a file header field to the frequency of the clock signals under the condition of playing the recording, wherein the number of the clock signals is calculated in advance, so that the number of the clock signals is not required to be calculated when the recording is played, the calculation time is short, and in addition, the calculation method only needs two data to calculate the time length of the recording file, so the calculation method has small workload, is simple and convenient, and accelerates the starting speed of the file.
On the basis of the above embodiment, specifically, the number of clock signals is calculated according to the recording parameters after the recording-end signal is obtained.
Compared with the method for calculating the number of clock signals according to the period, the method for calculating the sound recording provided by the embodiment can obtain the number of the final clock signals through one calculation operation, reduce unnecessary calculation operations in the period calculation, and therefore improve the speed of generating the sound recording file.
Fig. 2 is a flowchart of another recording method according to an embodiment of the present application. As shown in fig. 2, on the basis of the above embodiment, the method further includes:
s20: and judging whether the ratio of the frequency of the clock signal to the sampling rate is equal to a first preset ratio or not, if so, entering S21, and if not, returning to S20.
It should be noted that the first predetermined ratio is not limited, and in an implementation, the first predetermined ratio may be 4.
S21: first audio data of a target microphone is acquired.
S22: and judging whether the first audio data are all FF, if so, returning to S20, and if not, entering S23.
S23: and determining that audio data loss exists in the recording process.
Table 2 shows audio data of the sound recording file when the ratio of the frequency of the clock signal to the sampling rate is 4, where the sampling rate is 48KHz, the number of channels is 8, the sampling depth is 32, the frequency of the clock signal is 24KHz, the number of the clock signals is 2048, the microphone 1 is connected to a clock pin of a main chip of the main chip to obtain the clock signal, and the clock signal is added to the audio data collected by the microphone 1. As shown in table 2, when the ratio of the frequency of the clock signal to the sampling rate is 4, all the audio data collected by the microphone 1 are FF, so that there is no packet loss in the audio data collected by each of the 8 microphones, and if at least one of the audio data collected by the microphone 1 is not FF, the audio data collected by the 8 microphones is lost.
TABLE 2
Figure 526931DEST_PATH_IMAGE014
It should be noted that, the audio data collected by 8 microphones in table 2 is only one representation, and in the specific implementation, the number of the microphones is not specifically limited, and only one microphone needs to be connected to the clock pin of the main chip to add the clock signal to the audio data.
In the recording method provided by this embodiment, when a ratio of a frequency of a clock signal to a sampling rate of a recording file is a first preset ratio, first audio data of a target microphone connected to a clock pin of a main chip is collected, and whether all the first audio data are FFs is determined, and if not, it is determined that the audio data are lost. The clock signal is added in the audio data, so that the first audio data when the first audio data are all high-frequency can be extracted to judge whether the packet is lost or not in the recording process, a user can know the packet loss in the recording process in time, and the use feeling of the user is improved.
On the basis of the above embodiment, after S23, the method further includes:
and sending an early warning signal so as to remind the user to record again.
It should be noted that the warning signal is not specifically limited, and only needs to remind the user to record the sound again, and in the specific implementation, the warning signal is matched with the actual requirement, for example, the user can be reminded through a pop-up window by recording the sound through a mobile phone.
According to the recording method provided by the embodiment, after the audio data loss exists in the recording process, the user is reminded of recording again by sending the early warning signal, so that the user is reminded of the audio data loss in time, and the use feeling of the user is improved.
Fig. 3 is a flowchart of another recording method according to an embodiment of the present application. As shown in fig. 3, on the basis of the above embodiment, the method further includes:
s30: and judging whether the ratio of the frequency of the clock signal to the sampling rate is equal to a second preset ratio or not, if so, entering S31, and if not, returning to S30.
It should be noted that the second predetermined ratio is not limited, and in an implementation, the second predetermined ratio may be selected to be 0.5.
S31: second audio data of microphones other than the target microphone is extracted.
Note that the second audio data corresponds to the case where the audio data of the target microphone is all FFs or all 00.
S32: a new sound recording file is created.
S33: and saving the second audio data to the new sound recording file.
Fig. 4 is an audio data diagram of a sound recording file when a ratio of a frequency of a clock signal to a sampling rate is equal to 0.5 according to an embodiment of the present application. As shown in fig. 4, when the audio data of the microphone 1 is 00, the audio data of the microphone 2 is 2D, F7, FF, 7F, the audio data of the microphone 3 is 7C, FF, DC, EE, the audio data of the microphone 4 is F2, F8, 7B, FF, the audio data of the microphone 5 is AA, F7, 31, FF, the audio data of the microphone 6 is 2D, F7, FF, 7F, the audio data of the microphone 7 is 7C, FF, DE, FE, and the audio data of the microphone 8 is F2, F8, 7A, EF.
When the ratio of the frequency of the clock signal to the sampling rate is equal to 0.5, the audio data of the microphone 1 is collected when all the audio data are FF or all the audio data are 00. For example, when the audio data of the microphone 1 is 00, the corresponding audio data 2D, F7, FF, 7F of the microphone 2, the audio data 7C, FF, DC, EE of the microphone 3, the audio data F2, F8, 7B, FF of the microphone 4, the audio data AA, F7, 31, FF of the microphone 5, the audio data 2D, F7, FF, 7F of the microphone 6, the audio data 7C, FF, DE, FE of the microphone 7, and the audio data F2, F8, 7A, EF of the microphone 8 are extracted and stored in a newly created sound recording file, in which case the sampling rate of the new sound recording file is 0.5 times the original.
It should be noted that, it is only one implementation manner that the ratio of the frequency of the clock signal to the sampling rate is equal to 0.5, and in a specific implementation, the original audio file may be resampled according to a user requirement by adjusting the ratio of the frequency of the clock signal to the sampling rate.
In the recording method provided by this embodiment, when the ratio of the frequency of the clock signal to the sampling rate of the recording file is the second preset ratio, the second audio data of other microphones corresponding to the target microphone when the audio data is all FF or all 00 is extracted. Because the audio data at a certain moment or a certain period of time can be directly extracted from the original audio data, so as to facilitate the non-destructive test of the recording file or the listening of more contents of the audio at a certain moment or within a certain period of time, compared with the original method through complicated mathematical change, the method provided by the embodiment can conveniently extract the audio data at a certain moment or within a certain period of time, thereby reducing the complexity of resampling and reducing the time consumption of a user.
In order to make the technical solutions provided by the present invention more clear to those skilled in the art, a specific application scenario is further provided herein for description, and fig. 5 is a flowchart of a recording method in an application scenario provided in the embodiment of the present application. As shown in fig. 5, the method includes the steps of:
s40: a sound recording file is created.
S41: and acquiring the sampling rate, the number of channels, the sampling depth and the frequency of the clock signal and storing the frequency into a header field.
S42: and acquiring audio data and writing the audio data into the recording file.
S43: and judging whether the recording is finished, if so, entering S44, and if not, returning to S42.
S44: and calculating the number of clock signals according to the sampling rate, the number of channels and the sampling depth, and storing the number of the clock signals to a header domain.
S45: and inserting the header field into the foremost end of the sound recording file, and storing the sound recording file.
S46: when the user plays the recording, the time length of the recording file is calculated according to the ratio of the number of the clock signals to the frequency of the clock signals, and the recording file is played formally.
The above steps are a specific application scenario, and corresponding steps may be added in other application scenarios, which are not limited herein.
In the foregoing embodiments, the recording method is described in detail, and the application also provides embodiments corresponding to the recording apparatus. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one from the perspective of the function module and the other from the perspective of the hardware.
Fig. 6 is a structural diagram of a recording apparatus according to an embodiment of the present application. As shown in fig. 6, the apparatus includes, based on the angle of the function module:
the first acquisition module 10 is configured to acquire a recording parameter and a frequency of a clock signal included in the audio data, where the frequency of the clock signal is obtained by connecting a target microphone to a clock pin of the main chip.
And the calculating module 11 is used for calculating the number of the clock signals according to the recording parameters.
The first saving module 12 is configured to save the frequency of the clock signal and the number of the clock signal to a designated area of the audio file, so as to calculate the duration of the audio file according to a ratio of the frequency of the clock signal to the number of the clock signal.
As a preferred embodiment, the method further comprises the following steps:
and the second acquisition module is used for acquiring first audio data of the target microphone under the condition that the ratio of the frequency of the clock signal to the sampling rate is equal to a first preset ratio.
And the judging module is used for judging whether the first audio data are all FF.
And the determining module is used for determining that audio data loss exists in the recording process if the audio data loss does not exist.
And the execution module is used for triggering the second acquisition module to acquire the first audio data of the target microphone under the condition that the ratio of the frequency of the clock signal to the sampling rate is equal to a first preset ratio if the frequency of the clock signal to the sampling rate is equal to the first preset ratio.
Further comprising:
and the early warning module is used for sending an early warning signal so as to remind the user of recording again.
Further comprising:
the extraction module is used for extracting second audio data of other microphones except the target microphone under the condition that the ratio of the frequency of the clock signal to the sampling rate is equal to a second preset ratio; the second audio data is corresponding to the target microphone when the audio data is all FF or all 00.
And the creating module is used for creating a new sound recording file.
And the second storage module is used for storing second audio data into the new sound recording file.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
The recording apparatus provided in this embodiment is configured to obtain a recording parameter and a frequency of a clock signal included in audio data, and after obtaining the number of the clock signals, store the frequency of the clock signal and the number of the clock signals in a specified area of a recording file. The method comprises the steps of acquiring the frequency of a clock signal and the number of the clock signals, calculating the time length of a recording file according to the ratio of the number of the clock signals in a file header field to the frequency of the clock signals under the condition of playing the recording, wherein the number of the clock signals is calculated in advance, so that the number of the clock signals is not required to be calculated when the recording is played, the calculation time is short, and in addition, the calculation method only needs two data to calculate the time length of the recording file, so the calculation method has small workload, is simple and convenient, and accelerates the starting speed of the file.
Fig. 7 is a structural diagram of another audio recording apparatus according to an embodiment of the present application. As shown in fig. 7, the apparatus includes, from the perspective of the hardware configuration:
a memory 20 for storing a computer program;
a processor 21, configured to implement the steps of the recording method in the above embodiments when executing the computer program.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a Graphics Processing Unit (GPU) which is responsible for rendering and drawing the content required to be displayed on the display screen.
The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps of the sound recording method disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, Windows, Unix, Linux, and the like. The data 203 may include, but is not limited to, data involved in a recording method, and the like.
In some embodiments, the sound recording device may further include a display 22, an input/output interface 23, a communication interface 24, a power source 25, and a communication bus 26.
Those skilled in the art will appreciate that the configuration shown in fig. 7 is not intended to be limiting of recording devices and may include more or fewer components than those shown.
The sound recording device provided by the embodiment comprises a memory and a processor, and when the processor executes a program stored in the memory, the following method can be realized: and respectively acquiring the recording parameters and the frequency of the clock signals contained in the audio data, and storing the frequency of the clock signals and the number of the clock signals into a specified area of the recording file after acquiring the number of the clock signals. The method comprises the steps of acquiring the frequency of a clock signal and the number of the clock signals, calculating the time length of a recording file according to the ratio of the number of the clock signals in a file header field to the frequency of the clock signals under the condition of playing the recording, wherein the number of the clock signals is calculated in advance, so that the number of the clock signals is not required to be calculated when the recording is played, the calculation time is short, and in addition, the calculation method only needs two data to calculate the time length of the recording file, so the calculation method has small workload, is simple and convenient, and accelerates the starting speed of the file.
Fig. 8 is a structural diagram of a sound recording system according to an embodiment of the present application. As shown in fig. 8, the recording system includes a target microphone 30, a microphone 31, and a main chip 32. The main chip 32 is connected to the target microphone 30 and the output pins of the microphone 31, and the target microphone 30 is further connected to the clock pin of the main chip 32, so as to add the clock signal of the main chip 32 to the collected audio data.
The main chip 32 is configured to obtain the recording parameters, calculate the number of the clock signals according to the recording parameters, store the audio data of the target microphone 30 and the microphone 31 in a recording file, and store the frequency of the clock signals and the number of the clock signals in a designated area of the recording file, so as to calculate the duration of the recording file according to the ratio of the frequency of the clock signals to the number of the clock signals.
It should be noted that the type of the recording parameter obtained by the main chip 32 is not particularly limited.
As a preferred embodiment, the recording parameters may specifically include a sampling rate, a channel number and a sampling depth, but it does not mean that the recording data includes only these three types of data.
It should be further noted that, when the recording parameters specifically include a sampling rate, a channel number, and a sampling depth, the number of clock signals is calculated as follows:
Figure 86088DEST_PATH_IMAGE006
wherein the content of the first and second substances,
Figure 595567DEST_PATH_IMAGE007
which represents the number of clock signals that are to be clocked,
Figure 50819DEST_PATH_IMAGE008
representing the size (amount of occupied storage space) of the current sound recording file,
Figure 481801DEST_PATH_IMAGE009
which represents the sampling rate of the sample, is,
Figure 313490DEST_PATH_IMAGE010
which represents the number of channels,
Figure 880738DEST_PATH_IMAGE011
which represents the depth of the sample and which,
Figure 356760DEST_PATH_IMAGE012
representing the frequency of the clock signal.
Fig. 9 is a hardware structure diagram of a sound recording system according to an embodiment of the present application. As shown in fig. 9, data of the external voice signal processing chip 46 interacts with the main chip 32 through a Time Division Multiplexing (TDM) interface, the main chip 32 controls the voice signal processing chip 46 through an IIC bus, the voice signal processing chip 46 is connected with 4 Pulse Density Modulation (PDM) chips, each PDM chip is connected with 2 digital microphones, that is, the voice signal processing chip 46 is respectively connected with the target microphone 30, the microphone 31, the microphone 40, the microphone 41, the microphone 42, the microphone 43, the microphone 44 and the microphone 45, wherein the target microphone 30 is directly connected with a clock pin of the main chip 32.
During recording, a target microphone 30 (the above-mentioned target microphone) connected to a clock pin of the main chip 32 collects a clock signal and an audio signal, the microphone 31, the microphone 40, the microphone 41, the microphone 42, the microphone 43, the microphone 44, and the microphone 45 collect the audio signal, the audio signal is processed by the voice signal processing chip 46 to generate audio data, the audio data is transmitted to the main chip 32 through the TDM interface, the main chip 32 obtains the frequency of the clock signal and recording parameters in the audio data, calculates the number of the clock signal according to the recording parameters, saves the frequency of the clock signal and the number of the clock signal to a file header field, and saves the audio data to a recording file.
It should be noted that 4 PDM chips are only one embodiment, and the number of PDM chips is not limited, that is, in this embodiment, 8 microphones are only one embodiment, and the number of microphones is not specifically limited, and only the target microphone 30 needs to be connected to the clock pin of the main chip 32. It should also be noted that the clock signal of the master chip 32 can be set as required, i.e. the frequency of the clock signal can be matched as required.
The embodiment provides a recording system, which comprises a microphone and a main chip connected with an output pin of the microphone, wherein a target microphone of the microphone is also connected with a clock pin of the main chip, and the main chip is used for acquiring audio data, recording parameters and the frequency of a clock signal contained in the audio data, calculating the number of the clock signal according to the recording parameters, storing the frequency of the clock signal and the number of the clock signal to a specified area of a file, and storing the audio data to the file. The method comprises the steps of acquiring the frequency of a clock signal and the number of the clock signals, calculating the time length of a recording file according to the ratio of the number of the clock signals in a file header field to the frequency of the clock signals under the condition of playing the recording, wherein the number of the clock signals is calculated in advance, so that the number of the clock signals is not required to be calculated when the recording is played, the calculation time is short, and in addition, the calculation method only needs two data to calculate the time length of the recording file, so the calculation method has small workload, is simple and convenient, and accelerates the starting speed of the file.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The recording apparatus provided in this embodiment includes a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following method may be implemented: and respectively acquiring the recording parameters and the frequency of the clock signals contained in the audio data, and storing the frequency of the clock signals and the number of the clock signals into a specified area of the recording file after acquiring the number of the clock signals. The method comprises the steps of acquiring the frequency of a clock signal and the number of the clock signals, calculating the time length of a recording file according to the ratio of the number of the clock signals in a file header field to the frequency of the clock signals under the condition of playing the recording, wherein the number of the clock signals is calculated in advance, so that the number of the clock signals is not required to be calculated when the recording is played, the calculation time is short, and in addition, the calculation method only needs two data to calculate the time length of the recording file, so the calculation method has small workload, is simple and convenient, and accelerates the starting speed of the file.
A recording method, an apparatus, a system and a medium provided by the present application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method of recording, the method comprising:
acquiring the frequency of a clock signal contained in the recording parameter and the audio data; the frequency of the clock signal is obtained by connecting a target microphone with a clock pin of a main chip;
calculating the number of the clock signals according to the recording parameters;
and saving the frequency of the clock signals and the number of the clock signals to a designated area of the sound recording file so as to calculate the duration of the sound recording file according to the ratio of the number of the clock signals to the frequency of the clock signals.
2. The audio recording method according to claim 1, wherein the calculating the number of clock signals according to the recording parameters includes calculating the number of clock signals according to the recording parameters after acquiring an end-of-recording signal.
3. The audio recording method according to claim 1, wherein the parameters of the acquired audio recording are acquisition sampling rate, number of channels and sampling depth.
4. The audio recording method according to claim 3, further comprising:
acquiring first audio data of the target microphone under the condition that the ratio of the frequency of the clock signal to the sampling rate is equal to a first preset ratio;
judging whether the first audio data are all FF;
if not, determining that audio data loss exists in the recording process;
and if so, returning to the step of acquiring the first audio data of the target microphone under the condition that the ratio of the frequency of the clock signal to the sampling rate is equal to a first preset ratio.
5. The audio recording method of claim 4, further comprising, after determining that there is audio data loss during the audio recording,:
and sending an early warning signal so as to remind the user to record again.
6. The audio recording method according to claim 3, further comprising:
extracting second audio data of microphones other than the target microphone in the case that a ratio of the frequency of the clock signal to the sampling rate is equal to a second preset ratio; the second audio data is corresponding to the target microphone when the audio data is all FF or all 00;
creating a new sound recording file;
and saving the second audio data to the new sound recording file.
7. A sound recording apparatus, comprising:
the first acquisition module is used for acquiring the frequency of a clock signal contained in the recording parameter and the audio data; the frequency of the clock signal is obtained by connecting a target microphone with a clock pin of a main chip;
the calculation module is used for calculating the number of the clock signals according to the recording parameters;
the first saving module is used for saving the frequency of the clock signals and the number of the clock signals to a designated area of the sound recording file so as to calculate the duration of the sound recording file according to the ratio of the number of the clock signals to the frequency of the clock signals.
8. A sound recording apparatus, comprising:
a memory for storing a computer program;
processor for implementing the steps of the sound recording method as claimed in any one of claims 1-6 when executing the computer program.
9. A sound recording system is characterized by comprising microphones and a main chip connected with output pins of the microphones, wherein a target microphone in the microphones is also connected with a clock signal pin of the main chip so as to add the frequency of a clock signal of the main chip into collected audio data;
the main chip is used for acquiring recording parameters, calculating the number of the clock signals according to the recording parameters, storing the audio data into a recording file, and storing the frequency of the clock signals and the number of the clock signals into a designated area of the recording file, so that the duration of the recording file can be calculated according to the ratio of the number of the clock signals to the frequency of the clock signals.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the sound recording method as claimed in any one of claims 1-6.
CN202011087665.2A 2020-10-13 2020-10-13 Recording method, device, system and medium Active CN111933190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011087665.2A CN111933190B (en) 2020-10-13 2020-10-13 Recording method, device, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011087665.2A CN111933190B (en) 2020-10-13 2020-10-13 Recording method, device, system and medium

Publications (2)

Publication Number Publication Date
CN111933190A CN111933190A (en) 2020-11-13
CN111933190B true CN111933190B (en) 2021-02-02

Family

ID=73334469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011087665.2A Active CN111933190B (en) 2020-10-13 2020-10-13 Recording method, device, system and medium

Country Status (1)

Country Link
CN (1) CN111933190B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113971969B (en) * 2021-08-12 2023-03-24 荣耀终端有限公司 Recording method, device, terminal, medium and product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103369305A (en) * 2013-06-28 2013-10-23 武汉烽火众智数字技术有限责任公司 Method for realizing voice intercom synchronous recording and playback in video monitoring system
CN105868400A (en) * 2016-04-19 2016-08-17 乐视控股(北京)有限公司 Recorded sound information processing method and recorded sound information processing device
CN110534136A (en) * 2018-05-23 2019-12-03 北京京东尚科信息技术有限公司 The method and apparatus of recording

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4380598B2 (en) * 2005-06-16 2009-12-09 株式会社日立製作所 Receiving apparatus and receiving method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103369305A (en) * 2013-06-28 2013-10-23 武汉烽火众智数字技术有限责任公司 Method for realizing voice intercom synchronous recording and playback in video monitoring system
CN105868400A (en) * 2016-04-19 2016-08-17 乐视控股(北京)有限公司 Recorded sound information processing method and recorded sound information processing device
CN110534136A (en) * 2018-05-23 2019-12-03 北京京东尚科信息技术有限公司 The method and apparatus of recording

Also Published As

Publication number Publication date
CN111933190A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
US11683278B2 (en) Spectrogram and message bar generation based on audio data in an instant messaging application
US10776422B2 (en) Dual sound source audio data processing method and apparatus
CN109360562B (en) Echo cancellation method, device, medium, and voice wake-up method and device
CN110265064B (en) Audio frequency crackle detection method, device and storage medium
US20120101606A1 (en) Information processing apparatus, content data reconfiguring method and program
JP2019535039A (en) Audio signal detection method and apparatus
JP2016502139A (en) System, computer-readable storage medium and method for recovering compressed audio signals
CN102568527A (en) Method and system for easily cutting audio files and applied mobile handheld device
CN104991755B (en) A kind of information processing method and electronic equipment
CN110312146B (en) Audio processing method and device, electronic equipment and storage medium
CN111933190B (en) Recording method, device, system and medium
CN104091596A (en) Music identifying method, system and device
CN110688518A (en) Rhythm point determining method, device, equipment and storage medium
CN109949792B (en) Multi-audio synthesis method and device
CN110428798B (en) Method for synchronizing voice and accompaniment, Bluetooth device, terminal and storage medium
CN107481739B (en) Audio cutting method and device
WO2020228107A1 (en) Audio repair method and device, and readable storage medium
US20070216546A1 (en) Sound-reproducing apparatus and high frequency interpolation-processing method
JP5267606B2 (en) Display device and program
CN115731943A (en) Plosive detection method, plosive detection system, storage medium and electronic equipment
CN112735481B (en) POP sound detection method and device, terminal equipment and storage medium
CN112433697B (en) Resource display method and device, electronic equipment and storage medium
CN113157240A (en) Voice processing method, device, equipment, storage medium and computer program product
US20230388693A1 (en) Method, apparatus and system for adjusting volume of head-mounted display device, and storage medium
WO2017054507A1 (en) Sound effect simulation method, apparatus and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221117

Address after: 266104 No. 500, Songling Road, Laoshan District, Qingdao, Shandong

Patentee after: GOERTEK TECHNOLOGY Co.,Ltd.

Address before: 261031 north of Yuqing street, east of Dongming Road, high tech Zone, Weifang City, Shandong Province (Room 502, Geer electronics office building)

Patentee before: GoerTek Optical Technology Co.,Ltd.