Decryption method and apparatus, and computer-readable storage medium

The decoding method addresses the challenge of real-time audio stream decoding in AI customer service by buffering and parsing stream segments for header information, enabling efficient decoding of audio streams with incomplete frames and separating audio from non-audio streams.

JP7849376B2Active Publication Date: 2026-04-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
Filing Date
2022-01-04
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies face challenges in achieving real-time decoding of audio streams in AI customer service scenarios due to the absence of header information in most stream segments, leading to decoding failures when using tools like FFmpeg.

Method used

A decoding method that involves buffering stream segments, parsing for header information, storing it, and decoding the audio stream segments based on the obtained header information, including techniques to handle incomplete frames and separate audio from non-audio streams, with methods like Open avformat and Separate stream in FFmpeg.

Benefits of technology

Enables real-time decoding of audio streams by ensuring complete header information is obtained and correctly decoding audio frames, even in scenarios with incomplete frames, thus meeting the requirements of AI customer service applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007849376000001
    Figure 0007849376000001
  • Figure 0007849376000002
    Figure 0007849376000002
  • Figure 0007849376000003
    Figure 0007849376000003
Patent Text Reader

Abstract

The present disclosure relates to a decoding method, an apparatus, and a computer-readable storage medium in the field of computer technology. The method of the present disclosure includes: buffering one or more stream segments of a received data stream, where the data stream includes an audio stream; parsing the buffered one or more stream segments until header information is obtained through parsing; storing the header information; and decoding the stream segments of the audio stream among the various received stream segments according to the header information until the audio stream is completely decoded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Cross - reference to related applications This disclosure claims priority based on Chinese Patent Application No. 202110229441.9, filed on March 2, 2021, the entire disclosure of which is incorporated herein by reference.

[0002] This disclosure relates to the technical field of computers, and more particularly, to a decoding method, apparatus, and computer - readable storage medium.

Background Art

[0003] With the rapid development of artificial intelligence (AI), AI customer service robots have obtained an increasingly wide range of application fields. AI customer service robots rely on speech recognition technology that takes the input of real - time audio streams as a prerequisite. Generally, in the field of AI customer service, it is necessary to identify the words spoken by the user with the robot and send the words into the system as an audio stream in real - time. Therefore, the real - time decoding of audio streams has become a problem to be solved.

[0004] The real - time decoding of audio streams requires obtaining the format and parameters of the audio stream, which are usually included in the header information of the audio stream.

Summary of the Invention

Means for Solving the Problems

[0005] According to some embodiments of the present disclosure, a decoding method is provided which includes the steps of: buffering one or more stream segments of a received data stream, wherein the data stream includes an audio stream; parsing the buffered one or more stream segments until header information is obtained through parsing; storing the header information; and decoding the stream segments of the audio stream among the various stream segments received according to the header information until the audio stream is fully decoded.

[0006] In some embodiments, the step of parsing one or more buffered stream segments until header information is obtained through parsing includes: determining whether the total data length of all currently buffered stream segments has reached a preset frame length; if the total data length of all currently buffered stream segments has reached a preset frame length, parsing the data of the preset frame length from the starting position in the currently buffered stream segment; determining whether the header information has been successfully parsed; if the header information has not been successfully parsed, updating the preset frame length by increasing the preset frame length by a preset value; and repeating the above steps until the header information has been parsed.

[0007] In some embodiments, the step of parsing one or more buffered stream segments until header information is obtained through parsing further includes, if the total data length of all currently buffered stream segments does not reach the preset frame length, receiving and buffering the next stream segment and then re-determining whether the total data length of all currently buffered stream segments has reached the preset frame length.

[0008] In some embodiments, the step of decoding a stream segment of an audio stream among various stream segments received according to header information includes the step of determining the length of an audio frame according to the header information, and the step of decoding a stream segment of an audio stream among various stream segments received by distinguishing different audio frames according to the length of the audio frame.

[0009] In some embodiments, the steps of decoding a stream segment of an audio stream among various received stream segments by distinguishing different audio frames according to the length of the audio frames include: dividing the current stream segment of the audio stream according to a sequence defined by the data encapsulation format and according to the length of the audio frames to obtain one or more complete audio frames; decoding one or more complete audio frames; determining whether the data at the end of the current stream segment of the audio stream belongs to an incomplete audio frame; and if the data at the end of the current stream segment of the audio stream belongs to an incomplete audio frame, buffering the incomplete audio frame. Current stream segment The process includes receiving the next stream segment, splicing the next stream segment with an incomplete audio frame to obtain a spliced ​​stream segment, taking the spliced ​​stream segment as the current stream segment of the audio stream, and repeating the above steps until the last stream segment of the audio stream is fully decoded.

[0010] In some embodiments, the step of decoding a stream segment of an audio stream among various stream segments received according to header information until the audio stream is fully decoded includes, if a failure occurs in decoding the current stream segment of the audio stream based on header information, parsing the current stream segment or parsing the current stream segment and the stream segments following the current stream segment until new header information is obtained through parsing, and decoding the stream segments following the current stream segment according to the new header information until the audio stream is fully decoded.

[0011] In some embodiments, the step of parsing one or more buffered stream segments until header information is obtained through parsing includes the step of parsing one or more buffered stream segments by calling the Open avformat method in FFmpeg until header information is obtained through parsing.

[0012] In some embodiments, the step of decoding the stream segment of an audio stream from among various stream segments received according to header information includes the steps of determining, according to the header information, whether the data stream contains data streams other than the audio stream; if the data stream contains data streams other than the audio stream, separating the data streams other than the audio stream from the audio stream; determining the format information of the audio stream according to the header information; transcoding the stream segment of the audio stream to the original audio stream according to the format information of the audio stream; and resampling the original audio stream at a preset bitrate.

[0013] In some embodiments, data streams other than the audio stream are separated from the audio stream by calling the Separate stream method in FFmpeg, the format information of the audio stream is determined according to the header information, the stream segments of the audio stream are transcoded back to the original audio stream according to the format information of the audio stream, and the original audio stream is resampled at a preset bitrate by calling the Parse format method in FFmpeg.

[0014] According to another embodiment of the present disclosure, a decoding device is provided comprising: a buffering module configured to buffer one or more stream segments of an received data stream, wherein the data stream includes an audio stream; a header information parsing module configured to parse the buffered one or more stream segments until header information is obtained through parsing; a header information storage module configured to store the header information; and a decoding module configured to decode the stream segments of the audio stream among the various stream segments received according to the header information until the audio stream is fully decoded.

[0015] A decoding device is provided comprising a processor and a memory coupled to the processor for storing instructions that, when executed by the processor, cause the processor to execute one of the decoding methods described in the preceding embodiments.

[0016] A further embodiment of the present disclosure provides a non-temporary computer-readable storage medium in which a computer program is stored, wherein the program implements one of the decryption methods described above when executed by a processor.

[0017] Other features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings.

[0018] The accompanying drawings, included to provide a further understanding of this disclosure, incorporated herein, and constituting part of this specification, illustrate embodiments of the invention and, together with the exemplary embodiments of this application, serve to illustrate this disclosure, although they do not limit it. [Brief explanation of the drawing]

[0019] [Figure 1] This is a flowchart of a decoding method according to some embodiments of the present disclosure. [Figure 2] This is a structural diagram of an audio stream according to some embodiments of the present disclosure. [Figure 3] This is a flowchart of a decoding method according to another embodiment of the present disclosure. [Figure 4] This is a structural diagram of a decoding device according to some embodiments of the present disclosure. [Figure 5] This is a structural diagram of a decoding device according to another embodiment of the present disclosure. [Figure 6] This is a structural diagram of a decoding device according to yet another embodiment of the present disclosure. [Modes for carrying out the invention]

[0020] A clear and complete description of the technical solutions of the embodiments of this disclosure is given below, with reference to the figures of the embodiments. Clearly, only some embodiments of this disclosure are given herein, not all embodiments of this disclosure. Indeed, the following description of at least one exemplary embodiment is illustrative and in no way limited to the invention, its applications, or use. All other embodiments that can be obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are included within the scope of protection of this disclosure.

[0021] In the actual scenario of AI customer service, the inventors have discovered that it is necessary to stream audio, that is, the audio file is split into stream segments for transmission. In this case, the first stream segment or the first few stream segments contain the header information generated during audio coding. Subsequent stream segments do not contain any header information. Especially when the FFmpeg tool is used to decode various stream segments, most of the stream segments do not contain header information and cannot be decoded, so error information can be returned, which means that the real-time decoding requirement of the stream segments cannot be met in the actual scenario of AI customer service.

[0022] The technical problem to be solved by the present disclosure is how to achieve real-time decoding of an audio stream.

[0023] The present disclosure provides a decoding method that can be used for real-time decoding of an audio stream in an AI customer service scenario, which will be described below with reference to FIGS. 1 to 3.

[0024] FIG. 1 is a flowchart of a decoding method according to some embodiments of the present disclosure. As shown in FIG. 1, the method of such embodiments includes steps S102 to S108.

[0025] In step S102, one or more stream segments of the received data stream are buffered.

[0026] The data stream includes an audio stream and may further include data streams other than audio streams, such as non-audio data streams like video streams. When an audio stream is mixed with data streams other than audio streams, it is necessary to separate the different streams in the subsequent steps described in the embodiments below. During transmission, the data stream may be divided into multiple stream segments, each of which may be packaged into a data package for transmission. After receiving the data packet, a decoding device (a device performing the decoding method of this disclosure) parses the data packet, obtains each of the stream segments, and buffers them.

[0027] The method disclosed herein can be implemented based on the FFmpeg API. First, two modules (Init avformat / Init avio context) can be initialized to parse header information and read the audio stream, respectively. A buffer stream method can be called to buffer one or more streaming segments.

[0028] In step S104, one or more buffered stream segments are parsed until header information is obtained through parsing.

[0029] Header information includes, for example, audio stream format information and at least one parameter. For example, the at least one parameter includes, but is not limited to, at least one of the following: sampling rate, bit depth, number of channels, and compression ratio. Due to the indeterminate division of stream segments, one stream segment may contain only complete or partial header information, and multiple stream segments may be required to obtain complete header information. In some embodiments, once a stream segment is buffered, an attempt is made to parse all buffered stream segments to determine whether the header information can be successfully parsed. If the header information cannot be successfully parsed, the next stream segment is continuously buffered, and the above process is repeated until the header information can be successfully parsed.

[0030] In some embodiments, it is determined whether the total data length of all currently buffered stream segments has reached the preset frame length. If the total data length of all currently buffered stream segments has reached the preset frame length, the data of the preset frame length from the starting position in the currently buffered stream segment is parsed. It is then determined whether the header information has been successfully parsed. If the header information has not been successfully parsed, the preset frame length is updated by increasing it by the preset value, and this process is repeated until the header information has been successfully parsed.

[0031] The preset frame length can be obtained through statistics on the length of the header information of the historical audio stream. When a stream segment is buffered, it is determined whether the total data length of all currently buffered stream segments has reached the preset frame length. If the total data length of all currently buffered stream segments has not reached the preset frame length, the next stream segment is received and buffered, and then it is re-determined whether the total data length of all currently buffered stream segments has reached the preset frame length. The preset frame length data from the starting position within the currently buffered stream segment is parsed until the total data length of all currently buffered stream segments reaches the preset frame length.

[0032] For example, if the preset frame length is 200 bytes, the data with a length of 200 bytes from the first byte of the first buffered stream segment is used as the data to be parsed. The data to be parsed is parsed, and it is determined whether the header information can be successfully parsed. If the header information can be successfully parsed, the header information parsing process is stopped. If the header information parsing fails, the preset frame length is increased by the preset value, and the preset frame length is updated. For example, the preset frame length may be increased from 200 bytes to 300 bytes. The process is then restarted from the step of determining whether the total data length of all currently buffered stream segments has reached the preset frame length.

[0033] One or more buffered stream segments can be parsed in FFmpeg by calling the Open avformat method until header information is obtained through parsing. By continuously attempting to parse the head information of the buffered stream segments, the above method can avoid the problem of failing to successfully parse the header information when the header information is split across different stream segments. By determining and updating the preset frame length, the number of parses can be reduced and efficiency can be improved.

[0034] In step S106, header information is stored.

[0035] In step S108, the stream segments of the audio stream among the various received stream segments are decoded according to the header information until the audio stream is completely decoded.

[0036] If a data stream contains only audio streams, the header information is used to directly decode each received stream segment. If a data stream contains both audio streams and non-audio data streams, it is necessary to perform an action to separate the streams. In some embodiments, the header information is used to determine whether a data stream contains non-audio data streams, and if so, the non-audio data streams are separated from the audio streams. For example, non-audio data streams are separated from audio streams by calling the Separate stream method in FFmpeg.

[0037] After separating the audio stream segment from the various received stream segments, the audio stream segment is decoded using header information. In some embodiments, the format information of the audio stream is determined by the header information, the audio stream segment is transcoded to the original audio stream according to the audio stream format information, and the original audio stream is resampled at a preset bitrate. The resampled bitrate is suitable for the bitrate of the playback device and facilitates playback of the audio stream. For example, the format information of the audio stream is determined according to the header information, the audio stream segment is transcoded to the original audio stream according to the audio stream format information, and the original audio stream is resampled at a preset bitrate by calling the Parse format method in FFmpeg.

[0038] If an audio stream contains only complete audio files, correct decoding of the entire audio stream can be achieved using stored header information. If an audio stream contains multiple complete audio files, different audio files may have different header information, resulting in failures during the decoding process. In view of the above problem, in some embodiments, if a failure occurs in decoding the current stream segment of the audio stream based on header information, the current stream segment is parsed until new header information is obtained through parsing, or the current stream segment and the stream segment following the current stream segment are parsed, and the stream segment following the current stream segment is decoded according to the new header information until the audio stream is fully decoded.

[0039] Regarding the method for parsing and obtaining new header information, a reference may be made to the method for parsing header information in the embodiments described above. New header information may be stored, and previously stored header information may be deleted. Subsequently received stream segments are decoded using the new header information until the audio stream is fully decoded.

[0040] In the method of the above embodiment, one or more stream segments of the data stream are first buffered, and then the buffered stream segments are parsed until header information is obtained. The header information is stored and used to decode the stream segments of the audio stream among various stream segments received thereafter until the audio stream is fully decoded. The method of the above embodiment can achieve real-time decoding of the audio stream and can satisfy the need for real-time decoding of real-time audio streams in AI customer service scenarios.

[0041] Specifically, in a scenario where the FFmpeg tool is used to achieve audio decoding, the method in the above embodiment can buffer stream segments in an audio stream buffer, extract and store header information (including audio stream format information and at least one parameter) through parsing, parse the audio stream format information and at least one parameter based on the header information, obtain the decoder type through the audio stream format information, and then the stream segments of the received audio stream can be decoded by a decoder engine linked by the buffered decoder type according to at least one parameter of the audio stream. In this case, audio streams generated using a standard audio encoder can be decoded in real time, thus solving the problem that most stream segments cannot be decoded using the FFmpeg tool because they do not contain header information.

[0042] A problem of incomplete audio frames can exist if, during transmission of an audio stream, the transmitted stream segments are not segmented according to lengths that are integer multiples of the length of the audio frames. As shown in Figure 2, stream segment 1 of the audio stream includes audio frames 1, 2, and a portion of audio frame 3, and stream segment 2 includes another portion of audio frame 3. In this case, an error will be reported when the decoder is used to decode stream segments 1 and 2 based on header information. This disclosure further provides solutions to the above problem. In some embodiments, the length of the audio frames is determined according to header information, and the stream segments of the audio stream among the various received stream segments are decoded by distinguishing different audio frames according to the length of the audio frames. The length of the audio frames may be determined according to parameters contained in the header information. For example, the length of the audio frames may be determined according to parameters such as sampling rate, bit depth, and number of channels. References to the prior art can be made for details, and those details are not repeated herein.

[0043] Furthermore, as shown in Figure 3, decoding the stream segment of the audio stream among the various stream segments received according to the header information includes steps S302 to S316.

[0044] In step S302, the length of the audio frame is determined based on the header information.

[0045] In step S304, if the stream segment in which the header information is placed also contains audio data, the stream segment is taken as the current stream segment of the audio stream.

[0046] In step S306, the current stream segment is divided into audio frames according to the length of the audio frames and the sequence defined by the data encapsulation format. That is, the current stream segment of the audio stream is divided according to the sequence defined by the data encapsulation format and according to the length of the audio frames, and one or more complete audio frames are obtained.

[0047] For example, data is arranged within a stream segment in a sequence from left to right or from front to back. As shown in Figure 2, after stream segment 1 is divided into audio frames, the data at the end of stream segment 1 belongs to the incomplete audio frame 3.

[0048] In step S308, one or more complete audio frames are decoded.

[0049] In step S310, it is determined whether the current stream segment is the last stream segment. If so, the process is stopped; otherwise, step S312 is executed.

[0050] In step S312, it is determined whether the data at the end of the current stream segment of the audio stream belongs to an incomplete audio frame. If so, step S314 is performed; otherwise, step S313 is performed.

[0051] Step S313 is for the audio stream Current stream segment After receiving the next stream segment, the next stream segment is taken as the current stream segment, and the process returns to step S306 and restarts from step S306.

[0052] In step S314, incomplete audio frames are buffered.

[0053] In step S316, the audio stream Next stream segment of the current stream segment After receiving the signal, the next stream segment is spliced ​​with the incomplete audio frame, the spliced ​​stream segment is obtained, the spliced ​​stream segment is taken as the current audio frame, and the process returns to step S306 and restarts from step S306.

[0054] As shown in Figure 2, stream segment 2 is spliced ​​with the first half of audio frame 3 contained within stream segment 1 to form a complete frame.

[0055] In the method of the above embodiment, incomplete frames are buffered, and a splicing process is performed when the next stream segment is received, thereby resolving the problem of incorrect decoding when the stream segment contains incomplete audio frames.

[0056] This disclosure further provides a decoding device as described below with reference to Figure 4.

[0057] Figure 4 is a structural diagram of a decoding device according to some embodiments of the present disclosure. As shown in Figure 4, the device 40 of this embodiment comprises a buffering module 410, a header information parsing module 420, a header information storage module 430, and a decoding module 440.

[0058] The buffering module 410 is configured to buffer one or more stream segments of the received data stream, the data stream including an audio stream.

[0059] The header information parsing module 420 is configured to parse one or more buffered stream segments until header information is obtained through parsing.

[0060] In some embodiments, the header information parsing module 420 is configured to determine whether the total data length of all currently buffered stream segments has reached a preset frame length, and if so, to parsing the data of the preset frame length from the starting position in the currently buffered stream segment, to determine whether the header information has been successfully parsed, and if the header information has not been successfully parsed, to update the preset frame length by increasing it by a preset value, and to repeat the above until the header information has been successfully parsed.

[0061] In some embodiments, the header information parsing module 420 is configured to receive and buffer the next stream segment and then re-determine whether the total data length of all currently buffered stream segments has reached the preset frame length if the total data length of all currently buffered stream segments has not reached the preset frame length.

[0062] In some embodiments, the header information parsing module 420 is configured to parse one or more buffered stream segments by calling the Open avformat method in FFmpeg until header information is obtained through parsing.

[0063] The header information storage module 430 is configured to store header information.

[0064] The decoding module 440 is configured to decode the stream segments of the audio stream among the various stream segments received according to the header information until the audio stream is completely decoded.

[0065] In some embodiments, the decoding module 440 is configured to decode the stream segments of the audio stream among the various received stream segments by determining the length of the audio frame according to the header information and distinguishing different audio frames according to the length of the audio frame.

[0066] In some embodiments, the decoding module 440 divides the current stream segment of the audio stream according to a sequence defined by the data encapsulation format and according to the audio frame length, obtains one or more complete audio frames, decodes one or more complete audio frames, determines whether the data at the end of the current stream segment of the audio stream belongs to an incomplete audio frame, and if the data at the end of the current stream segment of the audio stream belongs to an incomplete audio frame, buffers the incomplete audio frame and the audio frame Current stream segment After receiving the next stream segment, the system is configured to splice the next stream segment with an incomplete audio frame, obtain the spliced ​​stream segment, take the spliced ​​stream segment as the current stream segment of the audio stream, and repeat the above until the last stream segment of the audio stream is fully decoded.

[0067] In some embodiments, the decoding module 440 is configured to, if a failure occurs in decoding the current stream segment of the audio stream based on header information, parse the current stream segment or parse the current stream segment and the stream segments following the current stream segment until new header information is obtained through parsing, and decode the stream segments following the current stream segment according to the new header information until the audio stream is fully decoded.

[0068] In some embodiments, the decoding module 440 is configured to determine, according to the header information, whether the data stream contains data streams other than the audio stream, and if the data stream contains data streams other than the audio stream, to separate the data streams other than the audio stream from the audio stream, to determine the format information of the audio stream according to the header information, to transcode the stream segments of the audio stream to the original audio stream according to the format information of the audio stream, and to resample the original audio stream at a preset bitrate.

