Because there are some beginners VB6 has not been used, so I have in the source code for each sentence is commented.
First, add the controls as follows:
Add three button controls, write the following code:
Imports System.ComponentModel ' Reference family name System.ComponentModel
Imports system.drawing ' Reference family name System.Drawing
Imports system.winforms ' Reference family name System.WinForms
' The purpose of referencing a family name is not to write a family name when calling his subclass, as System.Drawing.Color writes a color
Public Class Form1
Inherits System.WinForms.Form ' Inherits is inherited from an existing class and gets the method defined by this class
Public Sub New ()
MyBase.New () ' MyBase refers to the parent class MyBase.New is the new procedure to invoke the parent class, new is to create an object, the object is memory, the class is not memory
Form1 = Me ' so the following Me keyword is identified as Form1
InitializeComponent () ' The following code is the initialization action that is performed when a new Form1 instance is created
Call Me_load () ' This is a custom child process
End Sub
' Form overrides dispose to clean up the component list.
Overrides public Sub Dispose ()
Axmmcontrol1.command = "Close" Closes the sound resource, and this code must be placed in front of the dispose process
Mybase.dispose () ' Dispose is clear object
Components. Dispose () ' Empty the component
End Sub
' The following code is a description of the attribute, which is generated by the system, and not arbitrarily modified
#Region "Windows Form Designer generated code"
' Required by the Windows Form Designer
Private Components as System.ComponentModel.Container
Private WithEvents Button3 as System.WinForms.Button
Private WithEvents Button2 as System.WinForms.Button
Private WithEvents Button1 as System.WinForms.Button
Private WithEvents AxMMControl1 as Axmci.axmmcontrol
Dim WithEvents Form1 as System.WinForms.Form
' Note:the following procedure is required by the Windows Form Designer
' It can be modified using the ' Windows Form Designer.
' Do not modify it using the ' Code Editor.
Private Sub InitializeComponent ()
Dim resources as System.Resources.ResourceManager = New System.Resources.ResourceManager (GetType (FORM1))
Me.components = New System.ComponentModel.Container ()
Me.button1 = New System.WinForms.Button ()
Me.axmmcontrol1 = New Axmci.axmmcontrol ()
Me.button3 = New System.WinForms.Button ()
Me.button2 = New System.WinForms.Button ()
Axmmcontrol1.begininit ()
' @design me.trayheight = 0
' @design Me.traylargeicon = False
' @design Me.trayautoarrange = True
Button1.location = New System.Drawing.Point (8, 8)
Axmmcontrol1.size = New System.Drawing.Size (236, 33)
Axmmcontrol1.location = New System.Drawing.Point (32, 56)
Button3.location = New System.Drawing.Point (208, 8)
Button3.size = New System.Drawing.Size (80, 32)
Button3.tabindex = 3
Button3.text = "Button3"
Button2.location = New System.Drawing.Point (104, 8)
Button2.size = New System.Drawing.Size (88, 32)
Button2.tabindex = 2
Button2.text = "Button2"
Me.Text = "Form1"
Me.autoscalebasesize = New System.Drawing.Size (6, 14)
Me.clientsize = New System.Drawing.Size (296, 29)
ME.CONTROLS.ADD (Button3)
ME.CONTROLS.ADD (Button2)
ME.CONTROLS.ADD (Button1)
ME.CONTROLS.ADD (AXMMCONTROL1)
Axmmcontrol1.endinit ()
End Sub
#End Region
' The code above is a description of the attribute, which is generated by the system, not arbitrarily modified
Protected Sub button1_click (ByVal sender as Object, ByVal e as System.EventArgs)
Axmmcontrol1.from = 8815 ' starting from 3000 milliseconds
axmmcontrol1.to = 15624 ' End from 6000 milliseconds
Axmmcontrol1.command = "Play" ' playing '
End Sub
Protected Sub button3_click (ByVal sender as Object, ByVal e as System.EventArgs)
Me.dispose () ' calls Dispose to exit the program, releasing the resource that is occupied
End Sub
Protected Sub Form1_Click (ByVal sender as Object, ByVal e as System.EventArgs)
End Sub
Protected Sub button2_click (ByVal sender as Object, ByVal e as System.EventArgs)
Axmmcontrol1.from = 0 ' starting from 0 milliseconds
axmmcontrol1.to = 8815 ' End from 3000 milliseconds
Axmmcontrol1.command = "Play" ' playing '
End Sub
Protected Sub Axmmcontrol1_oledragdrop (ByVal sender as Object, ByVal e as Axmci.dmcievents_oledragdropevent)
End Sub
Public Sub Me_load ()
Me.backcolor = color. Blanchedalmond ' Change background color to Blanchedalmond
Me.borderstyle = Formborderstyle.none ' Change form border to none, no title bar
Button1. Text = "Play Upper segment": Button2. Text = "Play Next paragraph": Button3. Text = "Exit program"
Axmmcontrol1.timeformat = 0
Axmmcontrol1.devicetype = "Waveaudio" defines play *.wav format
Axmmcontrol1.filename = System.WinForms.Application.StartUpPath & "\" & "Muli.wav" ' Loading file, System.WinForms.Application.StartUpPath is the meaning of the current directory
Axmmcontrol1.command = "Open" opens the loaded file
Axmmcontrol1.visible = False ' makes the control invisible, working in the background
End Sub
End Class
As for the beginning of a few milliseconds to the end of a few milliseconds, is the use of different sound files such as acoustica.exe voice editing program into a file, remember to use Windows Recorder first recorded, so that the resulting file is small, some noise, blank cut off, this is very small.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.