Last update: 22 Jan 2005 12:21:20
The algorithm that we are using to the volume normalization is based on ReplayGain , it is also being used on Winamp and XMMS For more information about ReplayGain, see http://www.replaygain.org/
Description of execution We are providing functions to enable the volume normalization during the playback or to add the volume normalization tag in the files Playback mode : There are two functions to enable volume normalization , the EnableOnTheFlyVolumeNormalization and EnableOnTheFlyVolumeNormalizationAndWriteTAG Tag generation mode : The function GenerateVolumeTag will generate and write the tag to the files
Public Function EnableOnTheFlyVolumeNormalization(Enable As Boolean) This function will enable or disable the on the fly volume normalization If Enabled = True and the file playing don't have the normalization volume tag , it will generate on the fly the value and adjust the volume level to the referred value, when the value need to be generated on the fly due to the absence of the volume tag , it will requires a few seconds depending on the speed of your processor If Enabled = True and the file playing has the volume normalization tag , it will read the information from the tag and adjust the volume level to the referred value , this mode is faster because it don't need to spend time on the generation of the value Public Function EnableOnTheFlyVolumeNormalizationAndWriteTAG(Enable As Boolean) This function will enable or disable the on the fly volume normalization and will add the volume normalization tag to the file If Enable = True and the file playing don't have the normalization volume tag , it will generate on the fly the value and adjust the volume level to the referred value, and also it will try to add the volume tag to the file , when the value need to be generated on the fly due to the absence of the volume tag , it will requires a few seconds depending on the speed of your processor If Enable = True and the file playing has the volume normalization tag , it will read the information from the tag and adjust the volume level to the referred value , this mode is faster because it don't need to spend time on the generation of the value Public Function GenerateVolumeTag(ByVal Filename As String) As Long This function will try to locate the tag on the file , if the tag exist it will return 0 , if the tag don't exist it will be generated and added to the file In case of errors the function will return a value different of 0 Valid return values : 0 - no error, tag ok 1 - file don't exist or too small 2 - cannot open file to read or write 3 - file is read only 4 - unable to generate the volume normalization value 5 - the file isnot a valid OGG Vorbis file Public Function CheckVolumeTag(ByVal filename As String) As Long This function will check whether the volume tag is available on the media file It was added in the last releases of the MP3 and OGG Vorbis controls This function will return : 0 - If the volume tag is in the media file 1 - If not available in the media file How the tag is added to the file The tag is written to the file is such a way to avoid incompatibilities with id3v1 , id3v2 and with the original method of adding tags to OGG Vorbis files It is inserted in a position on the file to avoid possible problems In case of mp3 files , the tag will be added just behind the id3v1 tag in the end of the file , if the file don't have the id3v1 tag , then the tag will be added in the end of the file The tags has 10 bytes , it start with a string "RSPTAG" plus 4 bytes to store a floating point value This floating point value is the multiplication factor to each sample in the media file , a value of 1.0 means no volume value change , a value of 2.0 means a multiplication by 2 of each sample in the file If you want to locate the tag on the file just look in the last bytes of the file If the file has id3v1 , then it will be added to the position 138 to 128 from the end of the file If the file don't have id3v1 , it will be the last 10 bytes of the file What players support this tag method Only our players have support to this tag method , this include the new versions of our OGG Vorbis OCX player and the MP3 OCX player , the other controls will have this feature in the future , and all will follow the same method The tag will only affect the playback of the modified files when playing in our controls When playing in other players the file will play like any other media file |
Home
Contact About Development Products
License Mirrors
.