Audio storage method and device, electronic equipment and storage medium

By employing buffer detection and silent data packet storage strategies, the high power consumption and storage space occupation issues caused by all-day recording were resolved, achieving low-power storage and recording integrity, and extending device lifespan.

CN122633129APending Publication Date: 2026-08-25GOERTEK INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611000930.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

In existing technologies, 24/7 recording leads to high power consumption and storage space consumption in smart devices, especially excessive storage of silent data and environmental noise data.

Method used

The system uses a buffer to detect audio data frames, identifies silent segments and generates silent data packets, and stores silent data packets only in the target storage area to avoid storing the complete audio stream. Combined with a traceable write mechanism, it ensures the integrity of the set sound data.

Benefits of technology

A low-power storage strategy was implemented to reduce storage space usage, lower memory erase/write frequency, extend hardware life, and ensure recording integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633129A_ABST
    Figure CN122633129A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an audio storage method and device, electronic equipment and storage medium. The method comprises: sequentially writing the collected audio data into the cache area by frame, wherein when the number of audio data frames in the cache area reaches a set threshold, the newly received audio data replaces the earliest written audio data frame; detecting the collected audio data frame by frame according to the collection sequence to obtain a set sound detection result of each frame; in the case where it is determined based on the set sound detection result of each frame that the corresponding audio data does not contain the set sound, recording the timestamp of the starting frame of the corresponding audio data that does not contain the set sound, and the audio duration that does not contain the set sound; generating a mute data packet including the timestamp of the starting frame that does not contain the set sound and the audio duration that does not contain the set sound; and writing the mute data packet into the target storage area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of recording technology, and more specifically, to an audio storage method, an audio storage device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] With the development of artificial intelligence technology, more and more smart devices need to have all-weather voice monitoring and context recording capabilities to support applications such as speech-to-text and intelligent interaction. Related technologies often employ continuous recording to capture and store all audio data. This leads to the processor and memory of smart devices working continuously, resulting in high standby power consumption. Furthermore, continuous recording generates a large amount of unused audio data (e.g., silence data, ambient noise data), occupying significant storage space and increasing memory write cycles. Therefore, how to reduce power consumption while minimizing the storage space occupied by silence data has become a pressing issue. Summary of the Invention

[0003] One objective of this disclosure is to provide a new technical solution for audio storage methods that achieves a low-power storage strategy without a setting stage for sound, thereby reducing the storage space occupied by the target storage area.

[0004] According to a first aspect of this disclosure, an audio storage method is provided, comprising: The collected audio data is written to the buffer frame by frame. When the number of frames of audio data in the buffer reaches a set threshold, the newly received audio data overwrites the earliest written frame of audio data. The collected audio data is detected frame by frame in the order of collection to obtain the set sound detection result for each frame; If, based on the detection results of the set sound in each frame, it is determined that the corresponding audio data does not contain a set sound, the timestamp of the starting frame in which the set sound does not exist in the corresponding audio data and the duration of the audio without the set sound are recorded. Generate a silent data packet that includes the timestamp of the start frame where no set sound exists and the duration of the audio signal where no set sound exists; Write the mute data packet to the target storage area.

[0005] Optionally, the method further includes: If it is determined that a set sound exists in the corresponding audio data based on the set sound detection result of each frame, then obtain consecutive frames of historical audio data from the buffer, wherein the consecutive frames include the frame corresponding to which the set sound is confirmed to exist and the consecutive frames before it. Based on the continuous multi-frame historical audio data and the audio data of the set sound collected after the existence of the set sound is confirmed, a set sound data packet is generated and written into the target storage area.

[0006] Optionally, the method further includes: synchronously writing audio data after the frame corresponding to the set sound is confirmed to exist into the buffer.

[0007] Optionally, after writing the set sound data packet to the target storage area, the method further includes: stopping the writing of the set sound data packet to the target storage area if the set sound detection result of a frame is that the set sound does not exist.

[0008] Optionally, the method further includes: Based on the set sound data packet and the silence data packet, an audio data stream that remains continuous on the time axis is generated.

[0009] Optionally, the method further includes: If, based on the detection results of the set sound in each frame, it is determined that the corresponding audio data does not contain the set sound, the energy characteristic value of the audio data for which the set sound does not exist is recorded.

[0010] Optionally, determining the presence of a specific sound in the corresponding audio data based on the detection result of the specific sound in each frame includes: If the detection result of the set sound is that the set sound is present in a frame, record the number of consecutive frames of audio data in which the set sound is present; If the number of consecutive frames of audio data containing a set sound is greater than the set number of frames, it is determined that the corresponding audio data contains a set sound.

[0011] According to a second aspect of this disclosure, an audio storage device is provided, comprising: The buffer writing module is used to write the collected audio data frame by frame into the buffer. When the number of frames of audio data in the buffer reaches a set threshold, the newly received audio data overwrites the earliest written frame of audio data. The detection module is used to detect the collected audio data frame by frame in the order of collection to obtain the set sound detection result for each frame. The recording module is used to record the timestamp of the starting frame in the corresponding audio data where no set sound is present, and the duration of the audio data where no set sound is present, when it is determined based on the set sound detection result of each frame. The data packet generation module is used to generate a silent data packet that includes the timestamp of the start frame where the set sound does not exist and the duration of the audio when the set sound does not exist. The target storage area writing module is used to write the silence data packet to the target storage area.

[0012] According to a third aspect of this disclosure, an electronic device is provided, including a memory and a processor, the memory storing a computer program for controlling the processor to operate in order to perform the method according to any one of the first aspects.

[0013] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided, on which a computer program is stored, the computer program implementing the method according to any one of the first aspects when executed by a processor.

[0014] This disclosure provides an audio storage method. By first writing the collected audio data into a buffer, and then, when the absence of a set sound is detected based on the audio data written into the buffer, a silence data packet storage strategy is adopted. Only the silence data packet is stored in the target storage area, instead of directly writing the complete audio stream corresponding to the absence of a set sound into the target storage area. This achieves a low-power storage strategy in the stage where no set sound is present, reduces the storage space occupied in the target storage area, lowers the memory erase / write frequency, and extends the hardware lifespan.

[0015] The features and advantages of the embodiments of this specification will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the disclosure.

[0017] Figure 1 This is a schematic diagram of the structure of an electronic device to which the methods of the embodiments of this disclosure can be applied.

[0018] Figure 2 This is a flowchart illustrating an audio storage method according to some embodiments.

[0019] Figure 3 This is a schematic diagram of the sound data packet generation process according to some other embodiments.

[0020] Figure 4 This is a schematic diagram of the audio data stream generation process according to some other embodiments.

[0021] Figure 5 This is a schematic block diagram of an audio storage device according to some embodiments.

[0022] Figure 6 This is a block schematic diagram of an electronic device according to some embodiments.

[0023] Figure 7 This is a block schematic diagram of an electronic device according to some embodiments. Detailed Implementation

[0024] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0025] The following description of at least one exemplary embodiment is merely illustrative and is not intended to limit the scope of this disclosure or its application or use.

[0026] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0027] In all the examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0028] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0029] This disclosure relates to an audio storage scheme. Figure 1 This is a schematic diagram of the structure of an electronic device capable of applying the audio storage method of the present disclosure embodiments. The electronic device 1000 is a device capable of running a computer program, which can be a local application installed on the electronic device, or a web application, lightweight application, or mini-program, etc., without limitation herein. The electronic device 1000 can be a device with recording function, such as a voice recorder, mobile phone, tablet computer, or wearable device. Wearable devices can be smart glasses, smart headphones, smart bracelets, smart pendants, etc., without limitation herein.

[0030] like Figure 1 As shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a microphone 1500, etc. Figure 1 The hardware configuration shown is illustrative only and is not intended to limit this disclosure, its application, or its use.

[0031] The processor 1100 is used to execute computer programs, which can be written using instruction sets of architectures such as x86, Arm, RISC, MIPS, and SSE. The memory 1200 includes, for example, ROM (Read-Only Memory), RAM (Random Access Memory), and non-volatile memory such as a hard disk. The interface device 1300 includes, for example, a USB interface, a network cable interface, and a headphone jack. The communication device 1400 is capable of wired or wireless communication. The communication device 1400 may include at least one short-range communication module, such as any module for short-range wireless communication based on short-range wireless communication protocols such as Hilink, WiFi (IEEE 802.11), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, and LiFi. The communication device 1400 may also include a long-range communication module, such as any module for WLAN, GPRS, or 2G / 3G / 4G / 5G long-range communication.

[0032] When the electronic device is used to set up voice perception and recording, it records audio data in a full-time recording mode and stores all audio data. This causes the electronic device to work for a long time, resulting in high standby power consumption. At the same time, the all-day recording will generate a large amount of non-set audio data, occupying a large amount of storage space and increasing the number of memory writes.

[0033] To address the aforementioned technical issues, this disclosure provides an audio storage method. By first writing the collected audio data into a buffer, and then, when the absence of a set sound is detected based on the audio data written into the buffer, a silence data packet storage strategy is adopted. Only the silence data packet is stored in the target storage area, instead of directly writing the complete audio stream corresponding to the absence of a set sound into the target storage area. This achieves a low-power storage strategy during the absence of a set sound, reduces the storage space occupied in the target storage area, lowers the memory erase / write frequency, and extends the hardware lifespan.

[0034] The following combination Figure 1 The illustrated electronic device demonstrates the audio storage method provided in this disclosure.

[0035] <First Embodiment> Figure 2 This is a flowchart illustrating an audio storage method according to some embodiments. The audio storage method comprises... Figure 1 The illustrated electronic device 1000 is implemented. For example... Figure 2 As shown, the audio storage method of this embodiment may include the following steps S210 to S240.

[0036] Step S210: The collected audio data is written to the buffer frame by frame. When the number of frames of audio data in the buffer reaches a set threshold, the newly received audio data overwrites the earliest written frame of audio data.

[0037] Audio data from Figure 1 The microphone in the electronic device shown is used for sound capture.

[0038] A single frame of audio data can be a set duration, which can be set according to requirements, such as any duration between 10ms and 30ms.

[0039] Set the threshold to the maximum number of frames of audio data that the buffer can store. For example, the duration of the audio data with the maximum number of frames can be any duration between 60ms and 150ms.

[0040] The cache area can be a circular cache area, or it can be other types of cache areas, such as a cache pool.

[0041] When the number of audio data frames in the buffer reaches a set threshold, newly received audio data overwrites the oldest written frame, thus achieving rolling storage of historical audio data. In this way, electronic devices can continuously maintain and store audio data up to the set threshold number of frames in a low-power state, without having to write all the acquired audio data to the target storage area, thereby reducing system power consumption.

[0042] Step S220: Detect the collected audio data frame by frame in the order of collection to obtain the set sound detection result for each frame.

[0043] The sound settings can be pre-defined to indicate the type of sound to be detected, such as human voices, sounds of specific animals, or sounds emitted by specific machines.

[0044] The detection of a set sound can be based on the energy characteristics, spectral characteristics, or speech characteristics of the audio data to obtain the set sound detection result for each frame. The set sound detection result is either that the set sound is present or that it is not present.

[0045] Step S230: If it is determined that there is no set sound in the corresponding audio data based on the set sound detection result of each frame, record the timestamp of the starting frame where there is no set sound in the corresponding audio data and the duration of the audio without set sound.

[0046] Step S240: Generate a silent data packet including the timestamp of the start frame where no set sound exists and the duration of the audio when no set sound exists.

[0047] A silence data packet is a lightweight metadata packet that does not contain a complete PCM (Pulse Code Modulation) audio stream. It only records metadata information such as the timestamp of the start frame and the duration of audio data without a set sound. Compared to storing a complete PCM audio stream, the silence data packet has a very small data size, which can significantly reduce the storage space occupied by audio data without a set sound.

[0048] Step S250: Write the mute data packet to the target storage area.

[0049] The cache area and the target storage area are two independent storage areas.

[0050] As can be seen from the above steps S210 to S250, in the stage where there is no set sound, the complete PCM audio stream is not written, but only the silence data packet is written, thereby realizing the low-power storage strategy in the stage where there is no set sound, reducing the storage space occupied by the target storage area, reducing the memory erase and write frequency, and extending the hardware life.

[0051] <Second Embodiment> In related technologies, Voice Activity Detection (VAD) solutions typically begin recording only after a set sound is detected. There is a delay of tens to hundreds of milliseconds between when an electronic device wakes up from a low-power state and when it begins writing audio data, which can easily lead to the loss of the beginning part of the set sound.

