CN109378019B - Audio data reading method and processing system - Google Patents

Audio data reading method and processing system Download PDF

Info

Publication number
CN109378019B
CN109378019B CN201811286301.XA CN201811286301A CN109378019B CN 109378019 B CN109378019 B CN 109378019B CN 201811286301 A CN201811286301 A CN 201811286301A CN 109378019 B CN109378019 B CN 109378019B
Authority
CN
China
Prior art keywords
audio data
buffered
reading
amount
discarding
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
CN201811286301.XA
Other languages
Chinese (zh)
Other versions
CN109378019A (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.)
Jimi Technology Co ltd
Original Assignee
Chengdu Jimi 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 Chengdu Jimi Technology Co Ltd filed Critical Chengdu Jimi Technology Co Ltd
Priority to CN201811286301.XA priority Critical patent/CN109378019B/en
Publication of CN109378019A publication Critical patent/CN109378019A/en
Application granted granted Critical
Publication of CN109378019B publication Critical patent/CN109378019B/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
    • 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/1062Data buffering arrangements, e.g. recording or playback buffers
    • G11B2020/10675Data buffering arrangements, e.g. recording or playback buffers aspects of buffer control
    • G11B2020/10712Data buffering arrangements, e.g. recording or playback buffers aspects of buffer control buffer capacity, e.g. when the buffer capacity is exhausted, buffered data are overwritten with more recent data, accepting that the old data are lost

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses an audio data reading method, which comprises the following steps: obtaining a buffer audio data volume m; acquiring the amount n of audio data to be read; obtaining an allowable buffering audio data amount p; and judging the relation between m and n, if m is more than n + p, discarding s buffered audio data, and then reading n buffered audio data, wherein m- (s + n) is more than or equal to 0 and less than or equal to p. The method and the device judge whether to discard the data or not according to the preset relation between the size of the audio data volume to be read and the size of the remaining data volume of the audio buffer area by reading the size of the remaining data volume of the audio buffer area, have simple criterion and high data processing efficiency, and can meet the requirement of low audio delay.

Description

Audio data reading method and processing system
Technical Field
The invention relates to the field of audio data processing, in particular to an audio data reading method and an audio data processing system.
Background
All sounds heard by human beings are called audio, which may include noise, after the sounds are recorded, whether speaking, singing and musical instruments can be processed by digital music software, and then the audio is stored in a computer, actually, if the computer is provided, and a corresponding audio card (which is often called a sound card), all sounds can be recorded, and acoustic characteristics (such as sound level and the like) of the sounds can be stored in a hard disk file of the computer.
In the digital era, excellent tone quality and good audio call experience are pursued, many existing operating systems (such as android) can support audio input of microphones and the like, in order to solve problems of audio delay, blockage and the like caused by unstable network transmission, audio data buffer packet loss can be performed when audio data are read, and the existing buffer packet loss processing method is complex and low in efficiency, so that under the condition of meeting requirements, how to adopt a simple method capable of realizing low audio delay to perform audio data reading processing has very important significance.
Disclosure of Invention
In view of this, the present application provides an audio data processing method, which determines whether to discard data according to a preset relationship between the size of the audio data to be read and the size of the remaining data amount of the audio buffer by reading the size of the remaining data amount of the audio buffer, wherein the criterion is simple, the data processing efficiency is high, and the requirement of low audio delay can be met. In order to solve the technical problems, the technical scheme provided by the invention is as follows:
an audio data reading method, comprising:
obtaining a buffer audio data volume m;
acquiring the amount n of audio data to be read;
obtaining an allowable buffering audio data amount p;
and judging the relation between m and n, if m is more than n + p, discarding s buffered audio data, and then reading n buffered audio data, wherein m- (s + n) is more than or equal to 0 and less than or equal to p.
Further, the method further comprises:
if n is less than or equal to m and less than or equal to n + p, directly reading n buffered audio data.
Further, the method further comprises:
and if m is less than n, directly reading the m buffered audio data, or continuously waiting until the amount of the buffered audio data reaches n, and reading the n audio data.
Further, the step of obtaining the amount of buffered audio data m includes:
receiving an audio data reading command;
finding a buffer data node according to the audio data reading command;
and obtaining the buffered audio data volume m through the buffered data node.
Further, where p is n, the act of discarding s buffered audio data comprises: discarding s buffered audio data according to equation (1):
s=(INT(m/n)-1)*n (1),
where INT denotes the rounding function.
An audio data processing system comprising:
a buffered audio data amount acquisition module: for obtaining a buffered audio data volume m;
the audio data volume to be read acquisition module: the method comprises the steps of obtaining an audio data volume n to be read;
an allowed buffered audio data amount acquisition module: for obtaining an allowable buffered audio data amount p;
a judgment processing module: and the method is used for judging the relation between m and n and selecting a mode for reading the audio data according to the judgment result.
Further, the judgment processing module further includes an audio data waiting unit: and the judgment processing module is used for continuously waiting until the amount of the buffered audio data reaches n and then reading the n audio data when m is less than n.
Further, still include:
an audio data read command receiving module: for receiving an audio data read command;
the buffer data node searching module: for searching the buffered data node according to the audio data read command.
Further, the judgment processing module includes an audio data discarding function storage unit: the audio data processing module discards buffered audio data according to the audio data discarding function.
The audio data processing method provided by the invention judges whether to discard the data or directly read the audio data according to the relationship between the preset size of the audio data amount to be read and the size of the remaining data amount of the audio buffer area by reading the size of the remaining data amount of the audio buffer area, has simple criterion and high data processing efficiency, and can meet the requirement of low audio delay.
Drawings
Fig. 1 is a flowchart of the method provided in example 1.
Fig. 2 is a block diagram schematically illustrating the structure of an audio data processing system according to embodiment 2.
Detailed Description
In order to make the technical solutions of the present invention better understood by those skilled in the art, the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.
Example 1
As shown in fig. 1, the present embodiment provides an audio data reading method, including:
s1: obtaining a buffer audio data volume m;
s2: acquiring the amount n of audio data to be read;
s3: obtaining an allowable buffering audio data amount p;
s4: and judging the relation between m and n, if m is more than n + p, discarding s buffered audio data, and then reading n buffered audio data, wherein m- (s + n) is more than or equal to 0 and less than or equal to p.
It should be noted that the present embodiment can be applied to an android system or other operating systems, for example, an audio driver is provided in a system kernel, a buffer is provided in the audio drive, audio data is stored in the buffer, and, in step S1, the remaining audio data amount m may be calculated by the formula period size period count, wherein, period _ size refers to the minimum data size read from the buffer in the audio driver each time, and period _ count refers to how many period _ sizes are in the buffer, in the specific implementation of this embodiment, the period _ size is preset, the remaining audio data amount m is read only once before the audio data is read each time, and after the audio data is read, if the audio data needs to be read again, since the amount of remaining audio data in the buffer in the audio drive is dynamically changing, a new amount m of remaining audio data needs to be read again.
It should be noted that the value of the audio data amount n to be read refers to an audio data amount that the system wants to read, and this value may be dynamically changed, so that the sizes of m and n are determined, on one hand, when the remaining data amount m exceeds the required data n, it is indicated that the audio has a delay, and if the delay is to be reduced, a part of data needs to be discarded.
It should be noted that in step S4, the S audio data in the buffer may be discarded at will for efficiency, and if the relevant data needs to be discarded accurately, the VAD algorithm may be used for the discarding process.
Preferably, the method provided by this embodiment further includes:
if n is less than or equal to m and less than or equal to n + p, directly reading n buffered audio data.
It should be noted here that although the remaining data amount in the buffer may cause audio delay, the action of discarding data may also occupy system resources and waste processing time, and therefore, if the remaining data amount is not greater than p after reading the audio data, the audio delay of the system may be acceptable, and thus, the setting allows the remaining audio data to balance the relationship between the audio delay and the system efficiency, of course, if necessary, the value of p may be set to be smaller, even 0, so that after data packet loss, the audio delay may be very small or even zero, and user experience may be effectively improved.
Preferably, the method further comprises: and if m is less than n, directly reading the m buffered audio data, or continuously waiting until the amount of the buffered audio data reaches n, and reading the n audio data.
It should be noted here that when m < n, the audio data may be read in two ways, one is to directly read all the remaining audio data in the buffer, and the other is to read the audio data after the number of the audio data in the buffer reaches n.
Preferably, the step of obtaining the amount of buffered audio data m, i.e., step S1, includes:
receiving an audio data reading command;
finding a buffer data node according to the audio data reading command;
and obtaining the buffered audio data volume m through the buffered data node.
It should be noted here that the buffered data node is an interface made by an audio driver of a system kernel, and a user can obtain or write some data through the node to achieve an interaction between a user plane and a kernel space, and obtaining the buffered audio data amount m through the buffered data node means analyzing the searched buffered data node, opening the node, then reading a character string to a place, and then analyzing a numerical value behind the read character string, thereby obtaining the buffered audio data amount m.
Preferably, in step S4, when p is equal to n, the action of discarding S buffered audio data includes: discarding s data within the buffer according to equation (1):
s=(INT(m/n)-1)*n (1),
where INT denotes the rounding function.
Example 2
As shown in fig. 2, the present embodiment provides an audio data processing system including:
a buffered audio data amount acquisition module: for obtaining a buffered audio data volume m;
the audio data volume to be read acquisition module: the method comprises the steps of obtaining an audio data volume n to be read;
an allowed buffered audio data amount acquisition module: for obtaining an allowable buffered audio data amount p;
a judgment processing module: and the method is used for judging the relation between m and n and selecting a mode for reading the audio data according to the judgment result.
Preferably, the judgment processing module further includes an audio data waiting unit: and the judgment processing module is used for continuously waiting until the amount of the buffered audio data reaches n and then reading the n audio data when m is less than n.
Preferably, this embodiment further includes:
an audio data read command receiving module: for receiving an audio data read command;
the buffer data node searching module: for searching the buffered data node according to the audio data read command.
Preferably, the judgment processing module includes an audio data discarding function storage unit: for storing an audio data discarding function according to which the audio data processing module discards buffered audio data, the specific way in which the respective modules perform operations has been described in detail in the embodiments related to the method, and will not be elaborated herein.
The above is only a preferred embodiment of the present invention, and it should be noted that the above preferred embodiment should not be considered as limiting the present invention, and the protection scope of the present invention should be subject to the scope defined by the claims. It will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the spirit and scope of the invention, and these modifications and adaptations should be considered within the scope of the invention.

Claims (9)

1. An audio data reading method, comprising:
acquiring the residual unread audio data volume m in the buffer area;
acquiring the amount n of audio data to be read by a system;
acquiring the amount p of audio data which is allowed to remain after the desired amount of audio data is read from the remaining unread audio data in the buffer;
judging the relation between m and n, if m is more than n + p, discarding s buffered audio data, and then reading n buffered audio data, wherein m- (s + n) is more than or equal to 0 and less than or equal to p, and the method for discarding the buffered audio data is random discarding or discarding based on VAD algorithm.
2. A method for reading audio data according to claim 1, the method further comprising:
if n is less than or equal to m and less than or equal to n + p, directly reading n buffered audio data.
3. A method for reading audio data according to claim 1, the method further comprising:
and if m is less than n, directly reading the m buffered audio data, or continuously waiting until the amount of the buffered audio data reaches n, and reading the n audio data.
4. The audio data reading method according to claim 1, wherein the step of obtaining the amount m of buffered audio data comprises:
receiving an audio data reading command;
finding a buffer data node according to the audio data reading command;
and obtaining the buffered audio data volume m through the buffered data node.
5. The method of claim 1, wherein p-n, the act of discarding s buffered audio data comprises: discarding s buffered audio data according to equation (1):
s=(INT(m/n)-1)*n (1),
where INT denotes the rounding function.
6. Audio data processing system, characterized in that it comprises:
a buffered audio data amount acquisition module: the method comprises the steps of obtaining the residual unread audio data amount m in a buffer area;
the audio data volume to be read acquisition module: the method comprises the steps of obtaining the amount n of audio data to be read by a system;
an allowed buffered audio data amount acquisition module: the audio data processing device is used for acquiring the amount p of audio data which is allowed to remain after the desired amount of audio data is read from the remaining unread audio data in the buffer;
a judgment processing module: and the method is used for judging the relation between m and n, if m is more than n + p, s buffered audio data are discarded, then n buffered audio data are read, wherein m- (s + n) is more than or equal to 0 and less than or equal to p, and the method for discarding the buffered audio data is random discarding or discarding based on VAD algorithm.
7. The audio data processing system according to claim 6, wherein the judgment processing module further comprises an audio data waiting unit: and the judgment processing module is used for continuously waiting until the amount of the buffered audio data reaches n and then reading the n audio data when m is less than n.
8. The audio data processing system of claim 6, further comprising:
an audio data read command receiving module: for receiving an audio data read command;
the buffer data node searching module: for searching the buffered data node according to the audio data read command.
9. The audio data processing system of claim 6, wherein the determining module comprises an audio data discarding function storage unit: the audio data processing module discards buffered audio data according to the audio data discarding function.
CN201811286301.XA 2018-10-31 2018-10-31 Audio data reading method and processing system Active CN109378019B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811286301.XA CN109378019B (en) 2018-10-31 2018-10-31 Audio data reading method and processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811286301.XA CN109378019B (en) 2018-10-31 2018-10-31 Audio data reading method and processing system

