Click here to Skip to main content
15,918,404 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Triggering Event - Access Form Pin
Mike the Red14-Feb-05 8:22
Mike the Red14-Feb-05 8:22 
GeneralHi Mike Red & Dave Pin
FuzMic14-Feb-05 19:30
FuzMic14-Feb-05 19:30 
GeneralVb Reading from Excel Pin
greg 77713-Feb-05 18:58
greg 77713-Feb-05 18:58 
GeneralRich Text Field - Background Pin
TomVerkaaik13-Feb-05 17:26
TomVerkaaik13-Feb-05 17:26 
GeneralConnecting scanner Pin
Avanti Dharkar13-Feb-05 0:52
Avanti Dharkar13-Feb-05 0:52 
GeneralRe: Connecting scanner Pin
H@is@here18-Feb-05 10:14
H@is@here18-Feb-05 10:14 
GeneralRe: Connecting scanner Pin
Avanti Dharkar19-Feb-05 3:52
Avanti Dharkar19-Feb-05 3:52 
QuestionCan some Help me with this over kill i know but ? Pin
Delo12-Feb-05 20:42
Delo12-Feb-05 20:42 
OK this one has me baffled I just got done writing this program, and I only had a few typos corrected them. The program now starts up and run just fine, but it does not play the wav sounds. I have a textbox and two buttons, btnbrowse and btnplay I'm supposed to be able to browse through my hard drive, find a wav sound and then play it, could someone help me with this please. Thank you Confused | :confused: D'Oh! | :doh:

----------------------------------------------------------------------------

Sniff | :^)
Option Strict Off
Option Explicit On
Module modauto
Sub LoadFile(ByRef inFile As String)
Dim hmem As Integer
Dim mmckinfoparentIn As MMCKINFO
Dim mmckinfosubchunkIn As MMCKINFO
Dim hmmioIn As Integer
Dim mmioinf As mmioinfo

mmioinf.adwInfo = Space(4)
hmmioIn = mmioOpen(inFile, mmioinf, MMIO_READ)
If hmmioIn = 0 Then Exit Sub
mmioDescendparent(hmmioIn, mmckinfoparentIn, 0, MMIO_FINDRIFF)
mmckinfosubchunkIn.CKID = mmioStringToFOURCC("fmt", 0)
mmioDescend(hmmioIn, mmckinfosubchunkIn, mmckinfoparentIn, MMIO_FINDCHUNK)
mmioReadFormat(hmmioIn, format_wave, Len(format_wave))
mmioAscend(hmmioIn, mmckinfosubchunkIn, 0)
mmckinfosubchunkIn.CKID = mmioStringToFOURCC("data", 0)
mmioDescend(hmmioIn, mmckinfosubchunkIn, mmckinfoparentIn, MMIO_FINDCHUNK)
GlobalLock(hmem)
hmem = GlobalAlloc(&H40S, mmckinfosubchunkIn.cksize)
bufferin = GlobalFree(hmem)
mmioRead(hmmioIn, bufferin, mmckinfosubchunkIn.cksize)
numSamples = mmckinfosubchunkIn.cksize / format_wave.nBlockAlign
mmioClose(hmmioIn, 0)
End Sub
Sub play(ByVal soundcard As Short)
Dim rc As Integer
Dim lFlags As Integer
lFlags = Callback_Function
If soundcard <> -1 Then lFlags = lFlags Or WAVE_MAPPED
rc = waveOutOpen(hwaveout, soundcard, format_wave, 0, 0, lFlags)
If (rc <> 0) Then Exit Sub
outhdr.lpData = bufferin
outhdr.dwBufferLenght = numsamples * format_wave.nBlockAlign
outhdr.dwFlags = 0
outhdr.dwLoops = 0
waveOutPrepareHeader(hwaveout, outhdr, Len(outhdr))
waveOutWrite(hwaveout, outhdr, Len(outhdr))
End Sub

Public whdr As WAVEHDR
Public format_wave As WAVEFORMAT
Public outhdr As WAVEHDR
Public bufferin As Integer
Public numsamples As Integer
Public hwaveout As Integer

Public Const MMIO_Read As Short = &H0S
Public Const Callback_Function As Integer = &H30000
Public Const WAVE_MAPPED As Short = &H4S
Public Const MMIO_FINDCHUNK As Short = &H10S
Public Const MMIO_FINDRIFF As Short = &H20S
Structure MMCKINFO
Dim CKID As Integer
Dim cksize As Integer
Dim fcctype As Integer
Dim dwdataoffset As Integer
Dim dwflags As Integer
End Structure
Structure mmioinfo
Dim dwflags As Integer
Dim fccIOproc As Integer
Dim pIOProc As Integer
Dim wErrorRet As Integer
Dim htask As Integer
Dim cchBuffer As Integer
Dim pchBuffer As String
Dim pchnext As String
Dim pchEndRead As String
Dim pchEndWrite As String
Dim lBufOffset As Integer
Dim lDiskOffset As Integer
Dim adwInfo As String
Dim dwReserved1 As Integer
Dim dwReserved2 As Integer
Dim hmmio As Integer
End Structure
Structure WAVEFORMAT
Dim wFormattag As Short
Dim nChannels As Short
Dim nSamplespersec As Integer
Dim nAvgBytespersec As Integer
Dim nBlockAlign As Short
Dim wBitsPerSample As Short
Dim cbSize As Short
End Structure
Structure WAVEHDR
Dim lpData As Integer
Dim dwBufferLenght As Integer
Dim dwBytesRecorded As Integer
Dim dwUser As Integer
Dim dwFlags As Integer
Dim dwLoops As Integer
Dim lpNext As Integer
Dim Reserved As Integer
End Structure
Declare Function waveOutWrite Lib "winmm.dll" (ByVal hWaveout As Integer, ByRef lpWaveoutHdr As WAVEHDR, ByVal uSize As Integer) As Integer

