CN112652317B - High sampling rate audio playing method and system based on Android system - Google Patents
High sampling rate audio playing method and system based on Android system Download PDFInfo
- Publication number
- CN112652317B CN112652317B CN201910955043.8A CN201910955043A CN112652317B CN 112652317 B CN112652317 B CN 112652317B CN 201910955043 A CN201910955043 A CN 201910955043A CN 112652317 B CN112652317 B CN 112652317B
- Authority
- CN
- China
- Prior art keywords
- audio
- sampling rate
- audio stream
- android system
- played
- 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
Links
- 238000005070 sampling Methods 0.000 title claims abstract description 76
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000000605 extraction Methods 0.000 claims description 3
- 238000004590 computer program Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
- G10L19/04—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using predictive techniques
- G10L19/16—Vocoder architecture
- G10L19/167—Audio streaming, i.e. formatting and decoding of an encoded audio signal representation into a data stream for transmission or storage purposes
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
- G10L19/04—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using predictive techniques
- G10L19/16—Vocoder architecture
- G10L19/173—Transcoding, i.e. converting between two coded representations avoiding cascaded coding-decoding
Landscapes
- Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
The invention discloses a high sampling rate audio playing method and a system based on an Android system, wherein the method comprises the steps of obtaining sampling frequency, bit number and format information of an audio stream to be played; separating out an audio stream with the sampling frequency higher than 44.1KHz from the audio stream to be played to obtain a high sampling rate audio stream; notifying the kernel to pre-play high-sampling-rate audio and shielding the upper-layer audio output of the Android system; converting the audio file format into PCM encoded data in wav format; setting the sampling frequency and the bit number of a high sampling rate audio stream to be played in a Linux player; and calling a high sampling rate sound card in the kernel to play the high sampling rate audio stream by adopting the Linux player. According to the method, kernel sound card driving with multiple sampling frequencies is supported, various high-quality audios are decoded into PCM data in a lossless mode, intermediate-layer audio processing of the Android system is skipped, decoding of the audios is conducted, a kernel sound card driving interface is called for playing, lossless output of the audios can be supported, and multiple high-sampling-rate audios can be played.
Description
Technical Field
The invention relates to the technical field of audio file processing, in particular to a high sampling rate audio playing method and system based on an Android system.
Background
Currently, in the Android system, 44.1KHz is used as a default sampling rate for playing audio. At this time, the SRC process is required for playing audio files with other sampling rates. SRC (SAMPLE RATE converter) means a sampling frequency converter, which converts all audio to be played into PCM data with the same sampling frequency, when playing high sampling rate audio files, the sampling rate of the audio files is reduced, and the problems of larger noise and harmonic distortion occur, so that the tone quality of the played audio is deteriorated.
Therefore, how to provide a high-quality high-sampling-rate audio playing method suitable for the Android system is a problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, the invention provides a high sampling rate audio playing method and system based on an Android system, which are based on the Android system, realize the support of kernel sound card driving with multiple sampling frequencies, lossless decode various high-quality audio into PCM data, skip the intermediate layer audio processing of the Android system, and directly use a kernel interface to play high sampling rate audio, thereby solving the problem of poor tone quality of the existing audio playing method realized based on the Android system.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
in one aspect, the invention provides a high sampling rate audio playing method based on an Android system, which comprises the following steps:
Acquiring sampling frequency, bit number and format information of an audio stream to be played;
Separating out an audio stream with the sampling frequency higher than 44.1KHz from the audio stream to be played to obtain a high sampling rate audio stream;
notifying the kernel to pre-play high-sampling-rate audio and shielding the upper-layer audio output of the Android system;
Converting the audio file format into PCM encoded data in wav format;
setting the sampling frequency and the bit number of a high sampling rate audio stream to be played in a Linux player;
and calling a sound card with a high sampling rate in the kernel to play the high sampling rate audio stream by adopting the Linux player.
Further, the process of shielding the upper audio output of the Android system specifically comprises the following steps:
Setting a mark in the drive;
and acquiring the identifier set in the driver before the audio output of the middle layer of the Android system, and judging whether to clear the audio data.
Further, when converting the audio file format into PCM encoded data in wav format, FFmpeg multimedia audio processing tools are used for processing.
On the other hand, the invention also provides a high sampling rate audio playing system based on the Android system, which comprises:
The acquisition module is used for acquiring sampling frequency, bit number and format information of the audio stream to be played;
the extraction module is used for extracting the audio stream with the sampling frequency higher than 44.1KHz in the audio stream to be played to obtain a high sampling rate audio stream;
The jump module is used for informing the kernel to pre-play high-sampling-rate audio and shielding the upper-layer audio output of the Android system;
a decoding module for lossless decoding of the audio file format into PCM data;
The parameter setting module is used for setting the sampling frequency and the bit number of the high sampling rate audio stream to be played in the Linux player;
And the playing module is used for calling the sound card with the high sampling rate in the kernel to play the high sampling rate audio stream by adopting the Linux player.
Compared with the prior art, the high-sampling-rate audio playing method and system based on the Android system are disclosed, the method is based on the Android system, and can support kernel sound card driving with multiple sampling frequencies, can decode various high-quality audio into PCM data in a lossless manner, can skip audio processing of an intermediate layer of the Android system, can decode the audio, can call a kernel sound card driving interface to play, and can support audio lossless output and various high-sampling-rate audio playing.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a high sampling rate audio playing method based on an Android system;
fig. 2 is a schematic structural diagram of an Android system-based high sampling rate audio playing system according to the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
On the one hand, referring to fig. 1, the embodiment of the invention discloses a high sampling rate audio playing method based on an Android system, which comprises the following steps:
s1, acquiring sampling frequency, bit number and format information of an audio stream to be played;
S2, separating an audio stream with the sampling frequency higher than 44.1KHz from the audio stream to be played to obtain a high sampling rate audio stream;
s3, notifying a kernel to pre-play high-sampling-rate audio and shielding upper-layer audio output of an Android system;
s4, converting the audio file format into PCM coded data in wav format;
S5, setting the sampling frequency and the bit number of the high sampling rate audio stream to be played in the Linux player;
s6, calling a sound card with a high sampling rate in the kernel by using the Linux player to play the high sampling rate audio stream.
In a specific embodiment, the process of shielding the audio output of the upper layer of the Android system specifically includes the following steps:
Setting a mark in the drive;
and acquiring the identifier set in the driver before the audio output of the middle layer of the Android system, and judging whether to clear the audio data.
In a specific embodiment, FFmpeg multimedia audio processing tools are used to process the PCM encoded data in the form of an audio file that is converted to wav.
In this example, FFmpeg was developed under the Linux platform, but it could just as well be compiled to run in other operating system environments, including Windows, macOSX, etc. This project was originally initiated by Fabrice Belgard and is now maintained by MICHAEL NIEDERMAYER. Many developers of FFmpeg come from the mplyer project and current FFmpeg is also placed on servers of the mplyer project group. The names of the items come from the MPEG video coding standard, with the former "FF" representing "Fast Forward".
FFmpeg is a set of open source computer programs that can be used to record, convert digital audio, video, and convert it into streams. It includes a current leading audio/video coding library libavcodec. FFmpeg was developed under Linux, but it can be compiled in most operating systems including Windows.
The method provided by the embodiment is based on an android system, realizes supporting kernel sound card driving with multiple sampling frequencies, losslessly decodes various high-quality audios into PCM data, skips an android audio layer, and directly uses a kernel interface to play the high-sampling-rate audios. High-quality output of the played audio is ensured.
On the other hand, referring to fig. 2, the embodiment of the invention also discloses a high sampling rate audio playing system based on the Android system, which comprises:
the acquisition module 1 is used for acquiring sampling frequency, bit number and format information of the audio stream to be played;
The extraction module 2 is used for extracting the audio stream with the sampling frequency higher than 44.1KHz in the audio stream to be played to obtain a high sampling rate audio stream;
the jump module 3 is used for informing the kernel to pre-play high-sampling-rate audio and shielding the upper-layer audio output of the Android system;
a decoding module 4, the decoding module 4 is used for lossless decoding of the audio file format into PCM data;
The parameter setting module 5 is used for setting the sampling frequency and the bit number of the high sampling rate audio stream to be played in the Linux player;
the playing module 6 is used for calling the sound card with the high sampling rate in the kernel to play the audio stream with the high sampling rate by adopting the Linux player.
Compared with the prior art, the high sampling rate audio playing method and system based on the Android system disclosed by the embodiment of the invention have the following advantages:
According to the method, kernel sound card driving with multiple sampling frequencies is supported, various high-quality audios are decoded into PCM data in a lossless mode, intermediate-layer audio processing of the Android system is skipped, decoding of the audios is conducted, a kernel sound card driving interface is called for playing, lossless output of the audios can be supported, and multiple high-sampling-rate audios can be played.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (3)
1. The high sampling rate audio playing method based on the Android system is characterized by comprising the following steps of:
Acquiring sampling frequency, bit number and format information of an audio stream to be played;
Separating out an audio stream with the sampling frequency higher than 44.1KHz from the audio stream to be played to obtain a high sampling rate audio stream;
notifying the kernel to pre-play high-sampling-rate audio and shielding the upper-layer audio output of the Android system;
Converting the audio file format into PCM encoded data in wav format;
setting the sampling frequency and the bit number of a high sampling rate audio stream to be played in a Linux player;
Calling a sound card with a high sampling rate in the kernel to play the audio stream with the high sampling rate by adopting a Linux player;
the process for shielding the upper-layer audio output of the Android system specifically comprises the following steps:
Setting a mark in the drive;
and acquiring the identifier set in the driver before the audio output of the middle layer of the Android system, and judging whether to clear the audio data.
2. The Android system-based high sampling rate audio playing method according to claim 1, wherein when the audio file format is converted into PCM encoded data in wav format, FFmpeg multimedia audio processing tools are used for processing.
3. High sampling rate audio playing system based on Android system, characterized by comprising:
The acquisition module is used for acquiring sampling frequency, bit number and format information of the audio stream to be played;
the extraction module is used for extracting the audio stream with the sampling frequency higher than 44.1KHz in the audio stream to be played to obtain a high sampling rate audio stream;
The jump module is used for informing the kernel to pre-play high-sampling-rate audio and shielding the upper-layer audio output of the Android system;
a decoding module for lossless decoding of the audio file format into PCM data;
The parameter setting module is used for setting the sampling frequency and the bit number of the high sampling rate audio stream to be played in the Linux player;
The playing module is used for calling a sound card with a high sampling rate in the kernel to play the high sampling rate audio stream by adopting a Linux player;
In the jump module, a process of shielding upper-layer audio output of the Android system specifically comprises the following steps: setting a mark in the drive; and acquiring the identifier set in the driver before the audio output of the middle layer of the Android system, and judging whether to clear the audio data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910955043.8A CN112652317B (en) | 2019-10-09 | 2019-10-09 | High sampling rate audio playing method and system based on Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910955043.8A CN112652317B (en) | 2019-10-09 | 2019-10-09 | High sampling rate audio playing method and system based on Android system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112652317A CN112652317A (en) | 2021-04-13 |
CN112652317B true CN112652317B (en) | 2024-07-26 |
Family
ID=75342625
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910955043.8A Active CN112652317B (en) | 2019-10-09 | 2019-10-09 | High sampling rate audio playing method and system based on Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112652317B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108319443A (en) * | 2018-01-26 | 2018-07-24 | 维沃移动通信有限公司 | A kind of audio-frequency inputting method, mobile terminal and audio playing apparatus |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020003765A1 (en) * | 2000-07-10 | 2002-01-10 | Masaharu Matsumoto | Signal processing device and signal processing method |
US7333478B2 (en) * | 2002-05-30 | 2008-02-19 | Garth Wiebe | Methods and apparatus for transporting digital audio-related signals |
JP4593364B2 (en) * | 2005-05-24 | 2010-12-08 | アルパイン株式会社 | Audio data interpolation method and interpolation apparatus |
JP5439707B2 (en) * | 2007-03-02 | 2014-03-12 | ソニー株式会社 | Signal processing apparatus and signal processing method |
CN102355309A (en) * | 2011-08-09 | 2012-02-15 | 中兴通讯股份有限公司 | Method and apparatus for realization of Bluetooth stereophonic sound with support of a plurality of sampling rates |
US20150032238A1 (en) * | 2013-07-23 | 2015-01-29 | Motorola Mobility Llc | Method and Device for Audio Input Routing |
CN104581522A (en) * | 2013-10-24 | 2015-04-29 | 西安群丰电子信息科技有限公司 | High definition lossless audio playing system (HDAP) |
CN103593127A (en) * | 2013-11-25 | 2014-02-19 | 华为终端有限公司 | Method for selecting audio output devices and terminal |
CN103714837A (en) * | 2013-12-18 | 2014-04-09 | 福州瑞芯微电子有限公司 | Electronic device and method for playing audio files |
CN104267924A (en) * | 2014-09-19 | 2015-01-07 | 青岛海信移动通信技术股份有限公司 | Mobile terminal and audio processing method thereof |
CN104616679B (en) * | 2014-12-23 | 2018-01-09 | 福州瑞芯微电子股份有限公司 | A kind of method and device for improving Android system audio recording and reproducing quality |
-
2019
- 2019-10-09 CN CN201910955043.8A patent/CN112652317B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108319443A (en) * | 2018-01-26 | 2018-07-24 | 维沃移动通信有限公司 | A kind of audio-frequency inputting method, mobile terminal and audio playing apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN112652317A (en) | 2021-04-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1154087C (en) | Improving sound quality of established low bit-rate audio coding systems without loss of decoder compatibility | |
CN106653036B (en) | Audio mixing code-transferring method based on OTT boxes | |
CA2578190C (en) | Device and method for generating a coded multi-channel signal and device and method for decoding a coded multi-channel signal | |
CN102074257A (en) | Software and hardware-decoding general multi-media playing equipment and playing method thereof | |
CN100345206C (en) | Encoding method and information reproducing device | |
CN1977565A (en) | Acoustic device and reproduction mode setting method | |
CN1930914A (en) | Frequency-based coding of audio channels in parametric multi-channel coding systems | |
CN1675686A (en) | Trick mode audio playback | |
CN1879163A (en) | Frame-based audio transmission/storage with overlap to facilitate smooth crossfading | |
CN103841451B (en) | Multi-medium play method, device and terminal | |
CN1941144A (en) | Data recording and reproducing apparatus, method, and program therefor | |
CN114333933B (en) | Android application low-delay audio output method on Linux platform | |
CN105869647B (en) | A kind of primary DSD audio-frequency decoding method of smart phone, system and smart phone | |
CN1581973A (en) | Apparatus and method for encoding/decoding broadcast/spare contents | |
CN112652317B (en) | High sampling rate audio playing method and system based on Android system | |
CN1942927A (en) | Content distribution server for distributing content frame for reproducing music and terminal | |
CN1913627A (en) | Deciphering device | |
CN108461086B (en) | Real-time audio switching method and device | |
CN103747249A (en) | Audio and video decoding method and android mobile terminal | |
CN102387177B (en) | Method and device for downloading audio-visual files | |
KR100789380B1 (en) | Interactive Contents Terminal Wherein Object of Media Data Can Be Substituted | |
CN102768834B (en) | A kind of realization decoded method of audio frame | |
CN202111812U (en) | Software and hardware combined decoding universal multimedia player | |
CN114615612B (en) | Text and audio presentation processing method and device | |
US20040125707A1 (en) | Retrieving content of various types with a conversion device attachable to audio outputs of an audio CD player |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |