|
-
Dec 5th, 2010, 06:15 PM
#1
Thread Starter
Frenzied Member
DirectX Audio set volume errors
This is a program I wrote few years ago. always worked fine.
formatted and reinstalled Win7, .NET 2003, etc this weekend and now the program finds error anywhere I try to set the volume on audio playback
References have been made, code:
Imports Microsoft.DirectX
Imports Microsoft.DirectX.DirectInput
Imports Microsoft.DirectX.AudioVideoPlayback
Imports Microsoft.DirectX.DirectSound
Dim Music as Audio = Nothing
The old code read:
Music = New Audio (........)
Music.Volume = -1000 'the error is here
I went through the code and remmed all .Volume lines and the program works fine, music included.
Some change in DirectX? Change in Win7? I don't recall ever getting this running on Win7 before, but this format/reinstall was the first time I went back into the source code.
Right now the app works, but the question is, how can I set the volume?
Setting volume is a user option when the app is running.
Thanks.
G
Wen Gang, Programmer
VB6, QB, HTML, ASP, VBScript, Visual C++, Java
-
Aug 6th, 2013, 07:38 AM
#2
New Member
Re: DirectX Audio set volume errors
This thread is almost the only one that talk about this problem with directX and VB.Net
The code line that get me the error is
vAudio.Volume = -5000
where vAudio = videoMedia.Audio and videoMedia = New Video(videoPath)
I tried with videoMedia.Audio.Volume = -5000, and it get me to the very same error
I got the very same problem, which return an "Error in the application. -2147467263 (E_NOTIMPL) at Microsoft.DirectX.AudioVideoPlayback.Audio.set_Volume(Int32 value)" when launch without debugger, and "Error in the application" when catch in a try.
Can someone answer this "old" post, since it's the first one on Google result with "vb.net directx audio set volume error"
-
Aug 6th, 2013, 08:51 AM
#3
New Member
Re: DirectX Audio set volume errors
I have found the problem with the Audio definition.
You cannot set the volume if the audio media is not already playing.
I hope this can help other people.
Last edited by drakray; Aug 6th, 2013 at 09:37 AM.
-
Aug 6th, 2013, 09:35 AM
#4
New Member
Re: DirectX Audio set volume errors
Code is:
aMedia.Play
aMedia.Volume = -5000 ' no error
But even if the video media IS playing, you get an error when you try to set its Volume.
Code is:
vMedia.Play
vMedia.Audio.Volume = -5000 ' "Error in the application" here
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|