You are a developer and looking for Shopware projects?
Apply Now!
RGADoriginatorLookup example
$thisfile_riff_raw_rgad_track
[
'originator'
]
= getid3_lib::
Bin2Dec
(
substr
(
$nRadioRgAdjustBitstring
, 3, 3
)
)
;
$thisfile_riff_raw_rgad_track
[
'signbit'
]
= getid3_lib::
Bin2Dec
(
substr
(
$nRadioRgAdjustBitstring
, 6, 1
)
)
;
$thisfile_riff_raw_rgad_track
[
'adjustment'
]
= getid3_lib::
Bin2Dec
(
substr
(
$nRadioRgAdjustBitstring
, 7, 9
)
)
;
$thisfile_riff_raw_rgad_album
[
'name'
]
= getid3_lib::
Bin2Dec
(
substr
(
$nAudiophileRgAdjustBitstring
, 0, 3
)
)
;
$thisfile_riff_raw_rgad_album
[
'originator'
]
= getid3_lib::
Bin2Dec
(
substr
(
$nAudiophileRgAdjustBitstring
, 3, 3
)
)
;
$thisfile_riff_raw_rgad_album
[
'signbit'
]
= getid3_lib::
Bin2Dec
(
substr
(
$nAudiophileRgAdjustBitstring
, 6, 1
)
)
;
$thisfile_riff_raw_rgad_album
[
'adjustment'
]
= getid3_lib::
Bin2Dec
(
substr
(
$nAudiophileRgAdjustBitstring
, 7, 9
)
)
;
$thisfile_riff
[
'rgad'
]
[
'peakamplitude'
]
=
$thisfile_riff_raw_rgad
[
'fPeakAmplitude'
]
;
if
(
(
$thisfile_riff_raw_rgad_track
[
'name'
]
!= 0
)
&&
(
$thisfile_riff_raw_rgad_track
[
'originator'
]
!= 0
)
)
{
$thisfile_riff
[
'rgad'
]
[
'track'
]
[
'name'
]
= getid3_lib::
RGADnameLookup
(
$thisfile_riff_raw_rgad_track
[
'name'
]
)
;
$thisfile_riff
[
'rgad'
]
[
'track'
]
[
'originator'
]
= getid3_lib::
RGADoriginatorLookup
(
$thisfile_riff_raw_rgad_track
[
'originator'
]
)
;
$thisfile_riff
[
'rgad'
]
[
'track'
]
[
'adjustment'
]
= getid3_lib::
RGADadjustmentLookup
(
$thisfile_riff_raw_rgad_track
[
'adjustment'
]
,
$thisfile_riff_raw_rgad_track
[
'signbit'
]
)
;
}
if
(
(
$thisfile_riff_raw_rgad_album
[
'name'
]
!= 0
)
&&
(
$thisfile_riff_raw_rgad_album
[
'originator'
]
!= 0
)
)
{
$thisfile_riff
[
'rgad'
]
[
'album'
]
[
'name'
]
= getid3_lib::
RGADnameLookup
(
$thisfile_riff_raw_rgad_album
[
'name'
]
)
;
$thisfile_riff
[
'rgad'
]
[
'album'
]
[
'originator'
]
= getid3_lib::
RGADoriginatorLookup
(
$thisfile_riff_raw_rgad_album
[
'originator'
]
)
;
$thisfile_riff
[
'rgad'
]
[
'album'
]
[
'adjustment'
]
= getid3_lib::
RGADadjustmentLookup
(
$thisfile_riff_raw_rgad_album
[
'adjustment'
]
,
$thisfile_riff_raw_rgad_album
[
'signbit'
]
)
;
}
}
if
(
isset
(
$thisfile_riff_WAVE
[
'fact'
]
[
0
]
[
'data'
]
)
)
{
$thisfile_riff_raw
[
'fact'
]
[
'NumberOfSamples'
]
=
$this
->
EitherEndian2Int
(
substr
(
$thisfile_riff_WAVE
[
'fact'
]
[
0
]
[
'data'
]
, 0, 4
)
)
;
$thisfile_mpeg_audio_lame_raw
[
'RGAD_track'
]
= getid3_lib::
BigEndian2Int
(
substr
(
$headerstring
,
$LAMEtagOffsetContant
+ 0xAB, 2
)
)
;
$thisfile_mpeg_audio_lame_raw
[
'RGAD_album'
]
= getid3_lib::
BigEndian2Int
(
substr
(
$headerstring
,
$LAMEtagOffsetContant
+ 0xAD, 2
)
)
;
if
(
$thisfile_mpeg_audio_lame_raw
[
'RGAD_track'
]
!= 0
)
{
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'name'
]
=
(
$thisfile_mpeg_audio_lame_raw
[
'RGAD_track'
]
& 0xE000
)
>> 13;
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'originator'
]
=
(
$thisfile_mpeg_audio_lame_raw
[
'RGAD_track'
]
& 0x1C00
)
>> 10;
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'sign_bit'
]
=
(
$thisfile_mpeg_audio_lame_raw
[
'RGAD_track'
]
& 0x0200
)
>> 9;
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'gain_adjust'
]
=
$thisfile_mpeg_audio_lame_raw
[
'RGAD_track'
]
& 0x01FF;
$thisfile_mpeg_audio_lame_RGAD_track
[
'name'
]
= getid3_lib::
RGADnameLookup
(
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'name'
]
)
;
$thisfile_mpeg_audio_lame_RGAD_track
[
'originator'
]
= getid3_lib::
RGADoriginatorLookup
(
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'originator'
]
)
;
$thisfile_mpeg_audio_lame_RGAD_track
[
'gain_db'
]
= getid3_lib::
RGADadjustmentLookup
(
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'gain_adjust'
]
,
$thisfile_mpeg_audio_lame_RGAD_track
[
'raw'
]
[
'sign_bit'
]
)
;
if
(
!
empty
(
$thisfile_mpeg_audio_lame_RGAD
[
'peak_amplitude'
]
)
)
{
$info
[
'replay_gain'
]
[
'track'
]
[
'peak'
]
=
$thisfile_mpeg_audio_lame_RGAD
[
'peak_amplitude'
]
;
}
$info
[
'replay_gain'
]
[
'track'
]
[
'originator'
]
=
$thisfile_mpeg_audio_lame_RGAD_track
[
'originator'
]
;
$info
[
'replay_gain'
]
[
'track'
]
[
'adjustment'
]
=
$thisfile_mpeg_audio_lame_RGAD_track
[
'gain_db'
]
;
}
else
{
unset
(
$thisfile_mpeg_audio_lame_RGAD
[
'track'
]
)
;
}
if
(
$thisfile_mpeg_audio_lame_raw
[
'RGAD_album'
]
!= 0
)
{
$parsedFrame
[
'peakamplitude'
]
= getid3_lib::
BigEndian2Float
(
substr
(
$parsedFrame
[
'data'
]
,
$frame_offset
, 4
)
)
;
$frame_offset
+= 4;
foreach
(
array
(
'track','album'
)
as
$rgad_entry_type
)
{
$rg_adjustment_word
= getid3_lib::
BigEndian2Int
(
substr
(
$parsedFrame
[
'data'
]
,
$frame_offset
, 2
)
)
;
$frame_offset
+= 2;
$parsedFrame
[
'raw'
]
[
$rgad_entry_type
]
[
'name'
]
=
(
$rg_adjustment_word
& 0xE000
)
>> 13;
$parsedFrame
[
'raw'
]
[
$rgad_entry_type
]
[
'originator'
]
=
(
$rg_adjustment_word
& 0x1C00
)
>> 10;
$parsedFrame
[
'raw'
]
[
$rgad_entry_type
]
[
'signbit'
]
=
(
$rg_adjustment_word
& 0x0200
)
>> 9;
$parsedFrame
[
'raw'
]
[
$rgad_entry_type
]
[
'adjustment'
]
=
(
$rg_adjustment_word
& 0x0100
)
;
}
$parsedFrame
[
'track'
]
[
'name'
]
= getid3_lib::
RGADnameLookup
(
$parsedFrame
[
'raw'
]
[
'track'
]
[
'name'
]
)
;
$parsedFrame
[
'track'
]
[
'originator'
]
= getid3_lib::
RGADoriginatorLookup
(
$parsedFrame
[
'raw'
]
[
'track'
]
[
'originator'
]
)
;
$parsedFrame
[
'track'
]
[
'adjustment'
]
= getid3_lib::
RGADadjustmentLookup
(
$parsedFrame
[
'raw'
]
[
'track'
]
[
'adjustment'
]
,
$parsedFrame
[
'raw'
]
[
'track'
]
[
'signbit'
]
)
;
$parsedFrame
[
'album'
]
[
'name'
]
= getid3_lib::
RGADnameLookup
(
$parsedFrame
[
'raw'
]
[
'album'
]
[
'name'
]
)
;
$parsedFrame
[
'album'
]
[
'originator'
]
= getid3_lib::
RGADoriginatorLookup
(
$parsedFrame
[
'raw'
]
[
'album'
]
[
'originator'
]
)
;
$parsedFrame
[
'album'
]
[
'adjustment'
]
= getid3_lib::
RGADadjustmentLookup
(
$parsedFrame
[
'raw'
]
[
'album'
]
[
'adjustment'
]
,
$parsedFrame
[
'raw'
]
[
'album'
]
[
'signbit'
]
)
;
$info
[
'replay_gain'
]
[
'track'
]
[
'peak'
]
=
$parsedFrame
[
'peakamplitude'
]
;
$info
[
'replay_gain'
]
[
'track'
]
[
'originator'
]
=
$parsedFrame
[
'track'
]
[
'originator'
]
;
$info
[
'replay_gain'
]
[
'track'
]
[
'adjustment'
]
=
$parsedFrame
[
'track'
]
[
'adjustment'
]
;
$info
[
'replay_gain'
]
[
'album'
]
[
'originator'
]
=
$parsedFrame
[
'album'
]
[
'originator'
]
;
$info
[
'replay_gain'
]
[
'album'
]
[
'adjustment'
]
=
$parsedFrame
[
'album'
]
[
'adjustment'
]
;