CN107105096A - A kind of audio-frequency processing method, terminal and storage medium - Google Patents

A kind of audio-frequency processing method, terminal and storage medium Download PDF

Info

Publication number
CN107105096A
CN107105096A CN201710291381.7A CN201710291381A CN107105096A CN 107105096 A CN107105096 A CN 107105096A CN 201710291381 A CN201710291381 A CN 201710291381A CN 107105096 A CN107105096 A CN 107105096A
Authority
CN
China
Prior art keywords
audio
file
spatial cache
terminal
audio file
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
CN201710291381.7A
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710291381.7A priority Critical patent/CN107105096A/en
Publication of CN107105096A publication Critical patent/CN107105096A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72442User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for playing music files
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech 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/008Multichannel audio signal coding or decoding using interchannel correlation to reduce redundancy, e.g. joint-stereo, intensity-coding or matrixing

Abstract

The embodiment of the invention discloses a kind of audio-frequency processing method, it dynamically can adjust the size of spatial cache to store voice data, reduce the complexity of decoding, alleviate CPU and DSP processing load, this method includes:Audio playing request is received, audio playing request is used to ask to play the first audio file;Audio playing request is responded, the first file type of the first audio file is parsed;When the first file type is not stored in mapping table of the default file type with caching, the acoustic characteristic parameter of the first audio file is parsed, and the first spatial cache is calculated according to acoustic characteristic parameter;Decoding process is carried out to the first audio file according to the size of the first spatial cache, the first played file is obtained.

Description

A kind of audio-frequency processing method, terminal and storage medium
Technical field
The present invention relates to field of terminal technology, more particularly to a kind of audio-frequency processing method, terminal and storage medium.
Background technology
In the mobile Internet epoch, with popularizing for intelligent terminal, the sound that user constantly pursues high-quality regards body Test, high code check, multichannel, lossless source of sound gradually turn into intelligent terminal standard configuration, so to audio play tonequality audio will Seek more and more higher.At present, (MP3, Moving the Picture Experts of dynamic image expert compression standard audio aspect 3 Group Audio Layer III), Advanced Audio Coding (AAC, Advanced Audio Coding), audio coding 3 (AC3, Audio Coding3), the audio decoding techniques such as enhanced audio coding (EAC3, Enhanced AC-3) are used as numeral more popular now Audio coding and lossy compression method form, can be greatly reduced amount of audio data, and for the auditory perception of most of users For, the tonequality of the audio of playback does not significantly decrease compared with the initial tonequality for not compressing audio.
Existing intelligent terminal typically all supports audio MP3, AAC, AC3, EAC3 etc. hardware decoding (audio hardware solution Code).Audio hardware decoding be by central processing unit (CPU, Central Processing Unit) from heavy decoding effort Pull out and, the decoding effort of audio is handed into Digital Signal Processing (DSP, Digital Signal Processing) and entered Row decoding, CPU needs the audio compression data than the buffers of larger (32KB) passing to DSP, and such DSP just can be from Audio compression data is obtained in buffers decode.
Yet with the difference of the compressing file mode such as MP3, AAC, AC3, EAC3, transmitted not using identical audio frame number During the file of same type, the difference in size of the buffers required for each file is larger, so using fixed size When buffers carries out audio compression data storage, the waste of internal memory is will result in, in addition, fixed buffers sizes can make Audio compression data is obtained under border condition, its corresponding audio frame number is like this also needed to according to situation about need to be split The position that record is split the sequence number of audio frame number evidence and split, so as to cause the complexity of document analysis and decoding, is added CPU and DSP processing load.
The content of the invention
In order to solve the above technical problems, the embodiment of the present invention is expected to provide a kind of audio-frequency processing method and terminal, Neng Goudong State adjusts the size of spatial cache to store voice data, reduces the complexity of decoding, and the processing for alleviating CPU and DSP is born Load.
The technical proposal of the invention is realized in this way:
The embodiments of the invention provide a kind of audio-frequency processing method, including:
Audio playing request is received, the audio playing request is used to ask to play the first audio file;
The audio playing request is responded, the first file type of first audio file is parsed;
When first file type is not stored in mapping table of the default file type with caching, described the is parsed The acoustic characteristic parameter of one audio file, and first spatial cache is calculated according to the acoustic characteristic parameter;
Decoding process is carried out to the first audio file according to the size of first spatial cache, the first broadcasting text is obtained Part.
In such scheme, the acoustic characteristic parameter for parsing first audio file, and according to the audio Characterisitic parameter, which calculates first spatial cache, to be included:
Parse sample frequency, sampling resolution and the channel number of first audio file;
According to the sample frequency, the sampling resolution, the channel number and default sampling time, first sound is calculated The audio frame number evidence of frequency file;
According to the audio frame number evidence and Preset Transfer frame number, first caching for calculating first audio file is empty Between.
In such scheme, it is described first spatial cache is calculated according to the acoustic characteristic parameter after, it is described Method also includes:
First spatial cache and the corresponding relation of first file type are recorded in the default file type With in the mapping table of caching.
In such scheme, after first file type for parsing first audio file, and it is described according to The size of first spatial cache carries out decoding process to the first audio file, before obtaining the first played file, the side Method also includes:
When first file type has been stored in mapping table of the default file type with caching, from the default text Part type finds out first spatial cache corresponding with first file type with the mapping table cached.
In such scheme, before the response audio playing request, methods described also includes:
Detect whether to open self-adaption of decoding function;
Accordingly, the response audio playing request, including:
The self-adaption of decoding function has been had turned on if detecting, the audio playing request is responded.
In such scheme, the size according to first spatial cache is carried out at decoding to the first audio file Reason, is obtained after the first played file, methods described also includes:
Play first played file.
The embodiments of the invention provide a kind of terminal, including:Receiver, memory, processor and communication bus, it is described to connect Device, the memory and the processor is received to connect by the communication bus;
The receiver is used to receive audio playing request, and the audio playing request is used to ask to play the first audio text Part;
The memory is used for the be stored with processor-executable instruction or audio frequency process relative program, the receiver Reception data;
The processor is used for the audio frequency process relative program for calling the memory storage, and performs following steps:
The audio playing request is responded, the first file type of first audio file is parsed;When described first When file type is not stored in default file type with the mapping table of caching, the audio for parsing first audio file is special Property parameter, and first spatial cache is calculated according to the acoustic characteristic parameter;According to the big of first spatial cache It is small that decoding process is carried out to the first audio file, obtain the first played file.
In above-mentioned terminal, the processor is additionally operable to perform the audio frequency process relative program, specific to perform following step Suddenly:
Parse sample frequency, sampling resolution and the channel number of first audio file;According to the sample frequency, institute Sampling resolution, the channel number and default sampling time are stated, the audio frame number evidence of first audio file is calculated;According to described Audio frame number evidence and Preset Transfer frame number, calculate first spatial cache of first audio file.
In above-mentioned terminal, the terminal also includes:Player, the player, the receiver, the memory and The processor is connected by the communication bus;The memory be also stored with the player plays audio frequency process play Program, the player calls the audio frequency process playing program of the memory storage, performs following operation:
Play first played file.
The embodiments of the invention provide a kind of computer-readable recording medium, the computer-readable recording medium storage has One or more program, one or more of programs can be by one or more computing device, to realize following step Suddenly:Audio playing request is obtained, the audio playing request is used to ask to play the first audio file;The audio is responded to play Request, parses the first file type of first audio file;When first file type is not stored in default file When type is with the mapping table of caching, the acoustic characteristic parameter of first audio file is parsed, and it is special according to the audio Property parameter calculates first spatial cache;Size according to first spatial cache is decoded to the first audio file Processing, obtains the first played file.
The embodiments of the invention provide a kind of audio-frequency processing method, terminal and storage medium, audio playing request, sound are received Frequency playing request is used to ask to play the first audio file;Audio playing request is responded, the first of the first audio file is parsed File type;When the first file type is not stored in mapping table of the default file type with caching, the first audio is parsed The acoustic characteristic parameter of file, and the first spatial cache is calculated according to acoustic characteristic parameter;According to the big of the first spatial cache It is small that decoding process is carried out to the first audio file, obtain the first played file.Using above-mentioned technic relization scheme, due to audio text Spatial cache shared by part can be by file type difference to calculate, therefore, for different file types, caching The size in space can be adjusted dynamically, so ensure that the audio frame number of audio file according to be not required to carry out fractionation can To realize normal decoding process, so as to reduce the complexity of decoding, enter without increasing CPU and DSP processing load.
Brief description of the drawings
Fig. 1 is a kind of hardware architecture diagram of optional mobile terminal provided in an embodiment of the present invention;
Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart one of audio-frequency processing method provided in an embodiment of the present invention;
Fig. 4 is a kind of exemplary broadcast interface figure one provided in an embodiment of the present invention;
Fig. 5 is a kind of flowchart 2 of audio-frequency processing method provided in an embodiment of the present invention;
Fig. 6 is a kind of exemplary voice applications play and arranging interface figure provided in an embodiment of the present invention;
Fig. 7 is a kind of flow chart 3 of audio-frequency processing method provided in an embodiment of the present invention;
Fig. 8 is a kind of exemplary broadcast interface figure two provided in an embodiment of the present invention;
Fig. 9 is a kind of inner bay composition of the terminal of audio-frequency processing method foundation provided in an embodiment of the present invention;
Figure 10 is the structural representation of terminal provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described.
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In follow-up description, the suffix using such as " module ", " part " or " unit " for representing element is only Be conducive to the explanation of the present invention, itself there is no a specific meaning.Therefore, " module ", " part " or " unit " can be mixed Ground is used.
Terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as mobile phone, flat board Computer, notebook computer, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable Media player (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer etc. are moved Move the fixed terminals such as terminal, and numeral TV, desktop computer.
It will be illustrated in subsequent descriptions by taking mobile terminal as an example, it will be appreciated by those skilled in the art that except special Outside element for moving purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, its hardware configuration signal for a kind of optional mobile terminal of realization each embodiment of the invention Figure, the mobile terminal 1 00 can include:RF (Radio Frequency, radio frequency) unit 101, Wi-Fi module 102, audio are defeated Go out unit 103, A/V (audio/video) input block 104, sensor 105, display unit 106, user input unit 107, connect The parts such as mouth unit 108, memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that in Fig. 1 The mobile terminal structure shown does not constitute the restriction to mobile terminal, and mobile terminal can include more more or less than illustrating Part, either combines some parts or different parts arrangement.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, the reception and transmission of signal, specifically, by base station Downlink information receive after, handled to processor 110;In addition, up data are sent into base station.Generally, radio frequency unit 101 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating Frequency unit 101 can also be communicated by radio communication with network and other equipment.Above-mentioned radio communication can use any communication Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division Multiple Access, WCDMA), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, FDD Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution, time division duplex Long Term Evolution) etc..
Wi-Fi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch by Wi-Fi module 102 Email, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 1 Wi-Fi module 102 is shown, but it is understood that, it is simultaneously not belonging to must be configured into for mobile terminal, completely can basis Need to omit in the essential scope for do not change invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 1 00 When under the isotypes such as formula, speech recognition mode, broadcast reception mode, it is that radio frequency unit 101 or Wi-Fi module 102 are received or The voice data that person stores in memory 109 is converted into audio signal and is output as sound.Moreover, audio output unit 103 can also provide performed to mobile terminal 1 00 the related audio output of specific function (for example, call signal reception sound, Message sink sound etc.).Audio output unit 103 can include loudspeaker, buzzer etc..
Mobile terminal 1 00 also includes at least one sensor 105, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 1061, and proximity transducer can close when mobile terminal 1 00 is moved in one's ear Display panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (general For three axles) size of acceleration, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, The other sensors such as hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Display unit 106 is used for the information for showing the information inputted by user or being supplied to user.Display unit 106 can be wrapped Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configures display panel 1061.
User input unit 107 can be used for the numeral or character information for receiving input, and produce the use with mobile terminal The key signals input that family is set and function control is relevant.Specifically, user input unit 107 may include contact panel 1071 with And other input equipments 1072.Contact panel 1071, also referred to as touch-screen, collect touch operation of the user on or near it (such as user is using any suitable objects such as finger, stylus or annex on contact panel 1071 or in contact panel 1071 Neighbouring operation), and corresponding attachment means are driven according to formula set in advance.Contact panel 1071 may include touch detection Two parts of device and touch controller.Wherein, touch detecting apparatus detects the touch orientation of user, and detects touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it It is converted into contact coordinate, then gives processor 110, and the order sent of reception processing device 110 and can be performed.In addition, can To realize contact panel 1071 using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except contact panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can be wrapped Include but be not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc. One or more, do not limit herein specifically.
Further, contact panel 1071 can cover display panel 1061, detect thereon when contact panel 1071 or After neighbouring touch operation, processor 110 is sent to determine the type of touch event, with preprocessor 110 according to touch thing The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, contact panel 1071 and display panel 1061 be input and the output function that mobile terminal is realized as two independent parts, but in certain embodiments, can By contact panel 1071 and the input that is integrated and realizing mobile terminal of display panel 1061 and output function, not do specifically herein Limit.
Interface unit 108 is connected the interface that can pass through as at least one external device (ED) with mobile terminal 1 00.For example, External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing Line FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 1 00 or can be with For transmitting data between mobile terminal 1 00 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program area And storage data field, wherein, application program (the such as sound that storing program area can be needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data field can be stored uses created data (such as according to mobile phone Voice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, it can also include non-easy The property lost memory, for example, at least one disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the whole mobile terminal of connection Individual part, by operation or performs and is stored in software program and/or module in memory 109, and calls and be stored in storage Data in device 109, perform the various functions and processing data of mobile terminal, so as to carry out integral monitoring to mobile terminal.Place Reason device 110 may include one or more processing units;It is preferred that, processor 110 can integrated application processor and modulatedemodulate mediate Device is managed, wherein, application processor mainly handles operating system, user interface and application program etc., and modem processor is main Handle radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 1 00 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111 Can be logically contiguous by power-supply management system and processor 110, so as to realize management charging by power-supply management system, put The function such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 1 00 can also will not be repeated here including bluetooth module etc..
For the ease of understanding the embodiment of the present invention, the communications network system that the mobile terminal of the present invention is based on is entered below Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention, the communication network system Unite as the LTE system of universal mobile communications technology, UE (User Equipment, use of the LTE system including communicating connection successively Family equipment) 201, E-UTRAN (Evolved UMTS Terrestrial Radio Access Network, evolved UMTS lands Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation 204。
Specifically, UE201 can be above-mentioned terminal 100, and here is omitted.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning Journey (backhaul) (such as X2 interface) is connected with other eNodeB2022, and eNodeB2021 is connected to EPC203, ENodeB2021 can provide UE201 to EPC203 access.
EPC203 can include MME (Mobility Management Entity, mobility management entity) 2031, HSS (Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way, Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and There is provided carrying and connection management for the control node of signaling between EPC203.HSS2032 is all to manage for providing some registers Such as function of attaching position register (not shown) etc, and some are preserved about the use such as service features, data rate The special information in family.All customer data can be transmitted by SGW2034, and PGW2035 can provide UE 201 IP Address is distributed and other functions, and PCRF2036 is strategy and the charging control strategic decision-making of business data flow and IP bearing resources Point, it selects and provided available strategy and charging control decision-making with charge execution function unit (not shown) for strategy.
IP operation 204 can include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art it is to be understood that the present invention not only Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with And following new network system etc., do not limit herein.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the inventive method is proposed.
Embodiment one
The embodiments of the invention provide a kind of audio-frequency processing method, as shown in figure 3, this method can include:
S101, reception audio playing request, the audio playing request are used to ask to play the first audio file.
It is applied to realize audio file correlation in terminal in a kind of audio-frequency processing method provided in an embodiment of the present invention During playing in use, the audio file of terminal-pair different type or form is decoded.
Optionally, in embodiments of the present invention, terminal can be mobile phone, computer with audio broadcasting or processing function etc. Electronic equipment, the present invention is not restricted to the type of terminal.
In embodiments of the present invention, when user wants to carry out audio file broadcasting, the user can pass through the sound in terminal The broadcasting of audio file is realized in the application that frequency is played, and then, the user can be selected after audio file from audio file library, is touched Audio playing function is sent out, at this moment, for terminal, the terminal has been received by audio playing request, the audio playing request For asking to play the first audio file, first audio file is exactly the audio file to be played of user's selection.
Exemplary, as shown in figure 4, in the music player of mobile phone, after user's selection song A, clicking on " broadcasting " and pressing Key, just triggers audio playing request, i.e. mobile phone and have received the audio playing request for playing song A.
It should be noted that in embodiments of the present invention, because the coded system of audio file can include:MP3、AAC、 The diversified forms such as AC3 and EAC3, like this, when terminal wants to play audio file (such as the first audio file), be Need first to carry out what decoding process was played again to audio file to be played.
In embodiments of the present invention, the first audio file to be played can be stored in the audio file of terminal local, Can also be the audio file that terminal is obtained by network from the audio file library of media server, specific first audio text The source embodiment of the present invention of part is not restricted.Wherein, the first audio file is present in the form of audio compression data 's.
S102, response audio playing request, parse the first file type of the first audio file.
Terminal is after audio playing request is received, and the terminal response audio playing request starts to the first audio file Decoded, then realize and play the first audio file.Specifically, terminal first needs to parse the coding of the first audio file Mode, i.e. the first file type.
In embodiments of the present invention, the first file type can be the diversified forms such as MP3, AAC, AC3 and EAC3, the present invention Embodiment is not restricted.
It should be noted that the form for being used to characterize the mark of the title of the first audio file in embodiments of the present invention can Think:Name format flags, for example, A.MP3, therefore, the identification information that terminal can be by parsing the first audio file come Analyze the first file type of first audio file.The embodiment of the present invention does not limit the first of the first audio file of parsing The mode of file type.
S103, when the first file type be not stored in default file type with caching mapping table in when, parse first The acoustic characteristic parameter of audio file, and the first spatial cache is calculated according to acoustic characteristic parameter.
Terminal is after response audio playing request, the first file type for first parsing the first audio file, the terminal The spatial cache that can just be taken according to the first file type of the first audio file to the first audio file in decoding enters Row is calculated.Wherein, the first spatial cache is the spatial cache needed for hardware decodes the first audio file.
It should be noted that being that can prestore or be provided with default file class in embodiments of the present invention, in terminal Type and the mapping table of caching, pair of be stored with mapping table of the default file type with caching file type and spatial cache It should be related to, the default file type can be empty with the numerical value in the initial table in the mapping table of caching, be realized in terminal The parsing of the file type of audio file and when calculated the spatial cache of audio file of this document type, The corresponding relation record of this file type and spatial cache can just be suffered in default file type and the mapping table of caching, Therefore, in embodiments of the present invention, when terminal has parsed first file type, due to default file type with It is possible to treat the audio file of this first file type in the mapping table of caching, therefore, the terminal is can First to go the information of default file type spatial cache corresponding with searching whether the first file type in the mapping table cached, If the information of default file type spatial cache corresponding with not finding first file type in the mapping table cached, I.e. when the first file type is not stored in mapping table of the default file type with caching, the terminal goes to parse the first sound again The acoustic characteristic parameter of frequency file, and the first spatial cache is calculated according to acoustic characteristic parameter.
It should be noted that in embodiments of the present invention, the acoustic characteristic parameter of the first audio file can include:First Sample frequency, sampling resolution and channel number of audio file etc., specific terminal calculate first according to acoustic characteristic parameter and delayed Depositing the process in space will be described in detail in subsequent embodiment.
Exemplary, default file type and the form of the mapping table of caching are as shown in table 1, and file is shown in the table 1 Type is that the corresponding spatial caches of file type such as MP3, AAC, AC3 and EAC3 are respectively data 1, data 2, data 3 and data 4。
Table 1
File type Spatial cache (bufferSize)
MP3 Data 1
AAC Data 2
AC3 Data 3
EAC3 Data 4
It should be noted that in embodiments of the present invention, terminal is entered by the way of hardware decoding to the first audio file Row decoding process.In the processing procedure for the hardware decoding that the embodiment of the present invention is used, the CPU of terminal is to fix frame number Audio file is transferred to DSP by transmission means in the form of audio compression data, the decoding realized in dsp.That is, right For the consistent audio file of file type, the buffer Size of transfer audio files are that spatial cache can be consistent.
Further, due to using the mode that hardware is decoded in the embodiment of the present invention, therefore, broadcasting sound is being received Frequency file is asked, and after parsing the first file type, terminal also needs to judge the first files classes of first audio file Whether type can be by the way of hardware decoding, if audio-frequency processing method provided in an embodiment of the present invention can just be performed if Implementation process.Otherwise, the process of audio file decoding cannot be realized by the embodiment of the present invention.
S104, according to the first spatial cache size to the first audio file carry out decoding process, obtain the first broadcasting text Part.
Terminal is parsing the acoustic characteristic parameter of the first audio file, and calculates first according to acoustic characteristic parameter and delay Deposit after space, characterizing first audio file can be carried out at decoding with the audio compression data of the first spatial cache size Reason, specifically, the first audio file is transmitted its audio compression data to DSP by the CPU in terminal with the first spatial cache size, To realize the decoding process to the first audio file in dsp, so as to obtain decoded first played file.
It is understood that in embodiments of the present invention, because the spatial cache shared by audio file can be by File type difference is come what is calculated, and therefore, for different file types, the size of spatial cache can be adjusted dynamically, Normal decoding process can just be realized by so ensuring that the audio frame number evidence of audio file is not required to be split, so that The complexity of decoding is reduced, is entered without increasing CPU and DSP processing load.
Further, in embodiments of the present invention, can be that, with self-adaption of decoding function, what it is in terminal is in terminal When system starts, the self-adaption of decoding function has been switched on or has been provided with setting interface in user to decode adaptive When answering the unlatching of function, audio-frequency processing method provided in an embodiment of the present invention could be carried out, the embodiment of the present invention is not restricted.This The realization of the function setting of sample, improves the flexibility for realizing self-adaption of decoding function.
Embodiment two
The embodiments of the invention provide a kind of audio-frequency processing method, as shown in figure 5, this method can include:
S201, reception audio playing request, the audio playing request are used to ask to play the first audio file.
It is applied to realize audio file correlation in terminal in a kind of audio-frequency processing method provided in an embodiment of the present invention During playing in use, the audio file of terminal-pair different type or form is decoded.
Optionally, in embodiments of the present invention, terminal can be mobile phone, computer with audio broadcasting or processing function etc. Electronic equipment, the present invention is not restricted to the type of terminal.
In embodiments of the present invention, when user wants to carry out audio file broadcasting, the user can pass through the sound in terminal The broadcasting of audio file is realized in the application that frequency is played, and then, the user can be selected after audio file from audio file library, is touched Audio playing function is sent out, at this moment, for terminal, the terminal has been received by audio playing request, the audio playing request For asking to play the first audio file, first audio file is exactly the audio file to be played of user's selection.
Exemplary, as shown in figure 4, in the music player of mobile phone, after user's selection song A, clicking on " broadcasting " and pressing Key, just triggers audio playing request, i.e. mobile phone and have received the audio playing request for playing song A.
It should be noted that in embodiments of the present invention, because the coded system of audio file can include:MP3、AAC、 The diversified forms such as AC3 and EAC3, like this, when terminal wants to play audio file (such as the first audio file), be Need first to carry out what decoding process was played again to audio file to be played.
In embodiments of the present invention, the first audio file to be played can be stored in the audio file of terminal local, Can also be the audio file that terminal is obtained by network from the audio file library of media server, specific first audio text The source embodiment of the present invention of part is not restricted.Wherein, the first audio file is present in the form of audio compression data 's.
S202, detect whether open self-adaption of decoding function.
Due to that can be, with self-adaption of decoding function, to be opened in the system of terminal in embodiments of the present invention, in terminal When dynamic, the self-adaption of decoding function has been switched on or has set interface there is provided self-adaption of decoding work(in user During the unlatching of energy, audio-frequency processing method provided in an embodiment of the present invention could be carried out, the embodiment of the present invention is not restricted.Therefore, Terminal needs to respond to playing audio request after broadcasting audio request is received, and specific how to respond is to need Want whether terminal first opens what is detected to self-adaption of decoding function, self-adaption of decoding function is opened if detecting Words, such process can be realized with audio-frequency processing method provided in an embodiment of the present invention, but detected and do not opened solution If code self-adapting function, then terminal using audio frequency process mode can be existing audio hardware coding/decoding method realize.
That is, terminal needs to detect whether to open self-adaption of decoding function, the terminal can be by going after detection The function setting of platform is realized.The realization of such function setting, improves the flexibility for realizing self-adaption of decoding function.
Exemplary, as shown in fig. 6, can be to self-adaption of decoding in the setting interface during the audio broadcasting of terminal is applied Function is configured, and when user clicks on the "ON" button of self-adaption of decoding function, self-adaption of decoding function is opened, when user's point When hitting the "Off" button of self-adaption of decoding function, self-adaption of decoding function is closed.
It should be noted that after the button in terminal is triggered, the realization of terminal bottom can be by setting specific number Value is characterized, for example, persist.adaptive.audio.buffer.enable 1:Enable audio hard decoder caching adaptive Answer size mechanism (i.e. self-adaption of decoding function);persist.adaptive.audio.buffer.enable 0:Close audio Hard decoder caches adaptive size mechanism.
If S203, detecting and having had turned on self-adaption of decoding function, audio playing request is responded, the first audio is parsed First file type of file.
Terminal is after unlatching self-adaption of decoding function is detected whether, if the terminal, which is detected, has had turned on self-adaption of decoding Function, then respond audio playing request, parse the first file type of the first audio file.
Specifically, terminal response audio playing request, starts to decode the first audio file, then realize and play the One audio file.Specifically, terminal first needs to parse the mode of the coding of the first audio file, i.e. the first file type.
In embodiments of the present invention, the first file type can be the diversified forms such as MP3, AAC, AC3 and EAC3, the present invention Embodiment is not restricted.
It should be noted that the form for being used to characterize the mark of the title of the first audio file in embodiments of the present invention can Think:Name format flags, for example, A.MP3, therefore, the identification information that terminal can be by parsing the first audio file come Analyze the first file type of first audio file.The embodiment of the present invention does not limit the first of the first audio file of parsing The mode of file type.
S204, when the first file type be not stored in default file type with caching mapping table in when, parse first The acoustic characteristic parameter of audio file, and the first spatial cache is calculated according to acoustic characteristic parameter.
Terminal is after response audio playing request, the first file type for first parsing the first audio file, the terminal The spatial cache that can just be taken according to the first file type of the first audio file to the first audio file in decoding enters Row is calculated.Wherein, the first spatial cache is the spatial cache needed for hardware decodes the first audio file.
It should be noted that being that can prestore or be provided with default file class in embodiments of the present invention, in terminal Type and the mapping table of caching, pair of be stored with mapping table of the default file type with caching file type and spatial cache It should be related to, the default file type can be empty with the numerical value in the initial table in the mapping table of caching, be realized in terminal The parsing of the file type of audio file and when calculated the spatial cache of audio file of this document type, The corresponding relation record of this file type and spatial cache can just be suffered in default file type and the mapping table of caching, Therefore, in embodiments of the present invention, when terminal has parsed first file type, due to default file type with It is possible to treat the audio file of this first file type in the mapping table of caching, therefore, the terminal is can First to go the information of default file type spatial cache corresponding with searching whether the first file type in the mapping table cached, If the information of default file type spatial cache corresponding with not finding first file type in the mapping table cached, I.e. when the first file type is not stored in mapping table of the default file type with caching, the terminal goes to parse the first sound again The acoustic characteristic parameter of frequency file, and the first spatial cache is calculated according to acoustic characteristic parameter.
Exemplary, default file type and the form of the mapping table of caching are as shown in table 1, and file is shown in the table 1 Type is that the corresponding spatial caches of file type such as MP3, AAC, AC3 and EAC3 are respectively data 1, data 2, data 3 and data 4。
Table 1
File type Spatial cache (bufferSize)
MP3 Data 1
AAC Data 2
AC3 Data 3
EAC3 Data 4
It should be noted that in embodiments of the present invention, terminal is entered by the way of hardware decoding to the first audio file Row decoding process.In the processing procedure for the hardware decoding that the embodiment of the present invention is used, the CPU of terminal is to fix frame number Audio file is transferred to DSP by transmission means in the form of audio compression data, the decoding realized in dsp.That is, right For the consistent audio file of file type, the buffer Size of transfer audio files are that spatial cache can be consistent.
It should be noted that in embodiments of the present invention, the acoustic characteristic parameter of the first audio file can include:First Sample frequency, sampling resolution and channel number of audio file etc., as shown in fig. 7, specific terminal is according to acoustic characteristic parameter meter Calculating the process of the first spatial cache can include:S2041-S2043.It is as follows:
S2041, the sample frequency for parsing the first audio file, sampling resolution and channel number.
S2042, according to sample frequency, sampling resolution, channel number and default sampling time, calculate the sound of the first audio file Frequency frame data.
S2043, according to audio frame number evidence and Preset Transfer frame number, calculate the first spatial cache of the first audio file.
In embodiments of the present invention, the sampling frequency that terminal can parse the first audio file coding or be used when compressing The acoustic characteristic parameter such as rate, sampling resolution and channel number.Wherein, sample rate is higher, and sound-reducing is more true more naturally, terminal The sample frequency of the first audio file parsed can be the several grades of 22.05KHz, 44.1KHz, 48KHz;Sampling resolution table The resolution that digital audio-frequency apparatus handles sound is levied, the sampling resolution can be 8,16,24 etc.;Channel number refers to sound Source of sound quantity during recording, such as monophonic, multichannel, 5.1 sound channels, 7.1 provincial highways.
It should be noted that in embodiments of the present invention, the default sampling time refers to the sampling time of every frame, this is preset and adopted The sample time is typically taken between 2.5ms~120ms, and the determination in default sampling time is determined by manufacturer or specific application , the default sampling time per frame is shorter, and the delay of generation will be smaller, and the setting present invention in specific default sampling time is implemented Example is not restricted.
Exemplary, in embodiments of the present invention, when terminal is according to sample frequency, sampling resolution, channel number and default sampling Between, calculating the process of the audio frame number evidence of the first audio file can realize that formula (1) is as follows by formula (1):
Audio frame number is according to size=sample frequencys × sampling resolution × channel number × sampling time (1)
Terminal is after the size of audio frame number evidence has been calculated, and the terminal can be according to audio frame number evidence and Preset Transfer Frame number (fixes frame number), calculates the first spatial cache of the first audio file.
Exemplary, in embodiments of the present invention, terminal calculates first according to according to audio frame number evidence and Preset Transfer frame number The process of first spatial cache of audio file can realize that formula (2) is as follows by formula (2):
First spatial cache size bufferSize=audios frame sign × Preset Transfer frame number (2)
Wherein, Preset Transfer frame number can be 100 frames, as long as Preset Transfer frame number is multiframe, the embodiment of the present invention The concrete numerical value of Preset Transfer frame number is not limited.
It should be noted that it is with each multiframe that the CPU of the terminal in the embodiment of the present invention, which transmits the first audio file, What form was transmitted, the continuity that can ensure DSP when hardware decoding is carried out is transmitted using multiframe, decoding is reduced and prolongs When the problem of.
Further, due to using the mode that hardware is decoded in the embodiment of the present invention, therefore, broadcasting sound is being received Frequency file is asked, and after parsing the first file type, terminal also needs to judge the first files classes of first audio file Whether type can be by the way of hardware decoding, if audio-frequency processing method provided in an embodiment of the present invention can just be performed if Implementation process.Otherwise, the process of audio file decoding cannot be realized by the embodiment of the present invention.
S205, according to the first spatial cache size to the first audio file carry out decoding process, obtain the first broadcasting text Part.
Terminal is parsing the acoustic characteristic parameter of the first audio file, and calculates first according to acoustic characteristic parameter and delay Deposit after space, characterizing first audio file can be carried out at decoding with the audio compression data of the first spatial cache size Reason, specifically, the first audio file is transmitted its audio compression data to DSP by the CPU in terminal with the first spatial cache size, To realize the decoding process to the first audio file in dsp, so as to obtain decoded first played file.
S206, by the first spatial cache and the corresponding relation of the first file type record default file type with caching In mapping table.
It is that can prestore or be provided with default file type and the mapping table of caching in terminal, in default file class Type and the corresponding relation of be stored with the mapping table of caching file type and spatial cache, the default file type and caching The numerical value in initial table in mapping table can be empty, and the parsing of file type of an audio file is realized in terminal simultaneously When the spatial cache for the audio file for having calculated this document type, it is possible to by this file type and spatial cache Corresponding relation record is suffered in default file type and the mapping table of caching, therefore, in embodiments of the present invention, when terminal is in root After calculating the first spatial cache according to acoustic characteristic parameter, the terminal is corresponding with the first file type by the first spatial cache Relation record is in mapping table (such as table 1) of institute's default file type with caching, so that next terminal carries out same file type Audio file processing when use.
It is understood that above-mentioned extraction default file type and the mapping table of caching, optimization reduce caching and reduced Run-time memory, prevents system program from occurring abnormal possibility.
S207, when the first file type be stored in default file type with caching mapping table in when, from default file Type finds out the first spatial cache corresponding with the first file type with the mapping table cached.
Terminal is in response audio playing request, after the first file type for first parsing the first audio file, and at end Hold and decoding process is carried out to the first audio file according to the size of the first spatial cache, obtain before the first played file, may be used also Can exist when the first file type has been stored in mapping table of the default file type with caching, then terminal at this moment is can With directly from default file type with cache mapping table in get the first spatial cache corresponding with the first file type Relevant information, then, the terminal just can carry out decoding process according to the size of the first spatial cache to the first audio file, That is S205 process step, so as to obtain the first played file.
S208, the first played file of broadcasting.
Terminal carries out decoding process in the size according to the first spatial cache to the first audio file, obtains the first broadcasting text After part, terminal-pair the first audio file successfully decoded is characterized, then, terminal can just play the first played file.
Exemplary, as shown in figure 8, mobile phone is after user clicks on " broadcasting " button (receive and play audio request), Backstage carries out hardware decoding to song A audio file, and song A is played after the completion of decoding.
It is understood that in embodiments of the present invention, because the spatial cache shared by audio file can be by File type difference is come what is calculated, and therefore, for different file types, the size of spatial cache can be adjusted dynamically, Normal decoding process can just be realized by so ensuring that the audio frame number evidence of audio file is not required to be split, so that The complexity of decoding is reduced, is entered without increasing CPU and DSP processing load.
Further, after complete first played file of terminal plays, the terminal can will just decode the first audio file The resource of Shi Zhanyong the first spatial cache is discharged, and is used during other audio files for processing.
One inside structure for realizing a kind of audio-frequency processing method foundation provided in an embodiment of the present invention is described below.
Exemplary, illustrated by taking Android system as an example, be illustrated in figure 9 the internal structure schematic diagram of terminal, terminal It can be divided into:Application space layer 2, local spatial layer 3, inner nuclear layer 4 and DSP layers 5.Wherein, application space layer 2 is by media application 20 (MusicPlayer Application, such as audio play application) and media player 21 (Media Player) composition;Locally Space layer 3 is by media play server 30 (MediaPlayerService), play system framework 31 (NuPlayer), audio track What road 32 (AudioTrack), Audio mixer 33 (AudioFlinger) and hardware abstraction layer 34 (HAL) were constituted;Inner nuclear layer 4 By the platform driver 40 (Compressed Platform Driver) and (QDSP6ASM of DSP drivers 41 compressed Driver) constitute;DSP layers 5 are by audio stream manager 50 (ASM), audio router 51 (Matrix), general object processor 52 (COPP), audio front end module 53 (AFE) and dio Output Modules 54 (Audio PCM Output) composition.Wherein, system is played It can also include in system framework 31:Data source 310, audio frequency and video decomposer 311, hardware self-adaption of decoding processing module 312 and soft Part decoder module 313.
Framework based on Fig. 9, being triggered for the media application of terminal, generates audio playing request, passes through media player Go request media player to play out the first audio file, then, go in data source to obtain the first file, pass through audio frequency and video Decomposer obtains the first audio file, is then calculated in hardware self-adaption of decoding processing module using provided in an embodiment of the present invention The method of spatial cache handles the first audio file, and the first audio file is decoded into mould by software according to the first spatial cache Block transparent transmission, then broadcasting after DSP progress hardware decodings is passed to by kernel.
It should be noted that in embodiments of the present invention, can also be by hardware decoding caching adaptation module generation system Dynamic library component, for multi-platform multiplexing.
Concrete implementation can be the attribute of configuration compiling file, set the title of coding module and be compiled as dynamic link Storehouse;According to compiling attribute, when system is integrally compiled, hardware decoding caching adaptation module is generated into a system component for multiple Platform reuse.
It is understood that hardware decoding caching adaptation module can be multiplexed into multiple hardware and software platforms, improve and be The stability of system, it is easy to which maintenance improves productivity, reduces development cost.
Embodiment three
Same inventive concept based on embodiment one and embodiment two, as shown in Figure 10, the embodiments of the invention provide one Terminal 1 is planted, the terminal 1 can include:
Receiver 10, memory 13, processor 12 and communication bus 14;The receiver 10, the memory 13 and institute Processor 12 is stated to connect by the communication bus 14;
The receiver 10 is used to receive audio playing request, and the audio playing request is used to ask to play the first audio File;
The memory 13 be used to being stored with the executable instruction of processor 12 or audio frequency process relative program, described connect Receive the data of the reception of device 10;
The processor 12 is used for the audio frequency process relative program for calling the memory 13 to store, and performs following step Suddenly:
The audio playing request is responded, the first file type of first audio file is parsed;When described first When file type is not stored in default file type with the mapping table of caching, the audio for parsing first audio file is special Property parameter, and first spatial cache is calculated according to the acoustic characteristic parameter;According to the big of first spatial cache It is small that decoding process is carried out to the first audio file, obtain the first played file.
Optionally, the processor 12 is additionally operable to perform the audio frequency process relative program, specifically performs following steps:Solution Separate out sample frequency, sampling resolution and the channel number of first audio file;According to the sample frequency, the sample bits Several, described channel number and default sampling time, calculate the audio frame number evidence of first audio file;According to the audio frame number According to Preset Transfer frame number, calculate first spatial cache of first audio file.
Optionally, the processor 12 is additionally operable to perform the audio frequency process relative program, performs following steps:Described After calculating first spatial cache according to the acoustic characteristic parameter, by first spatial cache and first file The corresponding relation record of type is in mapping table of the default file type with caching.
Optionally, the processor 12 is additionally operable to perform the audio frequency process relative program, performs following steps:The solution After the first file type for separating out first audio file, and the size according to first spatial cache is to first Audio file carries out decoding process, before obtaining the first played file, when first file type has been stored in default file When type is with the mapping table of caching, found out and first file from mapping table of the default file type with caching Corresponding first spatial cache of type.
Optionally, the processor 12 is additionally operable to perform the audio frequency process relative program, performs following steps:The sound Answer before the audio playing request, detect whether to open self-adaption of decoding function;The decoding has been had turned on if detecting certainly Adaptive functions, then respond the audio playing request.
Optionally, as shown in Figure 10, the terminal 1 also includes:Player 11, the player 11, the receiver 10, The memory 13 and the processor 12 are connected by the communication bus 14;The memory 13 be also stored with it is described play The audio frequency process playing program that device 11 is played, the player 11 calls the audio frequency process playing program of the memory storage, Perform following operation:
Play first played file.
The embodiments of the invention provide a kind of terminal, the terminal receives audio playing request, and audio playing request is used for please Seek the first audio file of broadcasting;Audio playing request is responded, the first file type of the first audio file is parsed;When the first text When part type is not stored in default file type with the mapping table of caching, the acoustic characteristic ginseng of the first audio file is parsed Number, and the first spatial cache is calculated according to acoustic characteristic parameter;According to the size of the first spatial cache to the first audio file Decoding process is carried out, the first played file is obtained.Using above-mentioned technic relization scheme, because the caching shared by audio file is empty Between file type difference is can be by calculate, therefore, for different file types, the size of spatial cache is can be with Dynamic adjustment, normal decoding can just be realized by so ensuring that the audio frame number evidence of audio file is not required to be split Handle, so as to reduce the complexity of decoding, enter without increasing CPU and DSP processing load.
Readable machine storage medium is calculated the embodiments of the invention provide one kind, the computer-readable recording medium storage has One or more program, one or more of programs can be by one or more computing device, to realize following step Suddenly:Audio playing request is obtained, the audio playing request is used to ask to play the first audio file;The audio is responded to play Request, parses the first file type of first audio file;When first file type is not stored in default file When type is with the mapping table of caching, the acoustic characteristic parameter of first audio file is parsed, and it is special according to the audio Property parameter calculates first spatial cache;Size according to first spatial cache is decoded to the first audio file Processing, obtains the first played file.
It should be noted that the embodiments of the invention provide in a kind of computer-readable storage medium, it is one or more of Program can be by one or more computing device, to realize the method described in embodiment one and embodiment two.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program Product.Therefore, the shape of the embodiment in terms of the present invention can use hardware embodiment, software implementation or combine software and hardware Formula.Moreover, the present invention can be used can use storage in one or more computers for wherein including computer usable program code The form for the computer program product that medium is implemented on (including but is not limited to magnetic disk storage and optical memory etc.).
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.

Claims (10)

1. a kind of audio-frequency processing method, it is characterised in that including:
Audio playing request is received, the audio playing request is used to ask to play the first audio file;
The audio playing request is responded, the first file type of first audio file is parsed;
When first file type is not stored in mapping table of the default file type with caching, first sound is parsed The acoustic characteristic parameter of frequency file, and first spatial cache is calculated according to the acoustic characteristic parameter;
Decoding process is carried out to the first audio file according to the size of first spatial cache, the first played file is obtained.
2. according to the method described in claim 1, it is characterised in that the acoustic characteristic for parsing first audio file Parameter, and first spatial cache is calculated according to the acoustic characteristic parameter included:
Parse sample frequency, sampling resolution and the channel number of first audio file;
According to the sample frequency, the sampling resolution, the channel number and default sampling time, the first audio text is calculated The audio frame number evidence of part;
According to the audio frame number evidence and Preset Transfer frame number, first spatial cache of first audio file is calculated.
3. method according to claim 1 or 2, it is characterised in that described that institute is calculated according to the acoustic characteristic parameter State after the first spatial cache, methods described also includes:
By first spatial cache and the corresponding relation of first file type record in the default file type with delaying In the mapping table deposited.
4. according to the method described in claim 1, it is characterised in that first file for parsing first audio file After type, and the size according to first spatial cache carries out decoding process to the first audio file, obtains first Before played file, methods described also includes:
When first file type has been stored in mapping table of the default file type with caching, from the default file class Type finds out first spatial cache corresponding with first file type with the mapping table cached.
5. according to the method described in claim 1, it is characterised in that before the response audio playing request, the side Method also includes:
Detect whether to open self-adaption of decoding function;
Accordingly, the response audio playing request, including:
The self-adaption of decoding function has been had turned on if detecting, the audio playing request is responded.
6. according to the method described in claim 1, it is characterised in that the size according to first spatial cache is to first Audio file carries out decoding process, obtains after the first played file, methods described also includes:
Play first played file.
7. a kind of terminal, it is characterised in that including:Receiver, memory, processor and communication bus, it is the receiver, described Memory and the processor are connected by the communication bus;
The receiver is used to receive audio playing request, and the audio playing request is used to ask to play the first audio file;
The memory be used to the being stored with processor-executable instruction or audio frequency process relative program, the receiver connects The data of receipts;
The processor is used for the audio frequency process relative program for calling the memory storage, and performs following steps:
The audio playing request is responded, the first file type of first audio file is parsed;When first file When type is not stored in default file type with the mapping table of caching, the acoustic characteristic ginseng of first audio file is parsed Number, and first spatial cache is calculated according to the acoustic characteristic parameter;According to the size pair of first spatial cache First audio file carries out decoding process, obtains the first played file.
8. terminal according to claim 7, it is characterised in that the processor is additionally operable to perform the audio frequency process correlation Program, specifically performs following steps:
Parse sample frequency, sampling resolution and the channel number of first audio file;According to the sample frequency, described adopt Sample digit, the channel number and default sampling time, calculate the audio frame number evidence of first audio file;According to the audio Frame data and Preset Transfer frame number, calculate first spatial cache of first audio file.
9. terminal according to claim 7, it is characterised in that the terminal also includes:Player, the player, institute Receiver, the memory and the processor is stated to connect by the communication bus;The memory is broadcast described in being also stored with The audio frequency process playing program of device broadcasting is put, the player calls the audio frequency process playing program of the memory storage, held The following operation of row:
Play first played file.
10. a kind of computer-readable recording medium, it is characterised in that the computer-readable recording medium storage have one or Multiple programs, one or more of programs can be by one or more computing device, to realize following steps:
Audio playing request is obtained, the audio playing request is used to ask to play the first audio file;The audio is responded to broadcast Request is put, the first file type of first audio file is parsed;When first file type is not stored in default text When part type is with the mapping table of caching, the acoustic characteristic parameter of first audio file is parsed, and according to the audio Characterisitic parameter calculates first spatial cache;Size according to first spatial cache is solved to the first audio file Code processing, obtains the first played file.
CN201710291381.7A 2017-04-28 2017-04-28 A kind of audio-frequency processing method, terminal and storage medium Pending CN107105096A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710291381.7A CN107105096A (en) 2017-04-28 2017-04-28 A kind of audio-frequency processing method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710291381.7A CN107105096A (en) 2017-04-28 2017-04-28 A kind of audio-frequency processing method, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN107105096A true CN107105096A (en) 2017-08-29

Family

ID=59657889

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710291381.7A Pending CN107105096A (en) 2017-04-28 2017-04-28 A kind of audio-frequency processing method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN107105096A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium
CN109830243A (en) * 2019-01-30 2019-05-31 腾讯科技(深圳)有限公司 Sound effect treatment method, device and computer equipment
CN111339351A (en) * 2018-12-19 2020-06-26 成都鼎桥通信技术有限公司 Audio playing method in Android system
CN111601144A (en) * 2020-05-19 2020-08-28 青岛海信传媒网络技术有限公司 Streaming media file playing method and display equipment
CN112579034A (en) * 2019-09-29 2021-03-30 成都鼎桥通信技术有限公司 Audio playing method and device
CN113129861A (en) * 2019-12-30 2021-07-16 华为技术有限公司 Text-to-speech processing method, terminal and server
CN114783452A (en) * 2022-06-17 2022-07-22 荣耀终端有限公司 Audio playing method, device and storage medium
WO2023036092A1 (en) * 2021-09-13 2023-03-16 北京字跳网络技术有限公司 Audio playback method and device
CN116112736A (en) * 2022-12-09 2023-05-12 上海鱼尔网络科技有限公司 Audio processing method, device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1564243A (en) * 2004-04-07 2005-01-12 杭州斯达康通讯有限公司 Method of synthetic chord ringing of cell phone
KR100662261B1 (en) * 1999-05-12 2007-01-02 엘지전자 주식회사 Mobile terminal for storaging audio data and Method for playing the audio data using the same
CN102724584A (en) * 2012-06-18 2012-10-10 Tcl集团股份有限公司 Method and device for playing network videos online and smart television
CN106131332A (en) * 2016-06-30 2016-11-16 维沃移动通信有限公司 A kind of audio-frequency inputting method and mobile terminal
CN106385621A (en) * 2016-09-12 2017-02-08 猫范(北京)科技有限公司 Intelligent device control method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100662261B1 (en) * 1999-05-12 2007-01-02 엘지전자 주식회사 Mobile terminal for storaging audio data and Method for playing the audio data using the same
CN1564243A (en) * 2004-04-07 2005-01-12 杭州斯达康通讯有限公司 Method of synthetic chord ringing of cell phone
CN102724584A (en) * 2012-06-18 2012-10-10 Tcl集团股份有限公司 Method and device for playing network videos online and smart television
CN106131332A (en) * 2016-06-30 2016-11-16 维沃移动通信有限公司 A kind of audio-frequency inputting method and mobile terminal
CN106385621A (en) * 2016-09-12 2017-02-08 猫范(北京)科技有限公司 Intelligent device control method and device

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium
CN111339351B (en) * 2018-12-19 2023-08-11 成都鼎桥通信技术有限公司 Audio playing method in Android system
CN111339351A (en) * 2018-12-19 2020-06-26 成都鼎桥通信技术有限公司 Audio playing method in Android system
CN109830243A (en) * 2019-01-30 2019-05-31 腾讯科技(深圳)有限公司 Sound effect treatment method, device and computer equipment
CN109830243B (en) * 2019-01-30 2021-01-12 腾讯科技(深圳)有限公司 Sound effect processing method and device and computer equipment
CN112579034A (en) * 2019-09-29 2021-03-30 成都鼎桥通信技术有限公司 Audio playing method and device
CN113129861A (en) * 2019-12-30 2021-07-16 华为技术有限公司 Text-to-speech processing method, terminal and server
CN111601144A (en) * 2020-05-19 2020-08-28 青岛海信传媒网络技术有限公司 Streaming media file playing method and display equipment
WO2021232558A1 (en) * 2020-05-19 2021-11-25 青岛海信传媒网络技术有限公司 Streaming media file playing method and display device
CN111601144B (en) * 2020-05-19 2021-10-08 青岛海信传媒网络技术有限公司 Streaming media file playing method and display equipment
WO2023036092A1 (en) * 2021-09-13 2023-03-16 北京字跳网络技术有限公司 Audio playback method and device
CN114783452A (en) * 2022-06-17 2022-07-22 荣耀终端有限公司 Audio playing method, device and storage medium
CN116112736A (en) * 2022-12-09 2023-05-12 上海鱼尔网络科技有限公司 Audio processing method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107105096A (en) A kind of audio-frequency processing method, terminal and storage medium
CN107341212A (en) A kind of buffering updating method and equipment
CN108536481A (en) A kind of application program launching method, mobile terminal and computer storage media
CN107967322A (en) Document classification display methods, mobile terminal and computer-readable recording medium
CN107038245A (en) Page switching method, mobile terminal and storage medium
CN107659688A (en) A kind of method, screen mounting structure and mobile terminal for increasing front panel accounting
CN107592415A (en) Voice transmitting method, terminal and computer-readable recording medium
CN107257510A (en) Video unifies player method, terminal and computer-readable recording medium
CN108418948A (en) A kind of based reminding method, mobile terminal and computer storage media
CN107800879A (en) A kind of audio regulation method, terminal and computer-readable recording medium
CN109165004A (en) Double screen terminal audio frequency output method, terminal and computer readable storage medium
CN108600516A (en) Collecting method, mobile terminal and computer readable storage medium
CN107423389A (en) A kind of webpage reduced graph generating method, device and computer-readable recording medium
CN107911536A (en) A kind of across application program access method, equipment and computer-readable recording medium
CN107682421A (en) Access method, server, terminal and the computer-readable recording medium of message
CN107493396A (en) Button screen method, terminal and computer-readable recording medium
CN107635083A (en) The tinkle of bells method to set up, mobile terminal and readable storage medium storing program for executing
CN107480054A (en) A kind of call chain data processing method, equipment and computer-readable recording medium
CN107608727A (en) A kind of display methods of application program, mobile terminal and storage medium
CN110069458A (en) Method, equipment and the storage medium of invalid resource in a kind of deletion Android system
CN107566295A (en) A kind of data traffic reminding method, browser and computer-readable recording medium
CN108306856A (en) A kind of interface merging method, client, server and computer readable storage medium
CN108040116A (en) Information push method, router and computer-readable recording medium
CN107231469A (en) A kind of terminal applies management method, terminal and computer-readable recording medium
CN108616646A (en) A kind of sound control method, equipment and computer readable storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170829