English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Would you tell me all the available sound options and functions in VB, including all the objects that the VB 6.0 supports?
I have not seen much of programming with sounds in VB. I want to know everything about sounds and handling them in VB inside out.
Including the objects to record them, edit them. read them. write them, play them, integrate them, everything!!!!!

And one more thing, I am a miniature programmer of VB, still learning it. So plz direct me if possible with your help, or provide the suitable links.

2007-03-27 05:29:21 · 3 answers · asked by intensity_overwhelming 1 in Computers & Internet Programming & Design

How can I read a sound file(not play it).
I want to know the anatomy of a sound file, and change it.

2007-03-27 05:44:05 · update #1

3 answers

Here's a couple functions to get you started:

Private WithEvents p As MediaPlayer.MediaPlayer

'Place 2 Command Buttons on your form and name them "cmdPlay" and "cmdStop".
To control the volume, place a slider control on your form and 'set the Min
to -10000 (No volume) and the Max to 0 (Full Volume). Set the SelStart
Property to somewhere in the middle of your range. I've also 'placed a Label
with the caption "Volume". Now paste the following code into your project.

Private Sub cmdPlay_Click()
ButtonControl
p.Volume = Slider1.Value
'I've defined MySelection from a selected item in a listbox control
p.Open MySelection
End Sub

Private Sub cmdStop_Click()
p.Stop
ButtonControl
End Sub

Public Sub ButtonControl()
p.Stop
cmdStop.Enabled = Not cmdStop.Enabled
cmdPlay.Enabled = Not cmdPlay.Enabled
Slider1.Visible = Not Slider1.Visible
Label2.Visible = Not Label2.Visible
End Sub

Private Sub Slider1_Scroll()
p.Volume = Slider1.Value
End Sub

=======

Option Explicit
Private mfilename As String
Private mflags As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


Public Property Get filename() As String
filename = mfilename
End Property

Public Property Let filename(ByVal vnewvalue As String)
mfilename = vnewvalue
End Property

Public Property Get flags() As Long
flags = mflags
End Property

Public Property Let flags(ByVal vnewvalue As Long)
mflags = vnewvalue
End Property

Public Sub play()
Dim rc As Long
rc = sndPlaySound(mfilename, mflags)
End Sub

hope those help

**********EDIT**********

VB won't have anything like that for reading the anatomy and editing. That's too specialized.
However, if you have a program that does what you want, you can use the SHELL() function in VB to open your sound file in that program.

2007-03-27 05:48:37 · answer #1 · answered by rod 6 · 0 0

If you're not a seasoned programmer or have WIn32 Library Book handy might I suggest that you go to vbXtras.net and pick a ready made control up and stick it on your form... why re-invent the wheel, when you don't have to

2007-04-03 03:17:58 · answer #2 · answered by marketplacesoftware 4 · 0 0

Check out http://www.pscode.com for great source code samples.

2007-03-27 17:58:53 · answer #3 · answered by Richard H 7 · 0 0

fedest.com, questions and answers