Adding Sounds to Resource file, Playing with DirectSound8. Completely lost. Please Help! 
Author Message
 Adding Sounds to Resource file, Playing with DirectSound8. Completely lost. Please Help!

I am writing a small desktop game for my wife :)

Semi-Newbie to DirectX, VB.NET intermediate, trying to add sounds, but
do not want a bunch of little sound files all over the place.
Memory/disk space is not a problem(yet).

I have been able to build a .res file with the sounds I want using the
built in resource template, but can't seem to get the files out to use
with DirectSound.

Playing sounds by loading them with CreateBufferFromFile works just
fine, but I want to know how to use the CreateBufferFromResource
method, or any other method to do this nice and neatly.

I have already looked through many groups and sites for information
and havent found a thing. I also tried to build a .dll file with C++
but probably screwed it up miserably, probably because I had only a
small clue about what I was doing. Either way I get the same error
with the CBfromResource method:

----------
An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in
SoundTest.exe
---------

Additional information: Exception from HRESULT: 0x80030002
(STG_E_FILENOTFOUND).

I have read the .NET MSDN Documentation on DirectSound and find it
completely unhelpful, I guess it's meant for people who know what they
are doing (if that makes sense).

I am toying with the idea of actually creating my own resource file
and loading in whatever I need through that. Unfortunately I can only
imagine that any sounds that I want to use from that would have to be
written out as temporary files at runtime start, and that is not
acceptable.

Any help or information on where to get help on this is greatly
appreciated.

I am experienced with VB.NET but havent even started my C++ college
course yet, so C++ help would have to be very basic. (Sorry about the
pun)



Tue, 28 Dec 2004 13:10:49 GMT  
 Adding Sounds to Resource file, Playing with DirectSound8. Completely lost. Please Help!
Using .NET interop to create a game using DX8 (assuming that is what you are
trying to do) might not be worth the extra effort.  For one thing, it won't
be very fast, and secondly there won't be any official support or fixes for
DX8 and .NET from the good people at MS.  There are many known issues with
this approach.  I suggest you either use C++ or VB6 right now, or wait for
DX9 to be released, it will provide official support for managed languages
such as VB.NET.  With that said, I'm not sure you'll find many people that
can help.

--
Eric DeBrosse
http://www.mvps.org/vbdx/
Microsoft Visual Basic DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.



Quote:
> I am writing a small desktop game for my wife :)

> Semi-Newbie to DirectX, VB.NET intermediate, trying to add sounds, but
> do not want a bunch of little sound files all over the place.
> Memory/disk space is not a problem(yet).

> I have been able to build a .res file with the sounds I want using the
> built in resource template, but can't seem to get the files out to use
> with DirectSound.

> Playing sounds by loading them with CreateBufferFromFile works just
> fine, but I want to know how to use the CreateBufferFromResource
> method, or any other method to do this nice and neatly.

> I have already looked through many groups and sites for information
> and havent found a thing. I also tried to build a .dll file with C++
> but probably screwed it up miserably, probably because I had only a
> small clue about what I was doing. Either way I get the same error
> with the CBfromResource method:

> ----------
> An unhandled exception of type
> 'System.Runtime.InteropServices.COMException' occurred in
> SoundTest.exe
> ---------

> Additional information: Exception from HRESULT: 0x80030002
> (STG_E_FILENOTFOUND).

> I have read the .NET MSDN Documentation on DirectSound and find it
> completely unhelpful, I guess it's meant for people who know what they
> are doing (if that makes sense).

> I am toying with the idea of actually creating my own resource file
> and loading in whatever I need through that. Unfortunately I can only
> imagine that any sounds that I want to use from that would have to be
> written out as temporary files at runtime start, and that is not
> acceptable.

> Any help or information on where to get help on this is greatly
> appreciated.

> I am experienced with VB.NET but havent even started my C++ college
> course yet, so C++ help would have to be very basic. (Sorry about the
> pun)



Tue, 28 Dec 2004 13:48:44 GMT  
 Adding Sounds to Resource file, Playing with DirectSound8. Completely lost. Please Help!

Thanks for the quick reply. I am taking a class in C++ next quarter so
that is a possibility, I just didn't want to change now since I have
gotten so far with it in the first place. Oh well... GDI+ isnt so bad.

On Fri, 12 Jul 2002 01:48:44 -0400, "Eric DeBrosse [MS MVP]"

Quote:

>Using .NET interop to create a game using DX8 (assuming that is what you are
>trying to do) might not be worth the extra effort.  For one thing, it won't
>be very fast, and secondly there won't be any official support or fixes for
>DX8 and .NET from the good people at MS.  There are many known issues with
>this approach.  I suggest you either use C++ or VB6 right now, or wait for
>DX9 to be released, it will provide official support for managed languages
>such as VB.NET.  With that said, I'm not sure you'll find many people that
>can help.

>--
>Eric DeBrosse
>http://www.mvps.org/vbdx/
>Microsoft Visual Basic DirectX MVP

>The opinions expressed in this message are my own personal views and
>do not reflect the official views of Microsoft Corporation. The MVP program
>does not constitute employment or contractual obligation with Microsoft.



>> I am writing a small desktop game for my wife :)

>> Semi-Newbie to DirectX, VB.NET intermediate, trying to add sounds, but
>> do not want a bunch of little sound files all over the place.
>> Memory/disk space is not a problem(yet).

>> I have been able to build a .res file with the sounds I want using the
>> built in resource template, but can't seem to get the files out to use
>> with DirectSound.

>> Playing sounds by loading them with CreateBufferFromFile works just
>> fine, but I want to know how to use the CreateBufferFromResource
>> method, or any other method to do this nice and neatly.

>> I have already looked through many groups and sites for information
>> and havent found a thing. I also tried to build a .dll file with C++
>> but probably screwed it up miserably, probably because I had only a
>> small clue about what I was doing. Either way I get the same error
>> with the CBfromResource method:

>> ----------
>> An unhandled exception of type
>> 'System.Runtime.InteropServices.COMException' occurred in
>> SoundTest.exe
>> ---------

>> Additional information: Exception from HRESULT: 0x80030002
>> (STG_E_FILENOTFOUND).

>> I have read the .NET MSDN Documentation on DirectSound and find it
>> completely unhelpful, I guess it's meant for people who know what they
>> are doing (if that makes sense).

>> I am toying with the idea of actually creating my own resource file
>> and loading in whatever I need through that. Unfortunately I can only
>> imagine that any sounds that I want to use from that would have to be
>> written out as temporary files at runtime start, and that is not
>> acceptable.

>> Any help or information on where to get help on this is greatly
>> appreciated.

>> I am experienced with VB.NET but havent even started my C++ college
>> course yet, so C++ help would have to be very basic. (Sorry about the
>> pun)



Tue, 28 Dec 2004 16:27:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Playing *.mid sounds from resource file

2. Q : Play Sound from Resource file

3. Playing sounds even if other applications are playing sounds

4. DirectSound8 Get Spectrum from Sound Buffer

5. Playing an AVI file from a resource file

6. macro completely lost after Outlook-crash

7. Sounds - Playing System Event Sounds (asterisk, critical stop, question, etc)

8. play sound after sound.

9. Urgent, How to: Play sound using sound card?

10. Urgent, How to: Play sound using sound card?

11. Playing Sound file on event??!!

12. Code to play embedded sound file

 

 
Powered by phpBB® Forum Software