Declare Function waveOutPrepareHeader Lib "winmm.dll" (ByVal hWavein As Integer, ByRef lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer

Declare Function mmioRead Lib "winmm.dll" (ByVal hmmio As Integer, ByVal pch As Integer, ByVal cch As Integer) As Integer

Declare Function waveOutOpen Lib "winmm.dll" (ByRef lphWaveIn As Integer, ByVal uDeviceID As Integer, ByRef lpFormat As WAVEFORMAT, ByVal dwCALLBACK As Integer, ByVal dwInstance As Integer, ByVal dwFlags As Integer) As Integer

Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Integer, ByVal dwBytes As Integer) As Integer

Declare Function GlobalLock Lib "kernel32" (ByVal hmem As Integer) As Integer

Declare Function mmioAscend Lib "winmm.dll" (ByVal hmmio As Integer, ByRef lpck As MMCKINFO, ByVal uFlags As Integer) As Integer

Declare Function GlobalFree Lib "kernel32" (ByVal hmem As Integer) As Integer

Declare Function mmioOpen Lib "winmm.dll" Alias "mmioOpenA" (ByVal szFileName As String, ByRef lpmmioinfo As mmioinfo, ByVal dwOpenFlags As Integer) As Integer

Declare Function mmioDescendparent Lib "winmm.dll" Alias "mmioDescend" (ByVal hmmio As Integer, ByRef lpck As MMCKINFO, ByVal x As Integer, ByVal uFlags As Integer) As Integer

Declare Function mmioReadFormat Lib "winmm.dll" Alias "mmioRead" (ByVal hmmio As Integer, ByRef pch As WAVEFORMAT, ByVal cch As Integer) As Integer

Declare Function mmioClose Lib "winmm.dll" (ByVal hmmio As Integer, ByVal uFlags As Integer) As Integer

Declare Function mmioStringToFOURCC Lib "winmm.dll" Alias "mmioStringToFOURCCA" (ByVal sz As String, ByVal uFlags As Integer) As Integer

Declare Function mmioDescend Lib "winmm.dll" (ByVal hmmio As Integer, ByRef lpck As MMCKINFO, ByRef lpckparent As MMCKINFO, ByVal uFlags As Integer) As Integer
End Module
AnswerRe: Can some Help me with this over kill i know but ? Pin
Dave Kreskowiak13-Feb-05 17:27
mveDave Kreskowiak13-Feb-05 17:27 
QuestionHow to call a procedure Pin
Mekong River12-Feb-05 16:23
Mekong River12-Feb-05 16:23 
AnswerRe: How to call a procedure Pin
mm_chanakaya12-Feb-05 16:33
mm_chanakaya12-Feb-05 16:33 
GeneralRe: How to call a procedure Pin
Mekong River13-Feb-05 3:15
Mekong River13-Feb-05 3:15 
AnswerRe: How to call a procedure Pin
rwestgraham12-Feb-05 17:53
rwestgraham12-Feb-05 17:53 
GeneralRe: How to call a procedure Pin
Mekong River13-Feb-05 3:14
Mekong River13-Feb-05 3:14 
Generalcutting video file Pin
mm_chanakaya12-Feb-05 8:48
mm_chanakaya12-Feb-05 8:48 
GeneralRe: cutting video file Pin
Mike the Red13-Feb-05 16:16
Mike the Red13-Feb-05 16:16 
GeneralRe: cutting video file Pin
mm_chanakaya14-Feb-05 5:57
mm_chanakaya14-Feb-05 5:57 
GeneralHelp controlling columns in datagrid Pin
Gaz@UK12-Feb-05 8:20
Gaz@UK12-Feb-05 8:20 
GeneralRe: Help controlling columns in datagrid Pin
Dave Kreskowiak14-Feb-05 4:53
mveDave Kreskowiak14-Feb-05 4:53 
GeneralRe: Help controlling columns in datagrid Pin
Gaz@UK14-Feb-05 21:38
Gaz@UK14-Feb-05 21:38 
GeneralGet Top 10 from a search engine Pin
Mohsen Saad12-Feb-05 7:37
Mohsen Saad12-Feb-05 7:37 
GeneralRe: Get Top 10 from a search engine Pin
Dave Kreskowiak13-Feb-05 5:52
mveDave Kreskowiak13-Feb-05 5:52 
GeneralRe: Get Top 10 from a search engine Pin
Mohsen Saad13-Feb-05 11:57
Mohsen Saad13-Feb-05 11:57 
GeneralRe: Get Top 10 from a search engine Pin
Dave Kreskowiak13-Feb-05 16:59
mveDave Kreskowiak13-Feb-05 16:59 
Generalconcatenating wav files Pin
gilliver12-Feb-05 5:43
gilliver12-Feb-05 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.