CN112652317A - 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
- CN112652317A CN112652317A CN201910955043.8A CN201910955043A CN112652317A CN 112652317 A CN112652317 A CN 112652317A CN 201910955043 A CN201910955043 A CN 201910955043A CN 112652317 A CN112652317 A CN 112652317A
- Authority
- CN
- China
- Prior art keywords
- sampling
- audio
- rate
- audio stream
- android system
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000005070 sampling Methods 0.000 claims abstract description 58
- 238000000605 extraction Methods 0.000 claims description 3
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000002542 deteriorative effect Effects 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
Images
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 system based on an Android system, wherein the method comprises the steps of obtaining the sampling frequency, the number of bits and the format information of an audio stream to be played; separating the 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; informing the kernel to pre-play the high sampling rate audio and shielding the upper layer audio output of the Android system; converting the audio file format into PCM coded data in wav format; setting the sampling frequency and the number of bits of a high-sampling-rate audio stream to be played in a Linux player; and calling the high-sampling-rate sound card in the kernel by adopting a Linux player to play the high-sampling-rate audio stream. The method is based on an Android system, core sound card driving with various sampling frequencies is supported, various high-quality audios are decoded into PCM data in a lossless mode, audio processing of an intermediate layer of the Android system is skipped, the audios are decoded, a core sound card driving interface is called to play the audios, lossless output of the audios and playing of the audios with various high sampling rates can be supported.
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, the default sampling rate is 44.1KHz 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 of the same sampling frequency, and when playing an audio file with a high sampling Rate, the sampling Rate of the audio file is reduced, which may cause problems of large noise and harmonic distortion, thereby deteriorating the sound quality of the played audio.
Therefore, it is an urgent need to solve the problem of the prior art to provide a high-quality audio playing method with a high sampling rate suitable for the Android system.
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, and the method is based on the Android system, and is capable of supporting core sound card driving of various sampling frequencies, losslessly decoding various high-quality audios into PCM data, skipping middle layer audio processing of the Android system, and directly playing the high sampling rate audio by using a core interface, so that the problem of poor sound quality of the existing audio playing method based on the Android system is solved.
In order to achieve the purpose, the invention adopts the following technical scheme:
on one hand, the invention provides a high sampling rate audio playing method based on an Android system, which comprises the following steps:
acquiring the sampling frequency, the digit and the format information of an audio stream to be played;
separating the 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;
informing the kernel to pre-play the high sampling rate audio and shielding the upper layer audio output of the Android system;
converting the audio file format into PCM coded data in wav format;
setting the sampling frequency and the number of bits of a high-sampling-rate audio stream to be played in a Linux player;
and calling the high-sampling-rate sound card in the kernel by adopting a Linux player to play the high-sampling-rate audio stream.
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 an identifier set in the driver before the audio output of the Android system middle layer, and judging whether to clear the audio data.
Further, when the audio file format is converted into the PCM encoded data of wav format, the PCM encoded data is processed by using an FFmpeg multimedia audio processing tool.
On the other hand, the invention also provides a high sampling rate audio playing system based on the Android system, and the system comprises:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring the sampling frequency, the digit and the 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 skipping module is used for informing the kernel to pre-play the high-sampling-rate audio and shielding the upper-layer audio output of the Android system;
a decoding module for lossless decoding of an audio file format into PCM data;
the parameter setting module is used for setting the sampling frequency and the number of bits of the high-sampling-rate audio stream to be played in the Linux player;
and the playing module is used for calling the high-sampling-rate sound card in the kernel by adopting a Linux player to play the high-sampling-rate audio stream.
According to the technical scheme, 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, core sound card driving with various sampling frequencies is supported, various high-quality audios are decoded into PCM data in a lossless mode, audio processing of an intermediate layer of the Android system is skipped, decoding of the audios is achieved, a core sound card driving interface is called to play the audios, lossless output of the audios can be supported, and the audios with various sampling rates can be played.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of a high sampling rate audio playing method based on an Android system according to the present invention;
fig. 2 is a schematic structural diagram of a high sampling rate audio playing system based on an Android system according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
On one hand, referring to fig. 1, an embodiment of the present invention discloses a high sampling rate audio playing method based on an Android system, including:
s1, acquiring the sampling frequency, the digit and the format information of the audio stream to be played;
s2, separating the audio frequency flow with the sampling frequency higher than 44.1KHz in the audio frequency flow to be played to obtain the high sampling rate audio frequency flow;
s3, informing the kernel to pre-play high sampling rate audio and shielding the upper layer audio output of the Android system;
s4, converting the audio file format into PCM coded data in wav format;
s5, setting the sampling frequency and the digit of the high sampling rate audio stream to be played in the Linux player;
and S6, calling the high-sampling-rate sound card 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 upper audio output of the Android system specifically includes the following steps:
setting a mark in the drive;
and acquiring an identifier set in the driver before the audio output of the Android system middle layer, and judging whether to clear the audio data.
In a specific embodiment, the conversion of the audio file format into the wav format PCM encoded data is performed using FFmpeg multimedia audio processing tools.
In this example, FFmpeg was developed under the Linux platform, but it could also be compiled to run in other operating system environments as well, including Windows, MacOSX, etc. This project was originally launched by Fabrice Bellard and is now maintained by Michael Niedermayer. Many FFmpeg developers are from the MPlayer project and currently FFmpeg is also placed on the server of the MPlayer project group. The name of the item comes from the MPEG video coding standard, and the "FF" in front stands for "Fast Forward".
FFmpeg is a set of open source computer programs that can be used to record, convert digital audio, video, and convert them into streams. It includes the 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, and is used for realizing the support of kernel sound card driving with various sampling frequencies, losslessly decoding various high-quality audios into PCM data, skipping over an android audio layer, and directly playing the audios with high sampling rate by using a kernel interface. High-quality output of the played audio is ensured.
On the other hand, referring to fig. 2, an embodiment of the present invention further discloses a high sampling rate audio playing system based on an Android system, where the system includes:
the device comprises an acquisition module 1, a display module and a display module, wherein the acquisition module 1 is used for acquiring the sampling frequency, the digit and the format information of an audio stream to be played;
the extraction module 2 is used for extracting the audio stream with the sampling frequency higher than 44.1KHz from the audio stream to be played to obtain the high-sampling-rate audio stream;
the skipping module 3 is used for informing the kernel to pre-play the high sampling rate audio and shielding the upper layer audio output of the Android system;
the decoding module 4 is used for decoding the audio file format into PCM data in a lossless mode;
the parameter setting module 5 is used for setting the sampling frequency and the number of bits of the high-sampling-rate audio stream to be played in the Linux player;
and the playing module 6 is used for calling the high-sampling-rate sound card in the kernel to play the high-sampling-rate audio stream by adopting a 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:
the method is based on an Android system, core sound card driving with various sampling frequencies is supported, various high-quality audios are decoded into PCM data in a lossless mode, audio processing of an intermediate layer of the Android system is skipped, the audios are decoded, a core sound card driving interface is called to play the audios, lossless output of the audios and playing of the audios with various high sampling rates can be supported.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
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 (4)
1. A high sampling rate audio playing method based on an Android system is characterized by comprising the following steps:
acquiring the sampling frequency, the digit and the format information of an audio stream to be played;
separating the 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;
informing the kernel to pre-play the high sampling rate audio and shielding the upper layer audio output of the Android system;
converting the audio file format into PCM coded data in wav format;
setting the sampling frequency and the number of bits of a high-sampling-rate audio stream to be played in a Linux player;
and calling the high-sampling-rate sound card in the kernel by adopting a Linux player to play the high-sampling-rate audio stream.
2. The Android system-based high sampling rate audio playing method as claimed in claim 1, wherein the process of shielding the upper audio output of the Android system specifically includes the following steps:
setting a mark in the drive;
and acquiring an identifier set in the driver before the audio output of the Android system middle layer, and judging whether to clear the audio data.
3. The Android system-based high sampling rate audio playing method as claimed in claim 1 or 2, wherein when converting the audio file format into the PCM encoded data of wav format, the PCM encoded data is processed by using an FFmpeg multimedia audio processing tool.
4. The utility model provides a high sampling rate audio playback system based on Android system which characterized in that includes:
the device comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring the sampling frequency, the digit and the 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 skipping module is used for informing the kernel to pre-play the high-sampling-rate audio and shielding the upper-layer audio output of the Android system;
a decoding module for lossless decoding of an audio file format into PCM data;
the parameter setting module is used for setting the sampling frequency and the number of bits of the high-sampling-rate audio stream to be played in the Linux player;
and the playing module is used for calling the high-sampling-rate sound card in the kernel by adopting a Linux player to play the high-sampling-rate audio stream.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910955043.8A CN112652317B (en) | 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 | High sampling rate audio playing method and system based on Android system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112652317A true CN112652317A (en) | 2021-04-13 |
CN112652317B CN112652317B (en) | 2024-07-26 |
Family
ID=
Citations (12)
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 |
US20030223409A1 (en) * | 2002-05-30 | 2003-12-04 | Wiebe Garth D. | Methods and apparatus for transporting digital audio-related signals |
JP2006330144A (en) * | 2005-05-24 | 2006-12-07 | Alpine Electronics Inc | Interpolation method and interpolation system of audio data |
JP2008250270A (en) * | 2007-03-02 | 2008-10-16 | Sony Corp | 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 |
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 |
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) |
CN104616679A (en) * | 2014-12-23 | 2015-05-13 | 福州瑞芯微电子有限公司 | Method and device for improving audio recording and playing quality of Android system |
CN108319443A (en) * | 2018-01-26 | 2018-07-24 | 维沃移动通信有限公司 | A kind of audio-frequency inputting method, mobile terminal and audio playing apparatus |
Patent Citations (12)
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 |
US20030223409A1 (en) * | 2002-05-30 | 2003-12-04 | Wiebe Garth D. | Methods and apparatus for transporting digital audio-related signals |
JP2006330144A (en) * | 2005-05-24 | 2006-12-07 | Alpine Electronics Inc | Interpolation method and interpolation system of audio data |
JP2008250270A (en) * | 2007-03-02 | 2008-10-16 | Sony Corp | 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 |
CN104616679A (en) * | 2014-12-23 | 2015-05-13 | 福州瑞芯微电子有限公司 | Method and device for improving audio recording and playing quality of Android system |
CN108319443A (en) * | 2018-01-26 | 2018-07-24 | 维沃移动通信有限公司 | A kind of audio-frequency inputting method, mobile terminal and audio playing apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10546599B1 (en) | Systems and methods for identifying a mute/sound sample-set attribute | |
CN106653036B (en) | Audio mixing code-transferring method based on OTT boxes | |
CN102074257A (en) | Software and hardware-decoding general multi-media playing equipment and playing method thereof | |
CN101178921B (en) | Method and system for processing audio signal | |
CN1170199A (en) | Apparatus for reproducing audio signals for plurality of channels or languages from disc and method thereof | |
CN102014262A (en) | Hard disk video recorder and system and method for converting multimedia formats | |
CN109068163B (en) | Audio and video synthesis system and synthesis method thereof | |
RU2010124841A (en) | METHOD, DEVICE AND SYSTEM FOR VIDEO CALL | |
CN111182315A (en) | Multimedia file splicing method, device, equipment and medium | |
CN104796766A (en) | Video file play method and device | |
CN1941144A (en) | Data recording and reproducing apparatus, method, and program therefor | |
CN105704508A (en) | Video merging method and device | |
CN103841451B (en) | Multi-medium play method, device and terminal | |
CN106060628A (en) | DirectShow-based method and system supporting variable coding | |
CN112652317A (en) | High-sampling-rate audio playing method and system based on Android system | |
CN112652317B (en) | High sampling rate audio playing method and system based on Android system | |
CN102881306A (en) | Method and device for transcoding video files | |
CN1913627A (en) | Deciphering device | |
US20100165815A1 (en) | Gapless audio playback | |
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 | |
CN1668099A (en) | A/V recording and reproducing system | |
CN202111812U (en) | Software and hardware combined decoding universal multimedia player | |
CN113965776B (en) | Multi-mode audio and video format high-speed conversion method and system |
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 |