View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default MIDI sound playback

Always good when someone posts back with a solution to a problem they've had
- more help for others in the future.

"JLGWhiz" wrote:

Some time ago I posted the following code wondering why my midi files were
not playing when all indications were that they should be playing.

Public Declare Function mciExecute Lib "winmm.dll" _
(ByVal lpstrCommand As String) As Long


Sub PlayMidiFile(MidiFileName As String, Play As Boolean) 'Function for
calling midi files
If Dir(MidiFileName) = "" Then Exit Sub ' no file to play
If Play Then
mciExecute "Play " & MidiFileName ' start playing
Else
mciExecute "stop " & MidiFileName ' stop playing
End If
End Sub

With a red face, I found that they had, in fact, been playing. Bumbling
around trying to determine what catastrophic blight had struck my system, I
found something called the Microsoft GS Wavetable SW Synthesizer, which had a
volume control that was set to the bottom of the slide. When I raised the
control to the top of the slide, my midi files miraculously began to play
once again when I ran the program. Now I know that the midi and .wav files
use two different internal circuits for sound amplification. And so do you,
in case you are interested.