Unable tp play sound file in used in Code with Vista

G

Guest

Hello,
I am wrtting a program that does some sound effects... the files are stored
in a subfolder in the application folder...
and I check the existence of the files before calling the method to play the
sound.
It works perfectly well in Windows XP, but when I move my application to a
Vista machine, the sound does not play...
I used a debug statement to confirm that the files are seen in the code but
somehow it does not play...
If I use the same file in a resource it plays... here is the code used
below:

I ran it through Visual Studio 2005 debugger, and the line
debug.WriteLine(...) shows that the if statement is true but no exceptions
is thrown and the audio does not play.... Help please...
If File.Exists(Path.Combine(Application.StartupPath, VoiceSounds(index)))
Then

Debug.WriteLine("found sound...." & Path.Combine(Application.StartupPath,
VoiceSounds(index)))

My.Computer.Audio.Play(Path.Combine(Application.StartupPath,
VoiceSounds(index)), AudioPlayMode.Background)

End If



Learner...
 
Z

zacks

Hello,
I am wrtting a program that does some sound effects... the files are stored
in a subfolder in the application folder...
and I check the existence of the files before calling the method to play the
sound.
It works perfectly well in Windows XP, but when I move my application to a
Vista machine, the sound does not play...
I used a debug statement to confirm that the files are seen in the code but
somehow it does not play...
If I use the same file in a resource it plays... here is the code used
below:

I ran it through Visual Studio 2005 debugger, and the line
debug.WriteLine(...) shows that the if statement is true but no exceptions
is thrown and the audio does not play.... Help please...
If File.Exists(Path.Combine(Application.StartupPath, VoiceSounds(index)))
Then

Debug.WriteLine("found sound...." & Path.Combine(Application.StartupPath,
VoiceSounds(index)))

My.Computer.Audio.Play(Path.Combine(Application.StartupPath,
VoiceSounds(index)), AudioPlayMode.Background)

End If

Learner...

I had a similar problem with an app I wrote that plays MP3 files using
the MediaPlayer control. It didn't play any sound either. I attributed
it to a deficiency in the .NET framework 2.0. I'm guessing an upgrade
to .NET 3.0 should help, but I am waiting for the official release of
the VS.
 
G

Guest

Thank you for responding, but I do not believe it is related to .NET 2.0
deficiency since it works in windows XP environment...
It simply does not play in Vista... using same code...
Any other Idea?


-Learner....
 
Z

zacks

Thank you for responding, but I do not believe it is related to .NET 2.0
deficiency since it works in windows XP environment...
It simply does not play in Vista... using same code...
Any other Idea?

When I said ".NET 2.0" deficiency, I mean a .NET 2.0 application
trying to run on Vista deficiency. .NET 2.0 is not officially
supported on Vista whereas 3.0 is.
 
T

Tom Shelton

I had a similar problem with an app I wrote that plays MP3 files using
the MediaPlayer control. It didn't play any sound either. I attributed
it to a deficiency in the .NET framework 2.0. I'm guessing an upgrade
to .NET 3.0 should help, but I am waiting for the official release of
the VS.- Hide quoted text -

- Show quoted text -

Just a note, 3.0 has been officially release almost a year (Nov.
2006). The name 3.0 is very confusing... It really should be 2.5,
since it uses the exact same runtime as 2.0, it just adds some
extension libraries to support WF,WCF, and WPF (among others). The
next release of Visual Studio will really by default be targeting 3.5
- which is an actual runtime upgrade (to support new features like
link, etc.).
 
G

Guest

Thank you for your replies...
Is there a work around? How should I proceed?

Please help
L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top