[0052] To address this technical problem, in some embodiments of this disclosure, the audio storage method further includes a step of retrospectively writing audio data containing a set sound, specifically steps S260 to S270.

[0053] Step S260: If it is determined that the corresponding audio data contains a set sound based on the set sound detection result of each frame, retrieve consecutive frames of historical audio data from the buffer. The consecutive frames include the frame corresponding to which the set sound is confirmed to exist and the consecutive frames before it.

[0054] It not only retrieves the frame corresponding to the currently confirmed setting sound, but also retrieves the historical audio frames before the frame corresponding to the setting sound. This allows it to obtain the complete beginning part of the setting sound and avoids the problem of swallowing words.

[0055] Step S270: Generate a setting sound data packet based on continuous historical audio data of multiple frames and audio data of the setting sound collected after the setting sound is confirmed to exist, and write the setting sound data packet to the target storage area.

[0056] The setting sound data packet contains the complete PCM audio stream of the setting sound, avoiding the problem of the sound beginning being lost.

[0057] By adopting the above-mentioned retrospective writing mechanism, the complete beginning part of the sound can be preserved without significantly increasing the system power consumption, significantly reducing the probability of swallowing words and improving the integrity of the recording.

[0058] If a frame detects the presence of a set sound, the number of consecutive frames containing that set sound is recorded. If the number of consecutive frames containing the set sound exceeds the set number of frames, the corresponding audio data is confirmed to contain the set sound. This effectively filters out occasional noise interference, avoids misidentifying brief noise resembling the set sound as the set sound, thereby improving detection accuracy and reducing the probability of false recording.

[0059] Combination Figure 3 As shown, the buffer contains n frames of audio data, which are F t-n ... F t-5 F t-4 F t-3 F t-2 F t-1 Based on each frame of audio data, a corresponding sound detection result is obtained. After determining F... t-k ... F t-5 F t-4 F t-3 F t-2 F t-1 When a set sound is present in k consecutive frames of audio data, retrieve historical audio data F from the buffer. t-k ... F t-5 F t-4 F t-3 F t-2 F t-1 And this historical audio data is compared with the audio data F of the set sound collected after the existence of the set sound is confirmed. t F t+1 F t+2 F t+3 F t+4 ... F t+m Generate the specified sound data packet and write the specified sound data packet to the target storage area.

[0060] After confirming the presence of the designated sound, audio data from the frame corresponding to the confirmed sound onwards can be synchronously written to the buffer. This ensures the buffer always maintains the latest historical audio data, providing data support for potential subsequent detection and tracing.

[0061] If a frame's set sound detection result indicates that the set sound is not present, writing the set sound data packet to the target storage area stops; that is, writing audio data from the frame corresponding to the confirmed absence of the set sound to the target storage area stops. In this way, after the set sound is completed, writing audio data containing the absent set sound to the target storage area is promptly stopped, and instead, a silence data packet is written, thereby further reducing the number of write operations to the memory and power consumption.

[0062] <Third Embodiment> In some embodiments of this disclosure, the audio storage method can also perform subsequent processing on the set sound data packets and silence data packets written to the target storage area, specifically including step S280, generating an audio data stream that remains continuous on the time axis based on the set sound data packets and silence data packets.

[0063] During playback, transcription, or AI analysis, audio and silence data packets can be arranged in timestamp order. Based on the start frame timestamp and duration of the silence data packet, silence audio data is inserted into the corresponding time period, thereby restoring a complete continuous timeline. In this way, more complete data input can be provided for AI transcription, agent context analysis, and continuous memory, enabling continuous context recovery.

[0064] Combination Figure 4 As shown, the target storage area stores 5 data packets: 3 are setting sound data packets and 2 are silence data packets. Each setting sound data packet includes a timestamp of the start frame and a timestamp of the end frame where the setting sound is present. Each silence data packet includes a timestamp of the start frame where the setting sound is absent and the duration of the audio when the setting sound is absent. The audio data of these 5 data packets is restored in chronological order to obtain a continuous audio stream.

[0065] The audio storage method may further include a step of recording energy characteristic values ​​when a set sound is absent. Specifically, if it is determined, based on the set sound detection results of each frame, that the corresponding audio data does not contain a set sound, the energy characteristic value of the audio data without a set sound can be recorded and included in the silence data packet. The energy characteristic value can reflect the ambient noise level of the silent segment. During the time-axis recovery phase, ambient noise audio data with a corresponding energy level can be generated based on this energy characteristic value, making the recovered audio data stream more natural and continuous in subjective listening perception, thus improving the user experience.

[0066] <Fourth Embodiment> One embodiment of this disclosure provides an audio storage device. According to... Figure 5As shown, the audio storage device includes a buffer writing module 510, a detection module 520, a recording module 530, a data packet generation module 540, and a target storage area writing module 550.

[0067] The buffer writing module 510 is used to write the acquired audio data into the buffer frame by frame. When the number of frames of audio data in the buffer reaches a set threshold, the newly received audio data overwrites the earliest written frame of audio data.

[0068] The detection module 520 is used to detect the acquired audio data frame by frame in the order of acquisition to obtain the set sound detection result for each frame.

[0069] The recording module 530 is used to record the timestamp of the starting frame in the corresponding audio data where no set sound exists, and the duration of the audio data where no set sound exists, when the set sound detection result of each frame determines that no set sound exists in the corresponding audio data.

[0070] The data packet generation module 540 is used to generate a silent data packet that includes a timestamp of the start frame where no set sound is present and the duration of the audio signal where no set sound is present.

[0071] The target storage area write module 550 is used to write the silence data packet to the target storage area.

[0072] In some embodiments, the apparatus further includes a setting sound data packet generation module. The setting sound data packet generation module is used to, when determining that a setting sound exists in the corresponding audio data based on the setting sound detection result of each frame, obtain consecutive frames of historical audio data from a buffer, wherein the consecutive frames include the frame corresponding to the confirmed presence of the setting sound and the consecutive frames preceding it; generate a setting sound data packet based on the consecutive frames of historical audio data and the audio data of the setting sound collected since the confirmation of the setting sound's existence, and write the setting sound data packet to a target storage area.

[0073] In some embodiments, the buffer writing module is further configured to synchronously write audio data after the frame corresponding to the set sound is confirmed to exist into the buffer.

[0074] In some embodiments, the target storage area writing module is further configured to stop writing the setting sound data packet to the target storage area after writing the setting sound data packet to the target storage area, if the setting sound detection result of a frame indicates that the setting sound does not exist.

[0075] In some embodiments, the apparatus further includes an audio stream generation module. The audio stream generation module is used to generate an audio data stream that remains continuous on the timeline based on set sound data packets and silence data packets.

[0076] In some embodiments, the apparatus further includes an energy feature value determination module. The energy feature value determination module is used to record the energy feature value of the audio data for which no set sound exists, when it is determined, based on the set sound detection results of each frame, that the corresponding audio data does not contain a set sound.

[0077] When the energy characteristic value determination module detects the presence of a set sound in a frame, it records the number of consecutive frames of audio data in which the set sound is present. In some embodiments, the set sound data packet generation module is used to determine that the set sound exists in the corresponding audio data when the number of consecutive frames of audio data containing the set sound is greater than the set number of frames.

[0078] <Fifth Embodiment> This embodiment provides an electronic device. Figure 6 A schematic diagram of the hardware structure of the electronic device is shown.

[0079] like Figure 6 As shown, the electronic device 600 includes a processor 610 and a memory 620. The memory 620 can be used to store computer programs, and the processor 610 can be used to retrieve the computer programs from the memory 620 to execute any method embodiment of this disclosure. The processor 610 can be one or more, and these processors can execute instructions individually or jointly. Similarly, the memory 620 can be one or more, and these memories can store the aforementioned computer programs individually or jointly.

[0080] The processor 610 is used to execute computer instructions, which can be written using instruction sets of architectures such as x86, Arm, RISC, MIPS, and SSE. The memory 620 includes, for example, ROM (Read-Only Memory), RAM (Random Access Memory), and non-volatile memory such as a hard disk, etc., without limitation.

[0081] Combination Figure 7 As shown, the electronic device 600 also includes a microphone 630 for real-time audio data acquisition. The electronic device 600 also includes a buffer device 640. The buffer device 640 includes a buffer area 6401 for storing the real-time acquired audio data. The memory 620 also includes a target storage area 6201.

[0082] The processor 610 is used to detect the presence of a set sound in the acquired audio data frame by frame, and obtain the set sound detection result for each frame.

[0083] If, based on the detection results of the set sound in each frame, it is determined that the corresponding audio data does not contain a set sound, a silence data packet including the timestamp of the starting frame where the set sound does not exist and the duration of the audio without the set sound is written to the target storage area 6201. If, based on the detection results of the set sound in each frame, it is determined that the corresponding audio data contains a set sound, a set sound data packet including historical audio data from multiple consecutive frames and audio data of the set sound collected after the confirmation of the existence of the set sound is written to the target storage area 6201.

[0084] This disclosure also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the audio storage method in any embodiment of this disclosure. Optionally, the computer-readable storage medium may be a non-transitory storage medium, but is not limited thereto; it may also be a temporary storage medium.

[0085] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0086] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0087] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0088] The computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from computer-readable program instructions. These electronic circuits can execute computer-readable program instructions to implement various aspects of this disclosure.

[0089] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0090] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0091] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0092] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be known to those skilled in the art that implementation in hardware, implementation in software, and implementation in a combination of software and hardware are equivalent.

[0093] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this disclosure is defined by the appended claims.

Claims

1. An audio storage method, characterized in that, include: The collected audio data is written to the buffer frame by frame. When the number of frames of audio data in the buffer reaches a set threshold, the newly received audio data overwrites the earliest written frame of audio data. The collected audio data is detected frame by frame in the order of collection to obtain the set sound detection result for each frame; If, based on the detection results of the set sound in each frame, it is determined that the corresponding audio data does not contain a set sound, the timestamp of the starting frame in which the set sound does not exist in the corresponding audio data and the duration of the audio without the set sound are recorded. Generate a silent data packet that includes the timestamp of the start frame where no set sound exists and the duration of the audio signal where no set sound exists; Write the mute data packet to the target storage area.

2. The method according to claim 1, characterized in that, The method further includes: If it is determined that a set sound exists in the corresponding audio data based on the set sound detection result of each frame, then obtain consecutive frames of historical audio data from the buffer, wherein the consecutive frames include the frame corresponding to which the set sound is confirmed to exist and the consecutive frames before it. Based on the continuous multi-frame historical audio data and the audio data of the set sound collected after the existence of the set sound is confirmed, a set sound data packet is generated and written into the target storage area.

3. The method according to claim 2, characterized in that, The method further includes: synchronously writing audio data after the frame corresponding to the set sound is confirmed to exist into the buffer.

4. The method according to claim 2, characterized in that, After writing the specified sound data packet to the target storage area, the method further includes: If a frame's set sound detection result indicates that the set sound does not exist, the writing of the set sound data packet to the target storage area will be stopped.

5. The method according to claim 2, characterized in that, The method further includes: Based on the set sound data packet and the silence data packet, an audio data stream that remains continuous on the time axis is generated.

6. The method according to claim 1, characterized in that, The method further includes: If, based on the detection results of the set sound in each frame, it is determined that the corresponding audio data does not contain the set sound, the energy characteristic value of the audio data for which the set sound does not exist is recorded.

7. The method according to claim 2, characterized in that, The determination that a specific sound exists in the corresponding audio data based on the detection result of the specific sound in each frame includes: If the detection result of the set sound is that the set sound is present in a frame, record the number of consecutive frames of audio data in which the set sound is present; If the number of consecutive frames of audio data containing a set sound is greater than the set number of frames, it is determined that the corresponding audio data contains a set sound.

8. An audio storage device, characterized in that, include: The buffer writing module is used to write the collected audio data frame by frame into the buffer. When the number of frames of audio data in the buffer reaches a set threshold, the newly received audio data overwrites the earliest written frame of audio data. The detection module is used to detect the collected audio data frame by frame in the order of collection to obtain the set sound detection result for each frame. The recording module is used to record the timestamp of the starting frame in the corresponding audio data where no set sound is present, and the duration of the audio data where no set sound is present, when it is determined based on the set sound detection result of each frame. The data packet generation module is used to generate a silent data packet that includes the timestamp of the start frame where the set sound does not exist and the duration of the audio when the set sound does not exist. The target storage area writing module is used to write the silence data packet to the target storage area.

9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program for controlling the processor to operate in order to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method according to any one of claims 1 to 7.