Movatterモバイル変換


[0]ホーム

URL:


CN112579034A - Audio playing method and device - Google Patents

Audio playing method and device
Download PDF

Info

Publication number
CN112579034A
CN112579034ACN201910930126.1ACN201910930126ACN112579034ACN 112579034 ACN112579034 ACN 112579034ACN 201910930126 ACN201910930126 ACN 201910930126ACN 112579034 ACN112579034 ACN 112579034A
Authority
CN
China
Prior art keywords
audio data
audio
playing
processor
intelligent terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910930126.1A
Other languages
Chinese (zh)
Inventor
温冬寒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TD Tech Chengdu Co Ltd
Chengdu TD Tech Ltd
Original Assignee
Chengdu TD Tech 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 TD Tech LtdfiledCriticalChengdu TD Tech Ltd
Priority to CN201910930126.1ApriorityCriticalpatent/CN112579034A/en
Publication of CN112579034ApublicationCriticalpatent/CN112579034A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The application discloses an audio playing method and device, wherein the method comprises the following steps: the method comprises the steps that audio data of preset sound are stored in an audio data processor of the intelligent terminal in advance; and when the intelligent terminal needs to play the sound, the corresponding audio playing program directly triggers the audio data processor to send the stored corresponding audio data to an audio decoder for playing. By applying the technical scheme disclosed by the application, the audio playing time delay can be shortened.

Description

Audio playing method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to an audio playing method and apparatus.
Background
Currently, Android (Android) is widely applied to intelligent terminal devices, such as smart phones, tablet computers, televisions, digital cameras, game machines, smart watches and the like, as a Linux-based free and open source code operating system.
Fig. 1 is a schematic diagram of audio data streams of a prompt tone playing scheme in an existing android system. Arrows in the figure are used to indicate an audio data transmission path of an alert tone playing interface (soundport). As shown in fig. 1, in the conventional android system, an audio playing scheme implemented by using a prompt tone playing interface mainly includes the following steps:
firstly, the audio data to be played is decoded by the main processor, and the decoding result is copied to a system Kernel (Kernel) through memory mapping.
Then, the main processor sends the decoding result of the audio data to a shared memory between the main processor and an audio data processor (Adsp) in a kernel mode;
finally, the Audio data processor fetches the decoding result of the Audio data from the shared memory and sends the decoding result to an Audio decoder (Audio codec) for playing.
The inventor finds that the existing audio data playing scheme has a longer playing time delay, and thus cannot meet the low time delay requirement of many private network services (such as push-to-talk services).
Disclosure of Invention
In view of the above, the present invention provides an audio playing method and apparatus, which can shorten the audio playing time delay.
In order to achieve the purpose, the technical scheme provided by the invention is as follows:
an audio playback method, comprising:
the method comprises the steps that audio data of preset sound are stored in an audio data processor of the intelligent terminal in advance;
and when the intelligent terminal needs to play the sound, the corresponding audio playing program directly triggers the audio data processor to send the stored corresponding audio data to an audio decoder for playing.
Preferably, the storing comprises:
and when the intelligent terminal is started, storing the audio data in an audio data processor of the intelligent terminal.
Preferably, said directly triggering said audio data processor to send said stored corresponding audio data to an audio decoder for playing comprises:
the audio playing program sends an audio playing instruction to the audio data processor through the main processor;
and the audio data processor reads corresponding audio data from the storage space of the audio data processor according to the audio playing instruction and sends the audio data to the audio decoder for playing.
Preferably, the reading the corresponding audio data from the storage space of the audio decoder and sending the audio data to the audio decoder for playing includes:
the audio data processor reads corresponding audio data from a storage space of the audio data processor;
if the read audio data is decoded audio data, directly sending the read audio data to the audio decoder for playing; otherwise, after decoding the read audio data, sending the decoded audio data to the audio decoder for playing.
An audio playing device is arranged in an intelligent terminal and comprises: the intelligent terminal comprises a main processor, an audio data processor and an audio decoder, wherein the main processor is used for storing audio data of preset sound in the audio data processor of the intelligent terminal in advance; and when the audio playing program of the intelligent terminal needs to play the sound, the audio data processor is directly triggered to send the stored corresponding audio data to an audio decoder for playing.
Preferably, the main processor is specifically configured to:
and when the intelligent terminal is started, storing the audio data in an audio data processor of the intelligent terminal.
Preferably, the main processor is specifically configured to: sending an audio playing instruction of the audio playing program to the audio data processor;
the audio data processor is specifically configured to: and reading corresponding audio data from the storage space of the audio decoder according to the audio playing instruction, and sending the audio data to the audio decoder for playing.
Preferably, the reading the corresponding audio data from the storage space of the audio decoder and sending the audio data to the audio decoder for playing includes:
the audio data processor is specifically configured to: according to the audio playing instruction, after reading corresponding audio data from a storage space of the audio playing instruction, if the read audio data is decoded audio data, directly sending the read audio data to the audio decoder for playing; otherwise, after decoding the read audio data, sending the decoded audio data to the audio decoder for playing.
The present application also discloses a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of the audio playback method as previously described.
The application also discloses an electronic device comprising the non-volatile computer-readable storage medium as described above, and the processor having access to the non-volatile computer-readable storage medium.
According to the technical scheme, the audio playing method and the audio playing device provided by the embodiment of the application have the advantages that the audio data of the sound to be played are prestored in the audio data processor, when the prestored sound is played, the prestored corresponding audio data are directly sent to the audio decoder hardware equipment by the audio data processor to be played, the processes of decoding by the main processor and transmitting the decoding result to the audio data processor are not needed, so that the obtaining path of the audio data is effectively shortened, the influence of system scheduling on audio playing is avoided, and therefore, low-delay playing can be realized.
Drawings
Fig. 1 is a schematic diagram of a transmission path of audio data in a prompt tone playing scheme of an existing android system;
FIG. 2 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating transmission paths of audio data according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below by referring to the accompanying drawings and examples.
After the inventor carefully analyzes the existing audio playing scheme implemented by soundport, the inventor finds that the problem of the scheme that the time delay is large is caused by that: the whole process involves a plurality of links needing to be processed by the main processor, so that a plurality of links are influenced by system scheduling, namely, the CPU time slice of the main processor needs to be obtained for decoding, storing and the like of audio data, and the playing time delay is long. Based on this, in the embodiment of the present application, it is considered that the influence of system scheduling on audio playing is reduced as much as possible, the audio data to be played is stored in the audio data processor in advance, and the audio data processor directly sends the audio data to the audio decoder for playing, so that the influence of system scheduling on audio data playing is greatly reduced, low-delay playing can be realized, and the low-delay playing requirement of a service is met.
Fig. 2 is a schematic flow diagram of an audio playing method according to an embodiment of the present invention, and as shown in fig. 2, the audio playing method implemented in this embodiment mainly includes:
step 201, storing the audio data of the preset sound in an audio data processor of the intelligent terminal in advance.
In this step, in order to simplify a path for transmitting the audio data to the audio data processor when playing the sound, the audio data of the sound is stored in the audio data processor of the intelligent terminal in advance. Therefore, when sound is played, the corresponding audio playing program can trigger the audio data processor to directly acquire the corresponding audio data from the storage space of the audio data processor, and the influence of system scheduling on the audio data playing is effectively avoided.
Preferably, the sound source file may be stored in an audio data processor of the intelligent terminal when the intelligent terminal is powered on.
Specifically, the position of the audio data processor for storing the audio data may be a cache or a memory, and the storage is not limited thereto, as long as the storage belongs to a storage space that the audio data processor can directly access.
Step 202, when the intelligent terminal needs to play the sound, a corresponding audio playing program directly triggers the audio data processor to send the stored corresponding audio data to an audio decoder for playing.
In this step, as described above, unlike the conventional scheme, there is no need to go through the decoding of the main processor and the process of transmitting the decoding result to the audio data processor. Fig. 3 is a schematic diagram of a transmission path of audio data when the embodiment of the present invention is adopted, where a solid arrow in fig. 3 is used to indicate the transmission path of the audio data, and a dashed arrow is used to indicate a call flow of starting playing with low latency. As shown in fig. 3, the audio data for playing the sound is directly retrieved from the storage space directly accessible by the audio data processor and sent to the audio decoder hardware. Therefore, the steps can effectively avoid the influence of system scheduling on the audio data playing, greatly shorten the audio playing time delay, and further can meet the service requirement of low-time-delay playing.
Preferably, the following method can be adopted to directly trigger the audio data processor to send the stored corresponding audio data to an audio decoder for playing:
a1, the audio playing program sends the audio playing instruction to the audio data processor through the main processor.
a2, the audio data processor reads corresponding audio data from its own storage space according to the audio playing instruction, and sends the audio data to the audio decoder for playing.
In practical applications, the audio data pre-stored in the audio data processor of the intelligent terminal instep 201 may be undecoded or decoded, and when the audio data is undecoded data, in this step, the audio data processor reads corresponding audio data from its own storage space according to the audio playing instruction, and then needs to decode the audio data first and send the audio data to the audio decoder for playing.
According to the scheme, the method can realize low-delay playing of the sound. Through tests, when the method embodiment is adopted to play the prompt tone on the intelligent terminal, the total time for playing the prompt tone is reduced to 120ms from the original 280ms, the time delay of 160ms is saved, and the time delay for starting the private network service is greatly reduced.
Corresponding to the above method embodiment, the present application further provides an audio playing device, which is disposed in an intelligent terminal, and includes: the intelligent terminal comprises a main processor, an audio data processor and an audio decoder, wherein the main processor is used for storing audio data of preset sound in the audio data processor of the intelligent terminal in advance; and when the audio playing program of the intelligent terminal needs to play the sound, the audio data processor is directly triggered to send the stored corresponding audio data to an audio decoder for playing.
Preferably, the main processor is specifically configured to:
and when the intelligent terminal is started, storing the audio data in an audio data processor of the intelligent terminal.
Preferably, the main processor is specifically configured to: sending an audio playing instruction of the audio playing program to the audio data processor;
the audio data processor is specifically configured to: and reading corresponding audio data from the storage space of the audio decoder according to the audio playing instruction, and sending the audio data to the audio decoder for playing.
Preferably, the reading the corresponding audio data from the storage space of the audio decoder and sending the audio data to the audio decoder for playing includes:
the audio data processor is specifically configured to: according to the audio playing instruction, after reading corresponding audio data from a storage space of the audio playing instruction, if the read audio data is decoded audio data, directly sending the read audio data to the audio decoder for playing; otherwise, after decoding the read audio data, sending the decoded audio data to the audio decoder for playing.
Furthermore, the present application also provides a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of the audio playback method as described above.
Further, the present application provides an electronic device comprising the non-volatile computer-readable storage medium as described above, and the processor having access to the non-volatile computer-readable storage medium.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

CN201910930126.1A2019-09-292019-09-29Audio playing method and devicePendingCN112579034A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910930126.1ACN112579034A (en)2019-09-292019-09-29Audio playing method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910930126.1ACN112579034A (en)2019-09-292019-09-29Audio playing method and device

Publications (1)

Publication NumberPublication Date
CN112579034Atrue CN112579034A (en)2021-03-30

Family

ID=75110267

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910930126.1APendingCN112579034A (en)2019-09-292019-09-29Audio playing method and device

Country Status (1)

CountryLink
CN (1)CN112579034A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113157238A (en)*2021-04-192021-07-23深圳市艾酷通信软件有限公司Audio playing method and device, earphone, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1592894A (en)*2002-06-272005-03-09纳佐米通讯公司Application processors and memory architecture for wireless applications
CN1996487A (en)*2006-12-292007-07-11北京中星微电子有限公司An audio playing device
US20160077790A1 (en)*2014-09-172016-03-17Samsung Electronics Co., Ltd.Audio data operating method and electronic device supporting the same
CN107105096A (en)*2017-04-282017-08-29努比亚技术有限公司A kind of audio-frequency processing method, terminal and storage medium
CN109274405A (en)*2018-08-142019-01-25Oppo广东移动通信有限公司 Data transmission method, device, electronic device and computer readable medium
CN110221805A (en)*2019-06-132019-09-10上海航盛实业有限公司Audio frequency playing method, system, terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1592894A (en)*2002-06-272005-03-09纳佐米通讯公司Application processors and memory architecture for wireless applications
CN1996487A (en)*2006-12-292007-07-11北京中星微电子有限公司An audio playing device
US20160077790A1 (en)*2014-09-172016-03-17Samsung Electronics Co., Ltd.Audio data operating method and electronic device supporting the same
CN107105096A (en)*2017-04-282017-08-29努比亚技术有限公司A kind of audio-frequency processing method, terminal and storage medium
CN109274405A (en)*2018-08-142019-01-25Oppo广东移动通信有限公司 Data transmission method, device, electronic device and computer readable medium
CN110221805A (en)*2019-06-132019-09-10上海航盛实业有限公司Audio frequency playing method, system, terminal and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113157238A (en)*2021-04-192021-07-23深圳市艾酷通信软件有限公司Audio playing method and device, earphone, electronic equipment and storage medium
CN113157238B (en)*2021-04-192025-01-17深圳市艾酷通信软件有限公司Audio playing method and device, earphone, electronic equipment and storage medium

Similar Documents

PublicationPublication DateTitle
CN112087633B (en)Video decoding method, device and storage medium
US20210235153A1 (en)Video processing method, electronic device, and computer-readable medium
US10200706B2 (en)Pipelined video decoder system
US20140359685A1 (en)Video processing method, television dongle, control terminal, and system
US20190149818A1 (en)Video data encoding and decoding method, device, and system, and storage medium
EP3697088A1 (en)Video sending and receiving method, device, and terminal
US20200195842A1 (en)Information pushing method, storage medium, terminal device, and server
CN108932948B (en)Audio data processing method and device, computer equipment and computer readable storage medium
CN111510756A (en)Audio and video switching method and device, computer equipment and readable storage medium
KR20210091812A (en) Video augmentation control method, apparatus, electronic device and storage medium
CN109862409B (en)Video decoding method, video playing method, device, system, terminal and storage medium
CN113521729B (en)Cloud game delay detection method, server, client, system and medium
CN111510755A (en)Audio and video switching method and device, computer equipment and readable storage medium
CN105786441A (en)Audio processing method, server, user equipment and system
US12342001B2 (en)Encoding method, real-time communication method, apparatus, device, and storage medium
CN109803144B (en)Video encoding and decoding method, device and system and electronic equipment
CN112711477A (en)Method and device for switching application programs and electronic equipment
WO2024139129A1 (en)Multimedia playing method, browser, and electronic device
CN112579034A (en)Audio playing method and device
CN105808198A (en)Audio file processing method and apparatus applied to android system and terminal
EP3993430A1 (en)Method for encoding live broadcast data and electronic device
CN113596583A (en)Video stream bullet time data processing method and device
CN114025162B (en)Entropy decoding method, medium, program product, and electronic device
CN118870110A (en) Video processing method, device, equipment and storage medium
WO2015192451A1 (en)Audio play method and device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20210330

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp