CN112579034A - Audio playing method and device - Google Patents
Audio playing method and device Download PDFInfo
- Publication number
- CN112579034A CN112579034A CN201910930126.1A CN201910930126A CN112579034A CN 112579034 A CN112579034 A CN 112579034A CN 201910930126 A CN201910930126 A CN 201910930126A CN 112579034 A CN112579034 A CN 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/16—Sound input; Sound output
- G06F3/165—Management of the audio stream, e.g. setting of volume, audio stream path
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Reverberation, Karaoke And Other Acoustics (AREA)
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
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:
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.
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 in step 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)
1. An audio playing 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.
2. The method of claim 1, wherein the storing comprises:
and when the intelligent terminal is started, storing the audio data in an audio data processor of the intelligent terminal.
3. The method of claim 1, wherein said directly triggering said audio data processor to send said stored corresponding audio data to an audio decoder for playback 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.
4. The method of claim 3, wherein the reading the corresponding audio data from the own storage space and sending the audio data to the audio decoder for playing comprises:
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.
5. The utility model provides an audio playback device, sets up in intelligent terminal, its characterized in that 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.
6. The apparatus of claim 5, wherein 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.
7. The apparatus of claim 5,
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.
8. The apparatus of claim 7, wherein the reading the corresponding audio data from the own storage space and sending to the audio decoder for playing comprises:
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.
9. A non-transitory computer readable storage medium storing instructions which, when executed by a processor, cause the processor to perform the steps of the audio playback method of any of claims 1 to 4.
10. An electronic device comprising the non-volatile computer-readable storage medium of claim 9, and the processor having access to the non-volatile computer-readable storage medium.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910930126.1A CN112579034A (en) | 2019-09-29 | 2019-09-29 | Audio playing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910930126.1A CN112579034A (en) | 2019-09-29 | 2019-09-29 | Audio playing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112579034A true CN112579034A (en) | 2021-03-30 |
Family
ID=75110267
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910930126.1A Pending CN112579034A (en) | 2019-09-29 | 2019-09-29 | Audio playing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112579034A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113157238A (en) * | 2021-04-19 | 2021-07-23 | 深圳市艾酷通信软件有限公司 | Audio playing method and device, earphone, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1592894A (en) * | 2002-06-27 | 2005-03-09 | 纳佐米通讯公司 | Application processors and memory architecture for wireless applications |
CN1996487A (en) * | 2006-12-29 | 2007-07-11 | 北京中星微电子有限公司 | An audio playing device |
US20160077790A1 (en) * | 2014-09-17 | 2016-03-17 | Samsung Electronics Co., Ltd. | Audio data operating method and electronic device supporting the same |
CN107105096A (en) * | 2017-04-28 | 2017-08-29 | 努比亚技术有限公司 | A kind of audio-frequency processing method, terminal and storage medium |
CN109274405A (en) * | 2018-08-14 | 2019-01-25 | Oppo广东移动通信有限公司 | Data transmission method, device, electronic equipment and computer-readable medium |
CN110221805A (en) * | 2019-06-13 | 2019-09-10 | 上海航盛实业有限公司 | Audio frequency playing method, system, terminal and storage medium |
-
2019
- 2019-09-29 CN CN201910930126.1A patent/CN112579034A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1592894A (en) * | 2002-06-27 | 2005-03-09 | 纳佐米通讯公司 | Application processors and memory architecture for wireless applications |
CN1996487A (en) * | 2006-12-29 | 2007-07-11 | 北京中星微电子有限公司 | An audio playing device |
US20160077790A1 (en) * | 2014-09-17 | 2016-03-17 | Samsung Electronics Co., Ltd. | Audio data operating method and electronic device supporting the same |
CN107105096A (en) * | 2017-04-28 | 2017-08-29 | 努比亚技术有限公司 | A kind of audio-frequency processing method, terminal and storage medium |
CN109274405A (en) * | 2018-08-14 | 2019-01-25 | Oppo广东移动通信有限公司 | Data transmission method, device, electronic equipment and computer-readable medium |
CN110221805A (en) * | 2019-06-13 | 2019-09-10 | 上海航盛实业有限公司 | Audio frequency playing method, system, terminal and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113157238A (en) * | 2021-04-19 | 2021-07-23 | 深圳市艾酷通信软件有限公司 | Audio playing method and device, earphone, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10200706B2 (en) | Pipelined video decoder system | |
US11336953B2 (en) | Video processing method, electronic device, and computer-readable medium | |
CN112087633B (en) | Video decoding method, device and storage medium | |
US20140359685A1 (en) | Video processing method, television dongle, control terminal, and system | |
US20200195842A1 (en) | Information pushing method, storage medium, terminal device, and server | |
US9978384B2 (en) | Audio decoding using modulator-demodulator | |
CN104980788A (en) | Video decoding method and device | |
US11202066B2 (en) | Video data encoding and decoding method, device, and system, and storage medium | |
EP3697088A1 (en) | Video sending and receiving method, device, and terminal | |
CN104780378A (en) | Method, device and player for decoding video | |
CN108932948B (en) | Audio data processing method and device, computer equipment and computer readable storage medium | |
WO2020155964A1 (en) | Audio/video switching method and apparatus, and computer device and readable storage medium | |
CN111954051A (en) | Method, equipment and system for transmitting video and audio | |
CN109803144B (en) | Video encoding and decoding method, device and system and electronic equipment | |
CN105786441A (en) | Audio processing method, server, user equipment and system | |
WO2024139129A1 (en) | Multimedia playing method, browser, and electronic device | |
CN112579034A (en) | Audio playing method and device | |
CN104041050A (en) | Multi-threaded texture decoding | |
CN112711477B (en) | Method and device for switching application programs and electronic equipment | |
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 | |
CN113521729A (en) | Cloud game delay detection method, server, client, system and medium | |
CN113099238B (en) | Decoding method for judging video played by android mobile phone | |
WO2015192451A1 (en) | Audio play method and device | |
CN113596583A (en) | Video stream bullet time data processing method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210330 |
|
RJ01 | Rejection of invention patent application after publication |