Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Adjust Audio Volume

How can I adjust audio volume (for wav, MIDI, mp3 files) from within Excel ?

What declarations and functions would I need ?

Thanks,
AP


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Adjust Audio Volume

On Thu, 22 Jun 2006 21:31:05 +1200, AP wrote:

How can I adjust audio volume (for wav, MIDI, mp3 files) from within Excel ?


For wav:

Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer,
ByVal dwVolume As Long) As Integer
Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer,
dwVolume As Long) As Integer

Public Function GetVolume()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
GetVolume = CLng(tmp)
End Function

Public Function SetVolume(vol As Long)
Dim a, i As Long
Dim tmp As String
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Function

For other devices, look at the examples in ApiGuide.

--
PL
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
How do I set up an audio alert in excel? Vicelike Excel Discussion (Misc queries) 2 February 25th 10 06:26 PM
x log, y lin audio frequency chart Jim Charts and Charting in Excel 3 December 27th 07 04:15 PM
Audio file in Excel Maurice Excel Discussion (Misc queries) 1 October 3rd 07 06:25 PM
Playing audio, but not from the start Natalie Excel Programming 3 May 23rd 06 12:59 PM
turn on audio in excel Linda Excel Discussion (Misc queries) 1 March 20th 06 05:04 PM


All times are GMT +1. The time now is 04:05 AM.

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"