Publications (2)

Publication Number Publication Date
CN109378019A CN109378019A (en) 2019-02-22
CN109378019B true CN109378019B (en) 2020-12-08

Family

ID=65390847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811286301.XA Active CN109378019B (en) 2018-10-31 2018-10-31 Audio data reading method and processing system

Country Status (1)

Country Link
CN (1) CN109378019B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1346198A (en) * 2000-09-30 2002-04-24 华为技术有限公司 Anti-loss treating method for IP speech sound data package
CN102571561A (en) * 2011-12-16 2012-07-11 瑞斯康达科技发展股份有限公司 PWE3 device and method for reading and writing data in jitter buffer of device
CN103229466A (en) * 2012-12-27 2013-07-31 华为技术有限公司 Data packet transmission method and device
CN103594103A (en) * 2013-11-15 2014-02-19 腾讯科技(成都)有限公司 Audio processing method and related device

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001339752A (en) * 2000-05-30 2001-12-07 Mitsubishi Electric Corp External agent and smooth hand-off method
JP4777180B2 (en) * 2005-11-08 2011-09-21 キヤノン株式会社 Imaging apparatus and control method thereof
JP4777418B2 (en) * 2006-03-31 2011-09-21 パナソニック株式会社 Defect management method and defect management apparatus
CN101753422A (en) * 2008-12-12 2010-06-23 Tcl集团股份有限公司 Method for improving subjective quality of network audio
JP2012124689A (en) * 2010-12-08 2012-06-28 Mitsubishi Electric Corp Communication system, transmission side device, reception side device
CN102075436B (en) * 2011-02-10 2014-09-17 华为数字技术(成都)有限公司 Ethernet, and data transmitting method and device thereof
CN102244773B (en) * 2011-06-21 2013-06-05 浙江万里学院 Real-time video streaming transmission method based on narrow variable-bandwidth network
CN104113628A (en) * 2013-04-17 2014-10-22 深圳富泰宏精密工业有限公司 Streaming media rendering processing method and system
CN104269182B (en) * 2014-09-18 2017-05-31 歌尔股份有限公司 The methods, devices and systems that a kind of audio sync is played
CN105049906A (en) * 2015-08-07 2015-11-11 虎扑(上海)文化传播股份有限公司 Data processing method and electronic device
CN105743806B (en) * 2016-04-19 2019-02-26 浙江万朋教育科技股份有限公司 The voice buffering loss treating method based on energy threshold for tcp agreement
CN106341564B (en) * 2016-08-31 2019-12-17 广州视源电子科技股份有限公司 Signal data processing method and device and intelligent conference equipment
CN107395522B (en) * 2017-08-25 2018-10-12 深圳市华讯方舟空间信息产业科技有限公司 Loss treating method based on Transmission Control Protocol and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1346198A (en) * 2000-09-30 2002-04-24 华为技术有限公司 Anti-loss treating method for IP speech sound data package
CN102571561A (en) * 2011-12-16 2012-07-11 瑞斯康达科技发展股份有限公司 PWE3 device and method for reading and writing data in jitter buffer of device
CN103229466A (en) * 2012-12-27 2013-07-31 华为技术有限公司 Data packet transmission method and device
CN103594103A (en) * 2013-11-15 2014-02-19 腾讯科技(成都)有限公司 Audio processing method and related device

Also Published As

Publication number Publication date
CN109378019A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN103152499B (en) Echo canceler
EP2955713A1 (en) Synchronous audio playback method, apparatus and system
EP3358567B1 (en) Sound-mixing processing method, apparatus and device, and storage medium
CN110175081B (en) Optimization system and method for Android audio playing
GB2559460A (en) Speech recognition without interrupting the playback audio
US20080147403A1 (en) Multiple sound fragments processing and load balancing
US8868419B2 (en) Generalizing text content summary from speech content
CN112687286A (en) Method and device for adjusting noise reduction model of audio equipment
CN110111811A (en) Audio signal detection method, device and storage medium
CN112185424A (en) Voice file cutting and restoring method, device, equipment and storage medium
CN110087168B (en) Audio reverberation processing method, device, equipment and storage medium
CN109378019B (en) Audio data reading method and processing system
US11017811B1 (en) Playback speed optimization
CN105895098A (en) Play control method and device
CN113658581B (en) Acoustic model training method, acoustic model processing method, acoustic model training device, acoustic model processing equipment and storage medium
CN107731243B (en) Voice real-time variable-speed playing method and device
KR101842777B1 (en) Method and system for audio quality enhancement
JP3024447B2 (en) Audio compression device
JPH10187191A (en) Method for information processing, information processor, and storage medium therefor
CN111145770B (en) Audio processing method and device
WO2005104125A1 (en) Record reproducing device, simultaneous record reproduction control method and simultaneous record reproduction control program
US7788097B2 (en) Multiple sound fragments processing and load balancing
CN106341519B (en) Audio data processing method and device
US11211075B2 (en) Service control method, service control apparatus and device
CN114400022B (en) Method, device and storage medium for comparing sound quality

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 610041 Tianfu Software Park Area A, 1129 Century City Road, Chengdu High-tech Zone, Sichuan Province

Applicant after: Chengdu Jimi Technology Co.,Ltd.

Address before: 610041 Tianfu Software Park Area A, 1129 Century City Road, Chengdu High-tech Zone, Sichuan Province

Applicant before: CHENGDU XGIMI TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 610000 building 4, zone a, Tianfu Software Park, No. 1129, shijicheng Road, high tech Zone, Chengdu, Sichuan

Patentee after: Jimi Technology Co.,Ltd.

Address before: No.2, floor 2, unit 1, building 4, Tianfu Software Park, no.1129, shijicheng Road, hi tech Zone, Chengdu, Sichuan 610041

Patentee before: Chengdu Jimi Technology Co.,Ltd.