Embodiment
Through accompanying drawing and embodiment, technical scheme of the present invention is done further detailed description below.
Fig. 1 is the process flow diagram of embodiment of the invention volume adjusting method, and is as shown in Figure 1, and the concrete steps of embodiment of the invention volume adjusting method are following:
Step 101 reads current audio file;
Before the current audio file of player plays, at first to read current audio file.Audio file in the embodiment of the invention can be WAV format audio file, MP3 format audio file, WMA format audio file or other format audio file.
Step 102 is obtained the identifying information of this audio file from current audio file;
Concrete; When reading current audio file; Need from this audio file, obtain the identifying information of this audio file; The identifying information of audio file can be the sequence number of filename, artist, collection of records, temporal information, file size or this audio file of this audio file, and ID (Identity) waits other can discern the information of this audio file.Can current audio file and other audio file be distinguished through this identifying information.
The identifying information of the audio file of the embodiment of the invention can be an information in the above-mentioned information, and for example identifying information includes only the ID of this audio file; Identifying information also can be a plurality of information in the above-mentioned information, for example comprises a plurality of information such as filename, artist, collection of records, temporal information of audio file in the identifying information.
Step 103, the volume relative gain value of from volume relative gain value record table, inquiring about this audio file according to the identifying information of this audio file;
Concrete, in step 102, obtained the identifying information of this audio file, in volume relative gain value record table, inquire about the volume relative gain value of this audio file correspondence according to the identifying information of this audio file.
Need to prove, write down the identifying information of audio file and the volume relative gain value of this identifying information corresponding audio files in the volume gain value record table in the embodiment of the invention.For example, if the identifying information of audio file is the ID of audio file, then write down the I D volume relative gain value corresponding of audio file in the volume relative gain value record table with this ID.When having obtained the ID of current audio file, then in volume gain value record table, find the corresponding volume relative gain value of this ID, i.e. the volume relative gain value of current audio file through step 102.
Step 104 is regulated the volume gain of player according to the volume relative gain value of this audio file.
Concrete; After starting audio player; The user can be according to the player volume gain of at that time first audio file of environment set when listening to first audio file (being first audio file), and the player volume gain of this first audio file is gained as the player typical problem.
Need to prove; The user is when listening to first audio file; Player volume gain according at that time first audio file of environment set is specially; When the user during displaying audio file, can manually be provided with the player amount of volume gain of first audio file in relatively quiet environment, for example the amount of volume gain with player is set at 30%; When the user during displaying audio file, also can manually be provided with the player amount of volume gain of first audio file in the environment of relatively making a lot of noise, for example the amount of volume gain with player is set at 40%.
When passing through step 103; When in volume relative gain value record table, having obtained the volume relative gain value of current audio file, the volume relative gain value that multiply by current audio file with player typical problem gain can calculate the player volume gain of current audio file.Player can carry out volume to current audio file according to the player volume gain of the preceding audio file that calculates and regulate the back broadcast when playing current file.
Need to prove that the volume adjusting method of the embodiment of the invention need be created a volume relative gain value record table in advance.Volume relative gain value record table can be created when using the player plays audio file first, and the creation method of volume gain value record table is specially:
Displaying audio file first; When playing first audio file; Obtain the identifying information of first audio file; The volume relative gain value of first audio file is made as 1, the identifying information and the volume relative gain value of first audio file is stored in the volume relative gain value record table, the player volume gain of first audio file of setting of user is set to the gain of player typical problem simultaneously.
Need to prove that the volume relative gain value in the embodiment of the invention is the volume gain of non-first audio file to be compared with the volume gain of first audio file draw.
When playing second audio file, obtain the identifying information of second audio file, obtain the player volume gain of second audio file simultaneously.With the ratio of the player volume gain of second audio file and the gain of player typical problem volume relative gain value, and the identifying information of second audio file is stored in the volume relative gain value record table with this volume relative gain value as second audio file.
When playing the 3rd audio file, obtain the identifying information of the 3rd audio file, obtain the player volume gain of the 3rd audio file simultaneously.With the ratio of the player volume gain of the 3rd audio file and the gain of player typical problem volume relative gain value, and the identifying information of the 3rd audio file is stored in the volume relative gain value record table with this volume relative gain value as the 3rd audio file.
By that analogy, identifying information and the volume relative gain value with all audio files stores in the volume relative gain value record table one by one, promptly accomplished the constructive process of volume relative gain value record table.
The volume adjusting method of the embodiment of the invention only need be when first displaying audio file; Audio file is created volume relative gain value record table; In the process of follow-up play audio file; The user only need set the player volume gain of first audio file according to environment for use; Other audio file need not the user and adjusts according to the volume relative gain value corresponding in the volume relative gain value record table and the player volume gain of the Gain Automatic adjusting audio file of player typical problem.
Embodiment of the invention volume adjusting method has also proposed a kind of method of creating volume gain value record table, and its detailed process is following:
Displaying audio file first; When playing first audio file; Obtain the identifying information of first audio file; The volume gain value of first audio file is made as 1, the identifying information and the volume gain value of first audio file is stored in the volume gain value record table, the player volume gain of setting first audio file simultaneously is the gain of player typical problem.
During current when playing (non-first) audio file, obtain the identifying information of current audio file, obtain the player volume gain of current audio file simultaneously.The player volume gain of current audio file is compared with the gain of player typical problem; The volume relative gain value of setting current audio file if the gain of the player volume gain of current audio file and player typical problem is identical is 1, and the identifying information and the volume relative gain value of current audio file is stored in the volume gain value record table.
If the player volume gain of current audio file is different with the gain of player typical problem; Obtain the player volume gain of the previous audio file of current audio file, obtain the player volume gain of a back audio file of current audio file simultaneously.With the player volume gain of current audio file respectively at comparing with the player volume gain of previous audio file and the player volume gain of a back audio file: if the player volume gain of current audio file is greater than the player volume gain of previous audio file and greater than the player volume gain of a back audio file; Be stored in the volume relative gain value record table then with the ratio of the player volume gain of current audio file and the gain of player typical problem volume relative gain value, and with the identifying information and the volume relative gain value of current audio file as current audio file; If the player volume gain of current audio file is less than the player volume gain of previous audio file and less than the player volume gain of a back audio file; Be stored in the volume relative gain value record table then with the ratio of the player volume gain of current audio file and the gain of player typical problem volume relative gain value, and with the identifying information and the volume relative gain value of current audio file as current audio file; Otherwise the volume relative gain value of current audio file is made as 1, and the identifying information and the volume relative gain value of current audio file is stored in the volume relative gain value record table.
By that analogy, identifying information and the volume relative gain value with all audio files stores in the volume relative gain value record table one by one, promptly accomplished the constructive process of volume relative gain value record table.
The method of the establishment volume relative gain value record table of present embodiment can effectively be avoided in the constructive process of volume relative gain value record table; Take place thereby the player volume gain of adjusting audio file because of the change of environment for use causes thinking by mistake current audio file volume and first audio file volume condition of different, in the concrete analytic process as follows:
For example in the process of creating volume gain value record table; First audio file amount of volume gain is 30%; When playing second audio file; The user is transferred to the environment of a noise from a quiet environment, and the user is adjusted into 50% with the amount of volume gain of second audio file.This moment, the player volume gain increase of audio file was because the variation of external environment causes, but not because the volume of second audio file itself is little.
If will judge correctly that it is because the volume of audio file itself is different with first audio file that the player volume gain of audio file changes; Still cause because of the external environment variation; Then need the player volume gain of current audio file and the player volume gain of previous audio file and the player volume gain of a back audio file be made comparisons; If the player volume gain of current audio file is greater than the player volume gain of previous audio file, and greater than the player volume gain of a back audio file.With previous audio file the action that increases the player volume gain is arranged relatively when promptly playing current audio file; When playing a back audio file, have the action that reduces the player volume gain to explain that then the volume of current audio file itself is less, the ratio that this moment the player volume gain and the player typical problem of current audio file is gained is as the volume relative gain value of current audio file.If the player volume gain of current audio file greater than the player volume gain of previous audio file, still is equal to or less than the player volume gain of a back audio file.With previous audio file the action that increases the player volume gain is arranged relatively when promptly playing current audio file; But the player volume gain is not turned down when playing a back audio file; Not only or do not turn down on the contrary and further to have transferred the player volume gain big; Regulating the action of player volume gain this moment is that explain that the volume of current audio file itself is not little, then the volume relative gain value with current audio file is made as 1 because the variation of external environment causes.If the player volume gain of current audio file is less than the player volume gain of previous audio file, and less than the player volume gain of a back audio file.With previous audio file the action that reduces the player volume gain is arranged relatively when promptly playing current audio file; When playing a back audio file, have the action that increases the player volume gain to explain that then the volume of current audio file itself is bigger, the ratio that this moment the player volume gain and the player typical problem of current audio file is gained is as the volume relative gain value of current audio file.If the player volume gain of current audio file less than the player volume gain of previous audio file, still is equal to or greater than the player volume gain of a back audio file.With previous audio file the action that reduces the player volume gain is arranged relatively when promptly playing current audio file; But the player volume gain is transferred big when playing a back audio file; Not only or do not have accent further to reduce the player volume gain greatly on the contrary; Regulating the action of player volume gain this moment is that explain that the volume of current audio file itself is not little, then the volume relative gain value with current audio file is made as 1 because the variation of external environment causes.
Thereby; Adopt the method for above-mentioned establishment volume gain value record table effectively to avoid in the constructive process of volume gain value record table, adjust the amount of volume gain of audio file because of the change of environment for use and cause thinking by mistake that current audio file volume compares the vicissitudinous situation of first audio file volume and take place.
Need explanation to be; In use; The user may newly add audio file at any time in player; If the new audio file that adds of the current audio file person of being to use when in volume relative gain value record table, not inquiring current audio file, then need add the volume relative gain value of identifying information He this audio file of current audio file in volume relative gain value record table.Concrete interpolation process is following:
If current audio file is first audio file that reads; Then the volume relative gain value with this audio file is set at 1; And record in the volume relative gain value record table, the player volume gain with this audio file gains as the player typical problem simultaneously.
If current audio file is the non-audio file that first reads, then with the player volume gain of this audio file and the ratio of player typical problem gain, as the volume relative gain value of this audio file.
Or be; When said audio file is the non-audio file that first reads; With the player volume gain of current audio file respectively at comparing with the player volume gain of previous audio file and the player volume gain of a back audio file: if the player volume gain of current audio file is greater than the player volume gain of previous audio file and greater than the player volume gain of a back audio file, then with the ratio of the player volume gain of current audio file and the gain of the player typical problem volume relative gain value as current audio file; If the player volume gain of current audio file is less than the player volume gain of previous audio file and less than the player volume gain of a back audio file, then with the ratio of the player volume gain of current audio file and the gain of player typical problem volume relative gain value as current audio file; Otherwise the volume relative gain value of current audio file is made as 1.
The volume adjusting method of the embodiment of the invention only need be when first displaying audio file, and the information of audio file is recorded volume relative gain value record table.In the process of follow-up play audio file; The user only need set the player volume gain of first audio file according to environment for use; Other audio file is regulated the player volume gain of audio file automatically according to volume relative gain value corresponding in the volume relative gain value record table, need not the user and adjusts.
Above embodiment is for volume adjusting method of the present invention, and is same, can utilize volume adjustment device to realize.Fig. 2 is the synoptic diagram of embodiment of the invention volume adjustment device, and is as shown in Figure 2, and embodiment of the invention volume adjustment device specifically comprises: reading unit 21, acquiring unit 22, query unit 23, regulon 24.
Reading unit 21 is used to read current audio file; Acquiring unit 22 is used for obtaining from current audio file the identifying information of this audio file; Query unit 23 is used for inquiring about from volume relative gain value record table according to the identifying information of this audio file the volume relative gain value of this audio file; Regulon 24 is used for regulating the player volume gain according to the volume relative gain value of this audio file.
The volume adjustment device of the embodiment of the invention, before the current audio file of player plays, reading unit 21 at first will read current audio file.In reading the process of current audio file, acquiring unit 22 need obtain the identifying information of this audio file from this audio file, can current audio file and other audio file be distinguished through this identifying information that obtains.Behind the identifying information that has obtained current audio file, query unit 23 is inquired about the corresponding volume relative gain value of this audio file according to the identifying information of this audio file in volume relative gain value record table.After inquiring the corresponding volume relative gain value of this audio file, regulon 24 is regulated the volume gain of player according to the volume relative gain value of this audio file; Concrete, according to the corresponding volume relative gain of this audio file of query unit 23 inquiries the player volume gain that can draw current audio file with the player typical problem gain of setting on duty.Player can carry out volume to current audio file according to the player volume gain of the preceding audio file that calculates and regulate the back broadcast when playing current file.
Fig. 3 be embodiment of the invention volume adjustment device synoptic diagram two, as shown in Figure 3, embodiment of the invention volume adjustment device also comprises: create unit 31, be used to create said volume gain value record table.
The establishment unit 31 of the embodiment of the invention specifically is used for: when playing first audio file; Obtain the identifying information of first audio file; The volume relative gain value of first audio file is made as 1; The identifying information and the volume relative gain value of first audio file are stored in the volume relative gain value record table, and the player volume gain of first audio file of user's setting simultaneously is set to the gain of player typical problem.The establishment unit 31 of the embodiment of the invention specifically is used for: if said audio file is the non-audio file that first reads; Then with the player volume gain of this audio file and the ratio of player typical problem gain, as the volume relative gain value of this audio file.The establishment unit 311 of the embodiment of the invention also can specifically be used for: if said audio file is the non-audio file that first reads; And the player volume gain of said current audio file is simultaneously greater than the player volume gain of the back audio file of the previous audio file of said current audio file and said current audio file; Perhaps the player volume gain of said current audio file is simultaneously less than the player volume gain of the back audio file of the previous audio file of said current audio file and said current audio file; Then with the player volume gain of this audio file and the ratio of player typical problem gain, as the volume relative gain value of this audio file; Otherwise the volume relative gain value of this audio file is set at 1.
Fig. 4 be embodiment of the invention volume adjustment device synoptic diagram three; As shown in Figure 4; Embodiment of the invention volume adjustment device also comprises: adding device 41; Do not inquire said current audio file if be used for said volume relative gain value record table, then in said volume relative gain value record table, add the volume relative gain value of identifying information with this audio file of said current audio file.
Be first audio file that reads if adding device 41 specifically is used for said audio file, then the volume relative gain value with this audio file is set at 1, and the player volume gain of this audio file is gained as the player typical problem; If adding device 41 concrete said audio files are the non-audio file that first reads, then with the player volume gain of this audio file and the ratio of player typical problem gain, as the volume relative gain value of this audio file; If it is the non-audio file that first reads that adding device 41 also can specifically be used for said audio file; And the player volume gain of said current audio file is simultaneously greater than the player volume gain of the back audio file of the previous audio file of said current audio file and said current audio file; Then with the player volume gain of this audio file and the ratio of player typical problem gain, as the volume relative gain value of this audio file; If it is the non-audio file that first reads that adding device 41 also can specifically be used for said audio file; And the player volume gain of said current audio file is simultaneously less than the player volume gain of the back audio file of the previous audio file of said current audio file and said current audio file; Then with the player volume gain of this audio file and the ratio of player typical problem gain, as the volume relative gain value of this audio file.
The volume adjustment device of the embodiment of the invention can be mobile phone, palm PC, vehicle-mounted music player or other audio file player.The volume adjustment device of the embodiment of the invention; Read current audio file through reading unit; Acquiring unit obtains the identifying information of this audio file then; Query unit is inquired about the corresponding volume relative gain value of this audio file according to the identifying information of this audio file in volume relative gain value record table, the player volume gain that regulon is regulated this audio file according to the volume relative gain value of this audio file is play this audio file then.The volume adjustment device of the embodiment of the invention; Only need the user to set the player volume gain of first audio file according to environment for use; Just can regulate the player volume gain of the file of current audio frequency automatically according to the player volume gain and the information in the volume relative gain value record table of first audio file of setting, thereby reach the effect of automatic adjusting audio file broadcast sound volume.
The professional should further recognize; The unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein; Can realize with electronic hardware, computer software or the combination of the two; For the interchangeability of hardware and software clearly is described, the composition and the step of each example described prevailingly according to function in above-mentioned explanation.These functions still are that software mode is carried out with hardware actually, depend on the application-specific and the design constraint of technical scheme.The professional and technical personnel can use distinct methods to realize described function to each certain applications, but this realization should not thought and exceeds scope of the present invention.
The software module that the method for describing in conjunction with embodiment disclosed herein or the step of algorithm can use hardware, processor to carry out, perhaps the combination of the two is implemented.Software module can place the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or the technical field.
Above-described embodiment; The object of the invention, technical scheme and beneficial effect have been carried out further explain, and institute it should be understood that the above is merely embodiment of the present invention; And be not used in qualification protection scope of the present invention; All within spirit of the present invention and principle, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.