CN100437480C - Method and device for fetching audio-frequency files - Google Patents
Method and device for fetching audio-frequency files Download PDFInfo
- Publication number
- CN100437480C CN100437480C CNB2006100813290A CN200610081329A CN100437480C CN 100437480 C CN100437480 C CN 100437480C CN B2006100813290 A CNB2006100813290 A CN B2006100813290A CN 200610081329 A CN200610081329 A CN 200610081329A CN 100437480 C CN100437480 C CN 100437480C
- Authority
- CN
- China
- Prior art keywords
- read
- reads
- algorithm
- audio file
- read module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
A method for fetching audio file includes storing at least one type of fetching algorithm, configuring storage address of said fetching algorithm in configuration file, obtaining storage address of fetching algorithm from configuration file and loading said fetching algorithm the utilizing loaded fetching algorithm to fetch out audio file corresponding to format type. The device used for realizing said method is also disclosed.
Description
Technical field
The present invention relates to the audio signal processing technique of smart machine, relate in particular to a kind of read method and reading device of audio file.
Background technology
Present smart machine, for example computing machine, mobile phone, personal digital assistant device (PDA) all are equipped with various application processing functions usually, the games of FYA for example, these programs may need to play sound in processing procedure.Voice data generally is stored in the audio file, and this audio file is meant certain class binary file, and the content of preservation is a voice data.As required, form when audio file is preserved has difference, and for example: some occasion needs storage space to take few file layout, and some occasion needs tonequality file layout preferably, the audio file formats that many maturations have been arranged at present, for example wav, mp3, midi, ogg etc.Wherein the document size of wav form is big, and tonequality is good, is applicable to relatively shorter audio; The midi document size is very little, generally have only 1/10th of wav, but tonequality is relatively poor; The ogg file is owing to compressing, so size is less.Need read audio file when playing sound, the audio file of different-format type need be read with the different algorithms that reads, reading algorithm and file type needs corresponding one by one.
Present a kind of method that reads audio file is: the audio frequency of only writing certain particular type in the handling procedure of smart machine reads algorithm, in the process of designing treatment program, play sound if desired, then corresponding audio files is stored as this specific audio format, wav for example perhaps converts the audio file of extended formatting to described specific form before using described handling procedure.The shortcoming of this processing mode is: because restriction can only be used a certain audio file formats, and different audio formats has the relative merits of self, is adapted at different occasions to use, and therefore this disposal route lacks dirigibility.
In order to overcome above-mentioned shortcoming, at present a kind of method that reads audio file is arranged again: directly in handling procedure, need to use the position of audio file to write the algorithm that reads of institute's corresponding types, when needs are supported a kind of new audio format, revise the algorithm that reads of above-mentioned position.Though this method possesses certain dirigibility,, increased the complexity of handling procedure, and later modification maintenance workload is also very big, cost is higher, and mistake occurs easily, does not meet modularization.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of read method of audio file, when reading audio file flexibly, reduces the complexity and the cost of handling procedure.
Another object of the present invention is to provide a kind of reading device of audio file, can when reading audio file flexibly, reduce the complexity and the cost of handling procedure equally.
In order to realize the foregoing invention purpose, main technical schemes of the present invention is:
A kind of reading device of audio file, this device comprises:
At least one read module is used to store the algorithm that reads of specific format type audio file;
The read module dispensing unit is used to dispose the memory address of described read module;
Read manager, with described read module and the relatively independent setting of read module dispensing unit, be used in start-up course, from the address that the read module dispensing unit obtains all read modules, and according to the algorithm that reads in the corresponding read module of the address loading of reading; After startup, utilize the audio file that algorithm reads corresponding Format Type that reads in the read module that is loaded.
Preferably, the described manager that reads is arranged in the processing unit that need read audio file; Described read module and read module dispensing unit are arranged on outside the described processing unit.
Preferably, described processing unit triggers the described manager that reads and starts when starting, from the address that the read module dispensing unit obtains all read modules, and according to the algorithm that reads in the corresponding read module of the address loading of reading; Described processing unit triggers the described manager that reads and discharges the read module that is loaded when end process.
Preferably, described processing unit sends to the described manager that reads with the type and the address of audio file when using audio file, read manager and in judging the read module that is loaded, exist under the situation that reads algorithm of supporting described Format Type, utilize the algorithm that reads that is loaded in the read module to read this audio file from described address.
Preferably, in described a kind of read module a kind of Format Type of corresponding stored read algorithm.
A kind of read method of audio file, this method comprises:
The audio file of A, at least a Format Type of storage read algorithm;
B, the memory address that will read algorithm are configured in the configuration file;
C, read in the handling procedure start-up course of audio file, from described configuration file, obtain the memory address that all read algorithm, and load the corresponding algorithm that reads according to the address of reading at need; After startup, utilize the audio file that algorithm reads corresponding Format Type that reads that is loaded.
Preferably, this method is applicable to the handling procedure of the smart machine that need read audio file; Described steps A and step B are independent of described handling procedure to be carried out; Described step C carries out in the operational process of described handling procedure.
Preferably, when described handling procedure finishes, further discharge the algorithm that reads that is loaded.
Preferably, utilize the concrete mode that algorithm reads the audio file of corresponding Format Type that reads that is loaded to be among the described step C: C1, described handling procedure provide the Format Type and the address information of this audio file when needs read audio file; If C2 loaded reads and have the algorithm that reads of supporting described Format Type in the algorithm, then call this and read algorithm and read this audio file from the address of described audio file.
Preferably, in configuration file, preferentially dispose the high address of reading algorithm of frequency of utilization according to frequency of utilization.
Dispensing unit among the present invention and comprise that the read module that reads algorithm is arranged on outside the processing unit of described smart machine (being handling procedure), after handling procedure starts, the described algorithm that reads is loaded, utilize the audio file that algorithm reads corresponding types that reads that loads.Like this, the user is under the prerequisite of not revising handling procedure, and that can expand or delete different audio types correspondences arbitrarily reads algorithm (read module), and the address that only needs correspondingly to increase or delete corresponding read module in the configuration file of correspondence gets final product.After handling procedure starts, can be through increasing or delete that after the processing each reads algorithm (read module) and load, thus the dynamic polytype audio file of support very neatly; Because unfixing the interpolation read algorithm when writing the handling procedure of smart machine, but directly read audio file according to the algorithm that loads, and needn't carry out the modification and the maintenance in later stage to handling procedure, therefore reduced the complexity of game processing program, reduce the workload of programming and maintenance, cost is lower.
Description of drawings
Fig. 1 is the structural drawing of audio file reading device of the present invention;
Fig. 2 is the described process flow diagram that loads read module when manager starts that reads;
Fig. 3 is the process flow diagram of the method for the invention.
Embodiment
Below by specific embodiments and the drawings the present invention is described in further details.
Smart machine of the present invention comprises computing machine, mobile phone, PDA etc., and the handling procedure that the present invention was suitable for be for need read the handling procedure that audio file carries out playback, for example master processor program of electronic game or the like.The embodiment of this paper is applied in the games of smart machine with the present invention be that the present invention will be described for example.
Fig. 1 is the structural drawing of audio file reading device of the present invention.Referring to Fig. 1, the master routine that described recreation Main Processor Unit is promptly played is mainly used in and realizes game logic, shows functions such as scene of game, and this recreation Main Processor Unit can use the audio file of various forms.Audio file reading device of the present invention comprises the read module dispensing unit, reads manager and at least one read module.Wherein: the described manager that reads is arranged in the game processing unit, and is identical with described recreation Main Processor Unit, belongs to the part of game processing unit.Described read module and read dispensing unit and then independently be arranged on outside the described game processing unit.
Read module is used for the algorithm that reads of storing audio files.For example comprise among this embodiment that wav read module (store wav and read algorithm), mp3 read module (corresponding stored has mp3 to read algorithm) and three of midi read modules (corresponding stored has midi to read algorithm) store the read module that the different-format type reads algorithm.A kind of Format Type of corresponding stored reads algorithm in described a kind of read module.How the present invention stresses dynamically to support multiple audio format types, no longer introduces for the algorithm that reads of certain concrete form.
The read module dispensing unit is used to dispose the memory address of described read module.This read module dispensing unit is a configuration file in the present embodiment, and this configuration file is open, can revise wherein configuration address according to the increase and decrease of read module.The read module configuration file of present embodiment uses the xml form, and deploy content wherein is exemplified below:
<?xml?version=″1.0″?>
<ImgLoader?Number=″3″>
<Loader ExtName=" wav " Dll=" WavLoader.dll " Describe=" loading wav file "/〉
<Loader ExtName=" mp3 " Dll=" Mp3Loader.dll " Describe=" loading mp3 file "/〉
<Loader ExtName=" midi " Dll=" MidiLoader.dll " Describe=" loading midi file "/〉
</ImgLoader>
Wherein, this document has been described and has been had the address information that three kinds of audio files read algorithm in the structural drawing shown in Figure 1 altogether, that is:
The address of the read module of " wav " form correspondence is " WavLoader.dll ";
The address of the read module of " mp3 " form correspondence is " Mp3Loader.dll ";
The address of the read module of " midi " form correspondence is " MidiLoader.dll ".
In configuration file, the address of the read module that often uses is placed on the configuration file forward part, promptly preferentially dispose the high address of reading algorithm of frequency of utilization according to frequency of utilization, can reduce the time of search like this, thereby realize dynamic optimization.
Describedly read the concrete read module that manager is in charge of every kind of audio file formats, with described read module and the relatively independent setting of read module dispensing unit, can be arranged in the game processing program, when recreation master processor program need load audio file the time, then call this and read manager and realize reading audio file.Read manager and obtain the address of read module and load described read module from described configuration file, it is by obtaining the address of read module one by one from configuration file, and which " read module " knows currently has available.
Fig. 2 is the described process flow diagram that loads read module when manager starts that reads.Referring to Fig. 2, this flow process comprises:
Trigger when step 201, the startup of recreation Main Processor Unit and read the manager startup, when reading the manager startup, from described configuration file, read the address information of described read module earlier in proper order.
Described recreation Main Processor Unit can trigger the described manager that reads and obtain the address of read module and load described read module to the buffer area from the read module dispensing unit when starting; When described recreation Main Processor Unit during, also can trigger the described manager that reads and discharge the read module information that is loaded in the described buffer zone in end process.
After having loaded described read module, the described audio file that algorithm reads corresponding Format Type that reads that reads in the read module that the manager utilization loaded, be specially: described recreation Main Processor Unit sends to the type of audio file and address information when using audio file and describedly reads manager (usually described type and address information are included in the path filename of audio file, read manager and can know the type and the address of this audio file according to the path filename, for example export the path and the filename of this audio file: d//music1.mp3, represent that then this document is the mp3 type, and address information is d//music1.mp3), read manager and judge in the read module that is loaded whether exist a read module can support described Format Type, if, then utilize the algorithm that reads in this read module to read this audio file, the audio content information that reads can be returned to the recreation Main Processor Unit afterwards from described address; Otherwise, judge and read failure.
Dispensing unit among the present invention and comprise that the read module that reads algorithm is arranged on outside the processing unit of described smart machine (being handling procedure), read module carries out information interaction by reading manager with " recreation master processor program ", thereby realizes the automatic identification of audio file.And describedly read manager and described recreation master processor program is arranged in the processing unit of recreation.Like this, the user can expand or delete the read module of different audio types correspondences arbitrarily under the prerequisite of not revising the game processing program, and the address that only need correspondingly increase or delete corresponding read module in the read module configuration file gets final product.When reading the manager startup, get final product the read module loading that is equipped with through increase or after deleting processing, thus the polytype audio file of dynamic very neatly support; Because unfixing the interpolation read algorithm in the game processing program, and needn't carry out the modification and the maintenance in later stage to the game processing program, therefore reduced the complexity of game processing program, reduces the workload of programming and maintenance, cost is lower.
For example, when the support that increases a kind of new audio file formats (is example with " ogg " audio format), can add and comprise that this kind Format Type reads the read module of algorithm, and in described configuration file, add an information:
<Loader ExtName=" ogg " Dll=" OggLoader.dll " Describe=" loading ogg file "/〉
Described in this information when meeting ogg and be extension name, used the address to read for this module of " OggLoader.dll ".
The described like this manager that reads can load the algorithm that reads of supporting the ogg type, and adopts this algorithm to read when the recreation master processor program need read the ogg audio file.
Fig. 3 is the process flow diagram of the method for the invention.Referring to Fig. 3, core technology scheme of the present invention comprises:
The audio file of step 301, at least a Format Type of storage read algorithm.
Described step 301 and step 302 are independent of described game processing program and carry out.
This step 303 is carried out in the operational process of described game processing program.Wherein, described from configuration file, obtain the memory address that reads algorithm and load describedly carry out when reading the described game processing program start of operating in of algorithm, read in the buffer zone that algorithm is carried in smart machine described; When described game processing EOP (end of program), further from described buffer zone, discharge the algorithm that reads that is loaded.
In step 303, when described recreation master processor program then passes to the described manager that reads with the Format Type and the address information of this audio file when needs read certain audio file, for example transmit the path and the filename of this audio file: d//music1.mp3, represent that then this document is the mp3 type, and address information is d//music1.mp3; Following the described manager that reads and judge whether reading of being loaded exists the algorithm that reads of supporting described Format Type (for example mp3) in the algorithm, is then to call this to read algorithm and read this audio file from the address of described audio file, otherwise, read failure.
In addition, as a kind of preferred version, in step 302, can preferentially dispose the high address of reading algorithm of frequency of utilization according to frequency of utilization, be about to the preferential position that algorithm is placed on configuration file that reads of often use, can reduce search time like this, realize dynamic optimization.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with the people of this technology in the disclosed technical scope of the present invention; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.
Claims (10)
1, a kind of reading device of audio file is characterized in that, this device comprises:
At least one read module is used to store the algorithm that reads of specific format type audio file;
The read module dispensing unit is used to dispose the memory address of described read module;
Read manager, with described read module and the relatively independent setting of read module dispensing unit, be used in start-up course, from the address that the read module dispensing unit obtains all read modules, and according to the algorithm that reads in the corresponding read module of the address loading of reading; After startup, utilize the audio file that algorithm reads corresponding Format Type that reads in the read module that is loaded.
2, device according to claim 1 is characterized in that, the described manager that reads is arranged in the processing unit that need read audio file; Described read module and read module dispensing unit are arranged on outside the described processing unit.
3, device according to claim 2, it is characterized in that, described processing unit triggers the described manager that reads and starts when starting, from the address that the read module dispensing unit obtains all read modules, and according to the algorithm that reads in the corresponding read module of the address loading of reading; Described processing unit triggers the described manager that reads and discharges the read module that is loaded when end process.
4, device according to claim 2, it is characterized in that, described processing unit sends to the described manager that reads with the type and the address of audio file when using audio file, read manager and in judging the read module that is loaded, exist under the situation that reads algorithm of supporting described Format Type, utilize the algorithm that reads that is loaded in the read module to read this audio file from described address.
According to each described device of claim 1 to 4, it is characterized in that 5, a kind of Format Type of corresponding stored reads algorithm in described a kind of read module.
6, a kind of read method of audio file is characterized in that, this method comprises:
The audio file of A, at least a Format Type of storage read algorithm;
B, the memory address that will read algorithm are configured in the configuration file;
C, read in the handling procedure start-up course of audio file, from described configuration file, obtain the memory address that all read algorithm, and load the corresponding algorithm that reads according to the address of reading at need; After startup, utilize the audio file that algorithm reads corresponding Format Type that reads that is loaded.
7, method according to claim 6 is characterized in that, this method is applicable to the handling procedure of the smart machine that need read audio file; Described steps A and step B are independent of described handling procedure to be carried out; Described step C carries out in the operational process of described handling procedure.
8, method according to claim 7 is characterized in that, when described handling procedure finishes, further discharges the algorithm that reads that is loaded.
9, method according to claim 7 is characterized in that, utilizes the concrete mode that algorithm reads the audio file of corresponding Format Type that reads that is loaded to be among the described step C:
C1, described handling procedure provide the Format Type and the address information of this audio file when needs read audio file;
If C2 loaded reads and have the algorithm that reads of supporting described Format Type in the algorithm, then call this and read algorithm and read this audio file from the address of described audio file.
10, method according to claim 6 is characterized in that, preferentially disposes the high address of reading algorithm of frequency of utilization according to frequency of utilization in configuration file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100813290A CN100437480C (en) | 2006-05-18 | 2006-05-18 | Method and device for fetching audio-frequency files |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100813290A CN100437480C (en) | 2006-05-18 | 2006-05-18 | Method and device for fetching audio-frequency files |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101075187A CN101075187A (en) | 2007-11-21 |
CN100437480C true CN100437480C (en) | 2008-11-26 |
Family
ID=38976255
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100813290A Active CN100437480C (en) | 2006-05-18 | 2006-05-18 | Method and device for fetching audio-frequency files |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100437480C (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102385864B (en) * | 2010-08-31 | 2013-07-10 | Tcl集团股份有限公司 | Audio data decoding method, device and audio player |
CN102404439A (en) * | 2010-09-14 | 2012-04-04 | 上海三旗通信科技股份有限公司 | Storage and application method for binary object code of mobile phone |
CN102737690B (en) * | 2012-07-02 | 2016-05-18 | 华为终端有限公司 | Method and terminal that music application starts |
CN104461499B (en) * | 2014-10-30 | 2017-11-07 | 广东欧珀移动通信有限公司 | The method, device and mobile terminal of default application are set |
CN105577425A (en) * | 2015-12-07 | 2016-05-11 | 浪潮通信信息系统有限公司 | Method and device for processing network management data |
CN105957542B (en) * | 2016-04-25 | 2019-03-26 | 青岛海信移动通信技术股份有限公司 | A kind of audio file editing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6366544B1 (en) * | 1999-02-09 | 2002-04-02 | Advanced Communication Design, Inc. | Universal CD player |
CN1349649A (en) * | 1999-04-30 | 2002-05-15 | 汤姆森特许公司 | Multi-format personal digital audio player |
CN1405670A (en) * | 2002-11-15 | 2003-03-26 | 清华大学 | Multi-format digital audio-frequency broadcasting device and method of loading, upgrading and adding for its algorithm |
WO2004057611A1 (en) * | 2002-12-23 | 2004-07-08 | Koninklijke Philips Electronics N.V. | Extensible disc player |
-
2006
- 2006-05-18 CN CNB2006100813290A patent/CN100437480C/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6366544B1 (en) * | 1999-02-09 | 2002-04-02 | Advanced Communication Design, Inc. | Universal CD player |
CN1349649A (en) * | 1999-04-30 | 2002-05-15 | 汤姆森特许公司 | Multi-format personal digital audio player |
CN1405670A (en) * | 2002-11-15 | 2003-03-26 | 清华大学 | Multi-format digital audio-frequency broadcasting device and method of loading, upgrading and adding for its algorithm |
WO2004057611A1 (en) * | 2002-12-23 | 2004-07-08 | Koninklijke Philips Electronics N.V. | Extensible disc player |
Also Published As
Publication number | Publication date |
---|---|
CN101075187A (en) | 2007-11-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100437480C (en) | Method and device for fetching audio-frequency files | |
CN101984410B (en) | Method and device for generating and unloading software installation package | |
CN101446903B (en) | Automatic component classification method | |
US7454673B2 (en) | Apparatus, system, and method for accessing persistent files in non-execute-in-place flash memory | |
CN101894028A (en) | Realization method and device for Linux kernel mirror image data supporting various CPUs | |
RU2432717C2 (en) | Processor-controlled device with different operating modes | |
JP2007249155A (en) | Method of managing media file and media playback apparatus | |
KR101249739B1 (en) | Method for loading java class in terminal loading Dalvik Virtual Machine, and Computer-readable recording medium for the same | |
CN101753352A (en) | Method, system for loading business single plate and main control single plate | |
KR101182534B1 (en) | terminal having a mutual calling function an API in the platform library, DSL module generating method and mutual API calling method | |
CN100573450C (en) | At the method and apparatus that has with system's executive utility of non-flash memory | |
CN102014214A (en) | Hand-held terminal powered-on/powered-off method and identification method of memory card of hand-held terminal | |
CN101770508B (en) | Data access method in mobile communication terminal and equipment thereof | |
EP1612667A2 (en) | Method and apparatus for loading an in-place executable file into a virtual machine | |
CN1979464A (en) | Method for realizing playing according to request of user in digital media player | |
JP5146729B2 (en) | Vehicle audio device | |
CN101408845B (en) | Updating method and related updating system | |
US7831965B1 (en) | Method and apparatus for facilitating intermediate linking of binary files in a virtual machine | |
EP0963655A1 (en) | A method and system for expanding the media types supported in a digital camera | |
CN102541878A (en) | Method and device for storing project file in non-linear editing | |
CN101714082A (en) | Method, device for configuring main interface in ERP system and ERP system | |
KR100808248B1 (en) | Electronic device capable of outputting audio | |
KR20070008997A (en) | Portable terminal and its method of data protection control and data emergency recovery function | |
CN101196820A (en) | Mobile phone data duplicating method and system | |
CA2622254A1 (en) | System and method for storing and managing digital content |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |