Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default MIDI sound playback

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default MIDI sound playback

When I responded to your post:

Have you tried playing the file with media player or similar? (To make sure
the sound isn't set to mute or the volumn is turned down.)


You said it was playing OK from the media player. Guess you didn't really
test that file??

--
Regards,
Tom Ogilvy



"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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default MIDI sound playback

Tom, I still cannot explain that. I did use Windows Media player to play the
midi files. But they would not play when executed through code. That is why
I did not think to look at the volume control settings. What I did not know
is that the SW Synthesizer is specifically for the midi files. But you can
bet I won't forget it now. Thanks for your responses, they kept me looking
for the cause of the problem.

"Tom Ogilvy" wrote:

When I responded to your post:

Have you tried playing the file with media player or similar? (To make sure
the sound isn't set to mute or the volumn is turned down.)


You said it was playing OK from the media player. Guess you didn't really
test that file??

--
Regards,
Tom Ogilvy



"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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default MIDI sound playback

Can't explain the Media Player working, unless it does not use the Windows
SW Synthesizer, but the rest makes sense; MIDI files do not contain any
sound as such, but the instructions of how to play the various "instruments"
to recreate the sound, whereas .wav contain a representation of the actual
sound that is just rendered through the speaker. Kind of like the difference
between emf/wmf and bitmaps files.

NickHK

"JLGWhiz" wrote in message
...
Tom, I still cannot explain that. I did use Windows Media player to play

the
midi files. But they would not play when executed through code. That is

why
I did not think to look at the volume control settings. What I did not

know
is that the SW Synthesizer is specifically for the midi files. But you

can
bet I won't forget it now. Thanks for your responses, they kept me

looking
for the cause of the problem.

"Tom Ogilvy" wrote:

When I responded to your post:

Have you tried playing the file with media player or similar? (To make

sure
the sound isn't set to mute or the volumn is turned down.)


You said it was playing OK from the media player. Guess you didn't

really
test that file??

--
Regards,
Tom Ogilvy



"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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
adjusting timing on text to speech playback in excel Daniel Velasquez New Users to Excel 0 October 3rd 08 04:46 PM
Voice Playback LBuser Excel Discussion (Misc queries) 0 June 13th 08 11:43 PM
Simple recorded macro crashes on playback. Why? Paul Excel Programming 1 November 9th 05 07:58 PM
Qn: Sound in MsgBox?? Michael Vaughan Excel Programming 2 August 18th 04 08:24 PM


All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"