[0069] In some embodiments, the decoding module 440 is configured to separate data streams other than the audio stream from the audio stream by calling the Separate stream method in FFmpeg, determine the format information of the audio stream based on the header information, transcode the stream segments of the audio stream back to the original audio stream according to the format information of the audio stream, and resample the original audio stream at a preset bitrate by calling the Parse format method in FFmpeg.

[0070] The decoding device of this embodiment of the present disclosure may be implemented by various computing devices or computer systems as described below with reference to Figures 5 and 6.

[0071] Figure 5 is a structural diagram of a decoding device according to some embodiments of the present disclosure. As shown in Figure 5, the device 50 of this embodiment comprises a memory 510 and a processor 520 coupled to the memory 510, the processor 520 being configured to perform a decoding method according to any one of the embodiments of the present disclosure based on instructions stored in the memory 510.

[0072] Memory 510 may include, for example, system memory, fixed non-volatile storage media, etc. System memory stores, for example, the operating system, applications, boot loader, databases, and other programs.

[0073] Figure 6 is a structural diagram of a decoding device according to another embodiment of the present disclosure. As shown in Figure 6, the device 60 of this embodiment comprises memory 610 and processor 620 similar to memory 510 and processor 520, respectively. The device 60 may further include an input / output interface 630, a network interface 640, a storage interface 650, and the like. These interfaces 630, 640, 650, memory 610, and processor 620 may be connected, for example, via a bus 660. The input / output interface 630 provides a connection interface for input / output devices such as a display, mouse, keyboard, and touchscreen. The network interface 640 provides a connection interface for various networking devices; for example, the network interface 640 may be connected to a database server or a cloud storage server. The storage interface 650 provides a connection interface for external storage devices such as SD cards and USB flash disks.

[0074] Those skilled in the art will understand that embodiments of the Disclosure may be provided as methods, systems, or computer program products. Accordingly, embodiments of the Disclosure may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments that include both hardware and software elements. Furthermore, the Disclosure may take the form of a computer program product implemented on one or more computer-usable non-temporary storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) in which computer-usable program code is implemented.

[0075] This disclosure will be described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and any combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. Computer program instructions are given to a general-purpose computer, a dedicated computer processor, an embedded processor, or other programmable data processing device such that instructions executed by the processor of a computer or other programmable data processing device generate means for implementing functions specified in one or more flows of a flowchart and / or one or more blocks of a block diagram, thereby generating a machine.

[0076] Computer program instructions can also be stored in computer-readable memory that can instruct a computer or other programmable data processing device to operate in a particular manner so that the instructions stored in the computer-readable memory produce a product having instruction means that implements a function specified in one or more flows of a flowchart and / or one or more blocks of a block diagram.

[0077] These computer program instructions may also be loaded onto a computer or other programmable device so that the instructions executed on the computer or other programmable device provide steps to implement functions specified in one or more flows of a flowchart and / or one or more blocks of a block diagram, and a series of operational steps may be performed on the computer or other programmable device to generate a computer implementation process.

[0078] The foregoing describes preferred embodiments of this disclosure and is not an limitation thereto. Any modifications, substitutions, improvements, etc., within the scope of the intent and principles of this disclosure shall be protected. [Explanation of Symbols]

[0079] 40 equipment 410 Buffering Module 420 Header Information Syntax Parsing Module 430 Header Information Storage Module 440 Decoding Modules 50 equipment 510 memory 520 processors 60 equipment 610 memory 620 processors 630 Input / Output Interfaces 640 network interfaces 650 storage interfaces 66 Service Bus

Claims

1. A step of buffering one or more stream segments of a received data stream, wherein the data stream includes an audio stream; A step of parsing one or more buffered stream segments until header information is obtained through parsing, comprising: determining whether the total data length of all currently buffered stream segments has reached a preset frame length; if the total data length of all currently buffered stream segments has reached the preset frame length, parsing the data of the preset frame length from the starting position in the currently buffered stream segment; determining whether the header information has been successfully parsed; and if the header information has not been successfully parsed, updating the preset frame length by increasing the preset frame length by a preset value, repeating these steps until the header information has been parsed. The steps include storing the header information, The steps include decoding the stream segment of the audio stream among the various stream segments received according to the header information until the audio stream is completely decoded. A decryption method that includes this.

2. The step of parsing the buffered one or more stream segments until header information is obtained through the parsing is, If the total data length of all currently buffered stream segments does not reach the preset frame length, the next stream segment is received and buffered, and then it is determined again whether the total data length of all currently buffered stream segments has reached the preset frame length. The decoding method according to claim 1, further comprising:

3. The step of decoding the stream segment of the audio stream among the various stream segments received according to the header information is: The steps include: determining the length of the audio frame according to the header information; The steps include decoding the stream segments of the audio stream among the various stream segments received by distinguishing different audio frames according to the length of the audio frames, and The decoding method according to claim 1, including the method described in claim 1.

4. The step of decoding the stream segment of the audio stream among various received stream segments by distinguishing different audio frames according to the length of the audio frame, The steps include dividing the current stream segment of the audio stream according to a sequence defined by the data encapsulation format and according to the length of the audio frame, and obtaining one or more complete audio frames; The steps of decoding one or more complete audio frames, The steps include determining whether the data at the end of the current stream segment of the audio stream belongs to an incomplete audio frame, If the data at the end of the current stream segment of the audio stream belongs to the incomplete audio frame, the steps include buffering the incomplete audio frame, The steps include receiving the next stream segment of the current stream segment of the audio frame, splicing the next stream segment with the incomplete audio frame, and obtaining the spliced ​​stream segment, The steps include taking the spliced ​​stream segment as the current stream segment of the audio stream, The step of repeating the above step until the last stream segment of the audio stream is completely decoded. The decoding method according to claim 3, including the method described in claim 3.

5. The step of decoding the stream segment of the audio stream among the various stream segments received according to the header information until the audio stream is completely decoded, If a failure occurs in decoding the current stream segment of the audio stream based on the header information, the steps include parsing the current stream segment, or parsing the current stream segment and the stream segments following the current stream segment, until new header information is obtained through parsing. The decoding method according to claim 1, comprising the step of decoding the stream segments following the current stream segment according to the new header information until the audio stream is completely decoded.

6. The step of parsing the buffered one or more stream segments until header information is obtained through the parsing is, The step of parsing one or more buffered stream segments by calling the Open avformat method in FFmpeg until the header information is obtained through the parsing. The decoding method according to claim 1, including the method described in claim 1.

7. The step of decoding the stream segment of the audio stream among the various stream segments received according to the header information is: The steps include determining whether the data stream includes data streams other than the audio stream, according to the header information, If the data stream includes data streams other than the audio stream, the steps include separating the data streams other than the audio stream from the audio stream, The steps include determining the format information of the audio stream according to the header information, The steps include transcoding the stream segment of the audio stream back to the original audio stream according to the format information of the audio stream, The steps include: resampling the original audio stream at a preset bitrate; The decoding method according to claim 1, including the method described in claim 1.

8. The data streams other than the audio stream are separated from the audio stream by calling the Separate stream method in FFmpeg. The decoding method according to claim 7, wherein the format information of the audio stream is determined according to the header information, the stream segment of the audio stream is transcoded to the original audio stream according to the format information of the audio stream, and the original audio stream is resampled at the preset bitrate by calling the Parse format method in FFmpeg.

9. A buffering module configured to buffer one or more stream segments of a received data stream, wherein the data stream includes an audio stream, A header information parsing module configured to parsing one or more buffered stream segments until header information is obtained through parsing, wherein the module determines whether the total data length of all currently buffered stream segments has reached a preset frame length, and if the total data length of all currently buffered stream segments has reached the preset frame length, it parses the data of the preset frame length from the starting position in the currently buffered stream segment, determines whether the header information has been successfully parsed, and if the header information has not been successfully parsed, it updates the preset frame length by increasing the preset frame length by a preset value, repeating this process until the header information is parsed, A header information storage module configured to store the header information, A decoding module configured to decode the stream segment of the audio stream among the various stream segments received according to the header information until the audio stream is completely decoded. A decoding device equipped with [a specific feature].

10. Processor and A memory coupled to the processor for storing instructions that cause the processor to execute the decoding method according to any one of claims 1 to 8 when executed by the processor, A decoding device equipped with [a specific feature].

11. A non-temporary computer-readable storage medium in which a computer program is stored, wherein the computer program causes the processor to implement the steps of the method according to any one of claims 1 to 8 when the computer program is executed by the processor.

Citation Information

Patent Citations

  • Music playback circuit

    JP2009086018A