Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is users' Sound Volume control 'on'

Status
Not open for further replies.

SidYuca

Technical User
Nov 13, 2008
79
MX
An option available to the user is called "Talk". When called the program Speaks the name of the date in a native language.
Here is my code:

Private Sub Talk_Click()
Dim lngRC As Long

'First Play Tzolkin Coefficient
lngRC = PlaySound(SoundFile + Asnd, 0&, &H2)

'Then Say Tzolkin Day Name
lngRC = PlaySound(SoundFile + Bsnd, 0&, &H2)


Dim t0 'Pause between two dates
t0 = Timer
Do While Timer - t0 < 0.5
Loop

'Play Day
lngRC = PlaySound(SoundFile + Csnd, 0&, &H2)
'then play Month
lngRC = PlaySound(SoundFile + Dsnd, 0&, &H2)

end sub
-----------------------
All works fine for ME!! because when it doesn't work I know it is because I have my speaker volume turned off!
I deal with that by turning on the volume. Eventually the user would figure that out but I don't want him cussing me until then. I don't want to rely on written directions in the help file or to have a msgbox box pop up saying "be sure vol is on etc." each time the option is selected.

Is there a way to test for state of speaker before I issue the cmd to speak?



 
As I understand your question, you want to test whether the user is able to hear audio rather than change the volume? Turning up the volume won't help if the speakers aren't turned on and I don't think it's possible to test for that.

For example, in many office environments the PCs support audio playback but the PCs have no speakers because if they did everyone would get annoyed by the constant blips and bings produced by Windows, let alone media player.

In your shoes I think I'd simply put a visual clue on screen that audio is playing - an LED power meter for example, even if the bars on it are random - so that the user will equate the bars with audio playing and turn on the audio if it's off or muted.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Sorry for any confusion vb5prgrmr. In my case the volume is turned down not off. I'd like to consider both cases if possible. I also there are many things beyond my control or involve too much to implement.

Thanks for speaker meter/icon suggestion AndyGroom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top