<?xml version="1.0" encoding="utf-8"?>
<HmsTranscodingConfig version="2.28">
  <TranscoderList>
    <Transcoder>
      <Name>HMSMPEG</Name>
      <Path>hmsmpeg.exe</Path>
      <HomePage>http://www.ffmpeg.org/</HomePage>
      <Download></Download>
    </Transcoder>
    <Transcoder>
      <Name>HmsMPEG</Name>
      <Path>Hmsmpeg.exe</Path>
      <HomePage>http://www.ffmpeg.org/</HomePage>
      <Download></Download>
    </Transcoder>
    <Transcoder>
      <Name>hmsMPEG</Name>
      <Path>hmsmpeg.exe</Path>
      <HomePage>http://www.ffmpeg.org/</HomePage>
      <Download></Download>
    </Transcoder>
  </TranscoderList>
  <TranscodingProfileList>
    <Profile>
      <TranscoderName>HMSMPEG</TranscoderName>
      <TranscodingCondition></TranscodingCondition>
      <TranscodingConditionSyntaxType>PascalScript</TranscodingConditionSyntaxType>
      <TranscodingComment></TranscodingComment>
      <TranscodingFolder></TranscodingFolder>
      <TranscodingMediaType>1</TranscodingMediaType>
      <TranscodingMimeType></TranscodingMimeType>
      <TranscodingMimeTypeScript>var
  bWav: Boolean;
  iSampleRate, iChannels, iBitsPerSample: Integer; 
begin
  bWav := Pos(&apos;wav&apos;, cfgTranscodingAudioMimeType) &gt; 0;  
  if bWav or SameText(Copy(cfgTranscodingAudioMimeType, 1, 7), &apos;audio/L&apos;) then begin
    iChannels := mpChannels;                                     
    if iChannels &gt; cfgTranscodingLpcmMaxChannels then  
      iChannels := cfgTranscodingLpcmMaxChannels
    else if iChannels &lt; 2 then  
      iChannels := 2;
    iSampleRate   := mpAudioSampleRate;
    if iSampleRate &gt; cfgTranscodingLpcmMaxSampleRate then
      iSampleRate := cfgTranscodingLpcmMaxSampleRate      
    else if iSampleRate &gt; 96000 then    
      iSampleRate := 192000;
    iBitsPerSample := mpBitsPerSample;    
    if iBitsPerSample &gt; cfgTranscodingLpcmMaxBitsPerSample then    
      iBitsPerSample := cfgTranscodingLpcmMaxBitsPerSample
    else if iBitsPerSample &lt; 32 then
      iBitsPerSample := 24;        
    if bWav then
      MimeType := cfgTranscodingAudioMimeType    
    else
      MimeType := &apos;audio/L&apos; + IntToStr(iBitsPerSample);        
    MimeType := MimeType + Format(&apos;;rate=%d;channels=%d;bits=%d&apos;, [iSampleRate, iChannels, iBitsPerSample]) 
  end else
    MimeType := cfgTranscodingAudioMimeType      
end.</TranscodingMimeTypeScript>
      <TranscodingMimeTypeSyntaxType>PascalScript</TranscodingMimeTypeSyntaxType>
      <TranscodingMode>1</TranscodingMode>
      <TranscodingParams>
function GetSampleFormat(aBitsPerSample: Integer): string;
begin
  if aBitsPerSample &gt; 16 then  
    Result := &apos;s32&apos;    
  else  
    Result := &apos;s24&apos;
end;

function GetMetadataEx(const aParams: array of Variant): string;
var
  i, iTagsSize: Integer;  
  sPropertyValue: string;
begin
  Result := &apos;&apos;;  
  if cfgTranscodingAudioTagsSize &lt;&gt; 0 then begin
    if cfgTranscodingAudioTagsSize &gt; 0 then    
      iTagsSize := cfgTranscodingAudioTagsSize * 1024      
    else               
      iTagsSize := -1;
    Result := Format(&apos;-tags_size %d &apos;, [iTagsSize]);
    i := 0;  
    while i &lt; Length(aParams) do begin
      sPropertyValue := VarToStr(CurrentMediaItem[aParams[i]]);    
      if sPropertyValue &lt;&gt; &apos;&apos; then    
        Result := Result + Format(&apos;-metadata "%s=%s" &apos;, [aParams[i + 1], ReplaceStr(sPropertyValue, &apos;"&apos;, &apos;&apos;)]);
      Inc(i, 2)   
    end    
  end else  
    Result := &apos;-vn &apos; 
end;

function GetMetadata: string;
begin
  Result := GetMetadataEx([
     mpiTitle, &apos;title&apos;, mpiAuthor, &apos;author&apos;,  mpiAlbum, &apos;album&apos;,
     mpiYear, &apos;year&apos;,  mpiGenre, &apos;genre&apos;,  mpiTrack, &apos;track&apos;,
     mpiAuthor, &apos;artist&apos;, mpiAuthor, &apos;performer&apos;, mpiComposer, &apos;composer&apos;,
     mpiConductor, &apos;conductor&apos;, mpiAlbumArtist, &apos;album_artist&apos;, mpiPartNo, &apos;disc&apos;])     
end;

function GetTranscodingFormat: string;
begin
  if mpInternetItem then
    Result := cfgTranscodingRadioFileFormat
  else                                      
    Result := cfgTranscodingAudioFileFormat    
end;

function GetInputFormat: string;
begin
  if SameText(mpAudioCodec, &apos;MLP&apos;) then
    Result := &apos;-f mlp &apos;
  else  
    Result := &apos;&apos;
end;

function GetInputFileName: string;
begin
  if mpDvdItem then
    HmsCreateResourcePipe(Result)
  else
    Result := InputFileName;    
end;

procedure GetConfigParameters(var aChannels, aSampleRate, aBitsPerSample: Integer);
begin
  aChannels := mpChannels;                                     
  if aChannels &gt; cfgTranscodingLpcmMaxChannels then  
    aChannels := cfgTranscodingLpcmMaxChannels
  else if aChannels &lt; 2 then  
    aChannels := 2;
  aSampleRate := mpAudioSampleRate;
  if aSampleRate &gt; cfgTranscodingLpcmMaxSampleRate then
    aSampleRate := cfgTranscodingLpcmMaxSampleRate      
  else if aSampleRate &gt; 96000 then    
    aSampleRate := 192000;
  aBitsPerSample := mpBitsPerSample;    
  if aBitsPerSample &gt; cfgTranscodingLpcmMaxBitsPerSample then    
    aBitsPerSample := cfgTranscodingLpcmMaxBitsPerSample
  else if aBitsPerSample &lt; 32 then
    aBitsPerSample := 24;
end;

function ReplaceParams(const aText: string; const aParams: array of Variant): string;
var
  i: Integer;
begin
  Result := aText; i := 0;  
  while i &lt; Length(aParams) do begin
    Result := ReplaceStr(Result, aParams[i], VarToStr(aParams[i + 1]));  
    Inc(i, 2)
  end
end;

function GetOutputFormat: string;
var
  iBitsPerSample, iChannels, iSampleRate: Integer;
begin
  Result := HmsTranscodingFormatParams(GetTranscodingFormat, mtAudio);  
  GetConfigParameters(iChannels, iSampleRate, iBitsPerSample);  
  Result := ReplaceParams(Result, [&apos;[bits_per_sample]&apos;, iBitsPerSample, 
                                   &apos;[channels]&apos;, iChannels,
                                   &apos;[sample_rate]&apos;, iSampleRate,
                                   &apos;[sample_format]&apos;, GetSampleFormat(iBitsPerSample)]);
end;

var
  sTranscodingParams: string;
begin
  sTranscodingParams := Format(&apos;%s -i "%s" %s-f %s "%s"&apos;, 
      [GetInputFormat, GetInputFileName, GetMetadata, GetOutputFormat, OutputFileName]);
  TranscodingResult := HmsTranscodingExecute(&apos;HMSMPEG&apos;, sTranscodingParams)
end.</TranscodingParams>
      <TranscodingParamsSyntaxType>PascalScript</TranscodingParamsSyntaxType>
      <TranscodingProfile>Музыка - DVD-Audio</TranscodingProfile>
      <TranscodingProfileActive>-1</TranscodingProfileActive>
      <TranscodingProfilePriority>7</TranscodingProfilePriority>
      <TranscodingProfileUuid>5F1801449C8248CB82FBB8911B603E39</TranscodingProfileUuid>
    </Profile>
  </TranscodingProfileList>
</HmsTranscodingConfig>
