public sealed class MP3GainWrapper : IDisposable
Public NotInheritable Class MP3GainWrapper
Implements IDisposable
Dim instance As MP3GainWrapper
public ref class MP3GainWrapper sealed : IDisposable
[<SealedAttribute>]
type MP3GainWrapper =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Public Class Form1 : Inherits Form
Friend WithEvents MP3Gain As New MP3GainWrapper(".\MP3Gain.exe")
Private Sub Test() Handles MyBase.Shown
' Checks if file contains APEv2 mp3gain tag
MsgBox(MP3Gain.FileHasTagInfo("C:\File.mp3"))
' Set the global volume Gain of file to "89" db (In a scale of "0-100"),
' and preserve the datetime of file.
MP3Gain.SetGain("C:\File.mp3", gainLevel:=89, preserveDatestamp:=True)
' Apply a volume change of +5 db,
' in the curent global volume gain of file.
MP3Gain.ApplyGain("C:\File.mp3", +5)
' Apply a volume change of -5 db,
' in the curent global volume gain of file.
MP3Gain.ApplyGain("C:\File.mp3", -5)
' Apply a volume change of +10 db,
' in the curent volume gain of the Left channel of an Stereo file.
MP3Gain.ApplyChannelGain("C:\File.mp3", MP3GainChannel.Left, +10)
' Apply a volume change of -10 db,
' in the curent volume gain of the Right channel of an Stereo file.
MP3Gain.ApplyChannelGain("C:\File.mp3", MP3GainChannel.Right, -10)
' Undo all volume gain changes made in file.
MP3Gain.UndoGain("C:\File.mp3")
End Sub
Private Sub MP3Gain_Started(ByVal sender As Object, ByVal e As MP3GainStartedEventArgs) _
Handles MP3Gain.Started
ProgressBar1.Value = ProgressBar1.Minimum
Dim sb As New System.Text.StringBuilder
With sb
.AppendLine(String.Format("Started a ""{0}"" task", e.Task.ToString()))
.AppendLine(String.Format("Input file is: ""{0}""", e.File))
.AppendLine(String.Format("mp3gain process PID is: ""{0}""", DirectCast(sender, MP3GainWrapper).Process.Id))
End With
Debug.WriteLine(String.Format("Start Time: {0}", Date.Now.ToLongTimeString))
Debug.WriteLine(sb.ToString())
End Sub
Private Sub MP3Gain_Exited(ByVal sender As Object, ByVal e As MP3GainExitedEventArgs) _
Handles MP3Gain.Exited
If (e.Task <> MP3GainOperation.CheckTagInfo) Then
Dim sb As New Global.System.Text.StringBuilder
sb.AppendLine(String.Format("Finished a ""{0}"" task", e.Task.ToString()))
sb.AppendLine(String.Format("Input file is: ""{0}""", e.File))
sb.AppendLine(String.Format("mp3gain process PID is: {0}", DirectCast(sender, MP3GainWrapper).Process.Id))
If Not String.IsNullOrEmpty(e.InfoMessage) Then
sb.AppendLine(String.Format("Operation Information: {0}", e.InfoMessage))
End If
If Not String.IsNullOrEmpty(e.ErrorMessage) Then
sb.AppendLine(String.Format("Error Information: {0}", e.ErrorMessage))
End If
If e.GainLevel <> 0 Then
sb.AppendLine(String.Format("Volume gain change: {0}", CStr(e.GainLevel)))
End If
Debug.WriteLine(sb.ToString())
Debug.WriteLine(String.Format("End Time: {0}", Date.Now.ToLongTimeString))
End If
End Sub
Sub MP3Gain_ProgressUpdated(ByVal sender As Object, ByVal e As MP3GainProgressChangedEventArgs) _
Handles MP3Gain.ProgressChanged
Label1.Text = CStr(e.Percent)
ProgressBar1.Value = e.Percent
Application.DoEvents()
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
MP3GainWrapper | Initializes a new instance of the MP3GainWrapper class. |
Exists | Gets a value indicating whether the MP3Val.exe file Exists. |
FilePath | Gets the MP3Val.exe filepath. |
Process | Gets the MP3Gain.exeProcess instance. |
ApplyChannelGain(FileInfo, MP3GainChannel, Int32, Boolean) | Applies a volume gain change on the specified audio file. |
ApplyChannelGain(String, MP3GainChannel, Int32, Boolean) | Applies a volume gain change on the specified audio file. |
ApplyGain(FileInfo, Int32, Boolean) | Applies a volume gain change on the specified audio file. |
ApplyGain(String, Int32, Boolean) | Applies a volume gain change on the specified audio file. |
Dispose | Releases all the resources used by this instance. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
FileHasTagInfo(FileInfo) | Determines whether the specified file contains an APEv2 tag containing MP3Gain information. |
FileHasTagInfo(String) | Determines whether the specified file contains an APEv2 tag containing MP3Gain information. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
SetGain(FileInfo, Int32, Boolean) | Sets the global volume gain on the specified audio file. |
SetGain(String, Int32, Boolean) | Sets the global volume gain on the specified audio file. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
UndoGain(FileInfo, Boolean) | Undoes the gain changes made on the specified audio file. The audio file must contain a valid APEv2 tag generated by MP3Gain. |
UndoGain(String, Boolean) | Undoes the gain changes made on the specified audio file. The file must contain a valid APEv2 tag containing MP3Gain information. |
Exited | Event raised when the MP3Gain.exe process has exited. |
ProgressChanged | Event raised when MP3Gain.exe progress changes. |
Started | Event raised when the MP3Gain.exe process has been started. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |