LAME is een library waarmee programmeurs om MP3-bestanden te coderen . LAME is open source en je kunt het gratis downloaden . De nuttige bestand is " LameLib " of " libmp3lame.dylib . " Visual Studio is een Microsoft geïntegreerde ontwikkelomgeving . U kunt gebruik maken van Visual Basic , C + + of C # met deze IDE . VB is een object -georiënteerde programmeertaal , die op grote schaal wordt gebruikt voor het maken van Windows-toepassingen , netwerk applicatie of web service applicaties . Met VB.NET , kun je ook coderen mp3-bestanden . De output zal 32 - bit gecodeerde MP3-formaat zijn . Instructies 1 Klik op " Start", selecteer " Alle programma's " en kies " Visual Studio . " Klik op "Nieuw" en selecteer " Project" om een nieuw project aan te maken . Selecteer " Visual Studio " als programmeertaal en " Windows Application ' als het type applicatie . Voer een naam voor het project . Geef een locatie voor het project bestanden . Kopen van 2 Dubbelklik op het Form1.vb . Het pad naar lame.exe via code : Dim WithEvents _lameShell als Nieuwe LameShell_lameShell.InFile = Application.StartupPath & " \\ input.mp3 " _lameShell.OutFile = Application.StartupPath & " \\ output.mp3 " _lameShell.Options = " - b 32 " _lameShell.Start ( ) 3 Voeg event handlers aan codering vooruitgang laten zien : Private Sub _lameShell_Progress ( ByRef Progress Zoals LameProgress ) _Handles _lameShell.ProgressIf pBar.Maximum < ; > Progress.FrameMax ThenpBar.Value = 0pBar.Maximum = Progress.FrameMaxElsepBar.Value = Progress.FrameCurrentEnd IflblFeedback.Text = Progress.PercentDone & " % " & " ETA : " & Progress.ETAEnd sub 4 rechtermuisknop op het project en selecteer " nieuwe klasse " tot een nieuwe klasse " Lame.vb. " Maak een nieuwe variabele ProcessStartInfo maken: Prive _startInfo als Nieuwe ProcessStartInfo_startInfo.FileName = " lame exe " _startInfo.UseShellExecute = False_startInfo.RedirectStandardOutput = True_startInfo.RedirectStandardError = True_startInfo.CreateNoWindow = True 5 Maak een Reader op de uitgang van lame.exe houden : . Private Sub LameReader ( ) Dim oneline als String_lameProcess.Start ( ) oneline = _lameProcess.StandardError.ReadLine ( ) Terwijl Niet oneline Is NothingoneLine = _lameProcess.StandardError.ReadLine ( ) End Sub WhileEnd
|