Silent fall
Moderator: Zyx
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Well, 'Can't' is a bit strong. I suppose I could get the latest
headers. But I don't want to go through that trouble. The
machine I have done all the development on is an old
laptop with a 2.1 GB drive that has no connection to the
outside world. I think getting the DirectX SDK on floppies is
going to be a bit of trouble. So I have to find it somewhere
and burn it onto a CD. Then load it and see why it doesn't work
and try again.
And it is probably not going to fit on the hard drive anyway
because 2.1 GB, the Visual Studio 6.0, the project files, etc.
have it nearly full as it is.
How big are the headers that I need?
I had all the headers that were contained in your .cpp file.
One of them must be an old version, I suppose. Can I replace
the one header that is needed for this one source file?
headers. But I don't want to go through that trouble. The
machine I have done all the development on is an old
laptop with a 2.1 GB drive that has no connection to the
outside world. I think getting the DirectX SDK on floppies is
going to be a bit of trouble. So I have to find it somewhere
and burn it onto a CD. Then load it and see why it doesn't work
and try again.
And it is probably not going to fit on the hard drive anyway
because 2.1 GB, the Visual Studio 6.0, the project files, etc.
have it nearly full as it is.
How big are the headers that I need?
I had all the headers that were contained in your .cpp file.
One of them must be an old version, I suppose. Can I replace
the one header that is needed for this one source file?
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
That seems close to syntactically correct.
[/quote]
Code: Select all
typedef struct _DSBUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
} DSBUFFERDESC, *LPDSBUFFERDESC;
DSBUFFERDESC desc;
desc.dwSize = sizeof DSBUFFERDESC;
desc.dwFlags = 0;
desc.dwBufferBytes = 0; // To be filled in after parsing the wave
desc.lpwfxFormat = &
desc.guid3DAlgorithm = GUID_NULL;
desc.dwReserved = 0;
C:\Projects\Csb\CSBwin\src\Win32_SoundMixer.cpp(153) : error C2039: 'guid3DAlgorithm' : is not a member of '_DSBUFFERDESC'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\dsound.h(96) : see declaration of '_DSBUFFERDESC'
E
Fix for the code
Sorry about that, I made it use the initial interfaces but I was still using a newer header that added an extra field to this structure.
Here's how it looks in my header which should make it obvious:
You can fix it by just removing this line since it's not used anyways:
Hope that helps!
Here's how it looks in my header which should make it obvious:
Code: Select all
typedef struct _DSBUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
#if DIRECTSOUND_VERSION >= 0x0700
GUID guid3DAlgorithm;
#endif
} DSBUFFERDESC, *LPDSBUFFERDESC;
Code: Select all
desc.guid3DAlgorithm = GUID_NULL;
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Hmmmm. Works very smoothly now. Unfortunately
there is no sound now.
The initialize (four steps as I recall) works great and
returns 'true'. Then I try to play a sound. It parses the
thing and finally gets to a statement:
That fails and the function immediately returns.
Also I have a question. It appears that you have no
use for the sound buffer that I pass to the Play function.
So I can release it immediately when your Play() returns.
Is that correct?
there is no sound now.
The initialize (four steps as I recall) works great and
returns 'true'. Then I try to play a sound. It parses the
thing and finally gets to a statement:
Code: Select all
pDirectSoundBuffer->Lock(........);
Also I have a question. It appears that you have no
use for the sound buffer that I pass to the Play function.
So I can release it immediately when your Play() returns.
Is that correct?
What is the value in the EAX register when the Lock function fails? (or just say 'HRESULT hr = pblah->Lock()' and get the HRESULT.)
Be careful about trying to debug into the sound routines, they won't play unless the window you initialized with is the active window. Naturally while you're debugging that window is not active so nothing will play in the debugger. I didn't think that Lock() would fail if the window is not active though.
And yes, the buffer originally passed in is not needed after calling Play.
Be careful about trying to debug into the sound routines, they won't play unless the window you initialized with is the active window. Naturally while you're debugging that window is not active so nothing will play in the debugger. I didn't think that Lock() would fail if the window is not active though.
And yes, the buffer originally passed in is not needed after calling Play.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Try merging these changes in to see if they have any effect. It's the best I can think of without reproing it locally.
[/code]
Code: Select all
void *p1=NULL;
DWORD bytes1=0;
void *p2=NULL;
DWORD bytes2=0;
if(FAILED(pDirectSoundBuffer->Lock(0, 0, &p1, &bytes1, &p2, &bytes2, DSBLOCK_ENTIREBUFFER)))
return;
if(bytes1!=dwDataSize)
return;
Code: Select all
if(FAILED(pDirectSoundBuffer->Lock(0, dwDataSize, &p1, &bytes1, &p2, &bytes2, 0)))
return;
-Ryan
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
None of your suggested changes made the slightest difference.
So I spent a few hours reading about this stuff and trying
this and that and rebooting and so on and so forth.
I built a release executable and restarted my machine
from a power-off state and still nothing.
Perhaps it requires some hardware capability that my old
laptop does not have.
Then I packaged the same release executable and tried it on
my Windows2000 machine. It worked just fine. I will list
the concerns that I have reguarding this project.
1) It does not work on my Windows 95 machine and it
returns no information that informs me of this fact. So
I cannot recover by playing the sounds in the old way.
2) Your code appears to 'Create a Sound Buffer' and then
when the 'Lock' fails your code returns without releasing the
sound buffer. Is this proper? I know nothing of how this is
supposed to work......so I worry.
3) I don't know whether this is supposed to work on WindowsCE
or not. In any case, my experience to date indicates that I had
better do some testing.
Maybe the best thing to do is to install this code, disable it
initially, and provide a way for Cowsmanaut to enable it so
that he can hear two sounds at once. In that way it can do
no harm unless the user 'Asks for it'.
Welcome to the world of writing programs for a wide audience.
So I spent a few hours reading about this stuff and trying
this and that and rebooting and so on and so forth.
I built a release executable and restarted my machine
from a power-off state and still nothing.
Perhaps it requires some hardware capability that my old
laptop does not have.
Then I packaged the same release executable and tried it on
my Windows2000 machine. It worked just fine. I will list
the concerns that I have reguarding this project.
1) It does not work on my Windows 95 machine and it
returns no information that informs me of this fact. So
I cannot recover by playing the sounds in the old way.
2) Your code appears to 'Create a Sound Buffer' and then
when the 'Lock' fails your code returns without releasing the
sound buffer. Is this proper? I know nothing of how this is
supposed to work......so I worry.
3) I don't know whether this is supposed to work on WindowsCE
or not. In any case, my experience to date indicates that I had
better do some testing.
Maybe the best thing to do is to install this code, disable it
initially, and provide a way for Cowsmanaut to enable it so
that he can hear two sounds at once. In that way it can do
no harm unless the user 'Asks for it'.
Welcome to the world of writing programs for a wide audience.
-
- Artisan
- Posts: 178
- Joined: Wed Dec 17, 2003 1:39 am
- Location: Osaka, Japan
- Contact:
testing tool
hi.
i have made a testing tool in a hour.
should i upload it?
screenshot:
http://homepage3.nifty.com/kkdf/0528_001.gif
i have made a testing tool in a hour.
should i upload it?
screenshot:
http://homepage3.nifty.com/kkdf/0528_001.gif
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I forgot to list a fourth concern:
4) On my Windows2000 machine the DirectSound works
just fine but......when the program terminates (File/Exit menu)
I get a dialog box saying that it is trying to launch
Dr. Watson Postmortem Debugger. I don't need that.
Any idea why ***THAT*** is happening? It does not happen
if I terminate before the first sound is played.
4) On my Windows2000 machine the DirectSound works
just fine but......when the program terminates (File/Exit menu)
I get a dialog box saying that it is trying to launch
Dr. Watson Postmortem Debugger. I don't need that.
Any idea why ***THAT*** is happening? It does not happen
if I terminate before the first sound is played.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
-
- Artisan
- Posts: 178
- Joined: Wed Dec 17, 2003 1:39 am
- Location: Osaka, Japan
- Contact:
permission to distribute?
hello, Paul.
although i'm already ready to publish the archived package, i require the permission from its author to distribute the component.
hi Ryan, can i publish the tool (+src) with your module?
although i'm already ready to publish the archived package, i require the permission from its author to distribute the component.
hi Ryan, can i publish the tool (+src) with your module?
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Just to interject here. The suggestion I had made was to have a switch so that those who can/want to use this little section will be able to, and for those who do not or can't, can turn it off and use the old way.
Also, I didn't but my nose in just for me. The topic arose before I even got involved.
This stemmed from ZYX wanting hear the door close as they party screamed their way down a pit. 
moo
Also, I didn't but my nose in just for me. The topic arose before I even got involved.


moo
kentaro-k.21,
You have my permission to do whatever you want with the code. I'm impressed with the utility you came up with!
Paul:
The buffer is not leaked, the release of it is handled in the CntPtrTo C++ object and is all handled automatically. That's why I just 'return' when things fail, that object manages the lifetimes for me automatically.
Also, I could have the init try to create a sound, lock it, and play silence, if that succeeds then to return true from the Init() routine. I can also have the Play() method return success/failure and if it fails to switch back to PlaySound() on your side.
You don't have to tell me about making code run on all platforms, I do that every day. My work code runs on millions of machines with every kind of hardware. Amusingly enough, the code was not sound related. Also, we typically get a few years to try it out on all the platforms we care about. Also, we stopped supporting NT 4.. perhaps that's why I can't write code that still works on it.
If you tell me the machine setup you're using I can setup an NT4 machine myself and give it a try. I know DirectSound worked fine for me back in 1997 when I was doing DirectSound stuff on NT4.
You have my permission to do whatever you want with the code. I'm impressed with the utility you came up with!
Paul:
The buffer is not leaked, the release of it is handled in the CntPtrTo C++ object and is all handled automatically. That's why I just 'return' when things fail, that object manages the lifetimes for me automatically.
Also, I could have the init try to create a sound, lock it, and play silence, if that succeeds then to return true from the Init() routine. I can also have the Play() method return success/failure and if it fails to switch back to PlaySound() on your side.
You don't have to tell me about making code run on all platforms, I do that every day. My work code runs on millions of machines with every kind of hardware. Amusingly enough, the code was not sound related. Also, we typically get a few years to try it out on all the platforms we care about. Also, we stopped supporting NT 4.. perhaps that's why I can't write code that still works on it.
If you tell me the machine setup you're using I can setup an NT4 machine myself and give it a try. I know DirectSound worked fine for me back in 1997 when I was doing DirectSound stuff on NT4.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I don't know anything about NT4. What I have is an IBM ModelIf you tell me the machine setup you're using I can setup an NT4 machine myself and give it a try
380ED very standard as it was built at the factory. It has
a built-in Crystal PnP Audio CODEC according to the Hardware
Configuration Manager. When I boot, it says some words
about pretending to be a SoundBlaster and gives the DMA address
and IRQ.
I am running an old Windows 95 that came with the machine
many years ago. Version 4.0.950 B it says.
It all runs on a Intel Pentium at 166MHz. Quite quaint. But four
times what is needed to run CSBwin very well. What else can
I tell you (and how do I find it out?).
Well, I did the best I could do. I installed Windows 95 with a SoundBlaster card and ran my demo app on it to see if I could play sounds. The only DirectX download I could find was 8.x so I had to install that. The app worked just fine.. I closed it and no errors also.
I don't know what to say. Try running 'dxdiag' and testing DirectSound through that way to see if it has any problems playing back sound.
I don't know what to say. Try running 'dxdiag' and testing DirectSound through that way to see if it has any problems playing back sound.
-
- Artisan
- Posts: 178
- Joined: Wed Dec 17, 2003 1:39 am
- Location: Osaka, Japan
- Contact:
uploaded
i have uploaded the testing tool at encyclopaedia forum.
http://dmweb.free.fr/Forum/read.php?f=8&i=303&t=303
http://dmweb.free.fr/Forum/read.php?f=8&i=303&t=303
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Some results....
I tryed the Testing Tool. Worked great. I initialized, I
played MicrosoftSound.wav, and I Shutdown. No errors.
No sound either.
By the way....I forgot to initialize once and the tester died
a rather ugly death.
I tried running dxdiag. There is no dxdiag on my Win95
machine. So I went to my Win98 machine. There is no dxdiag
on that machine. So I went to my Win2K machine. There it is!!!
I copied it to my Win95 with very little expectation. It simply told
me that a .DLL was missing.
So-----
I put in a menu option "Attempt to use DirectX". Anyone who
wants to try it can try it. If it does not work then they can turn
it off again. Unless someone has a remarkable brainstorm, I
plan to leave it at that and go onto something else.
I tryed the Testing Tool. Worked great. I initialized, I
played MicrosoftSound.wav, and I Shutdown. No errors.
No sound either.
By the way....I forgot to initialize once and the tester died
a rather ugly death.
I tried running dxdiag. There is no dxdiag on my Win95
machine. So I went to my Win98 machine. There is no dxdiag
on that machine. So I went to my Win2K machine. There it is!!!
I copied it to my Win95 with very little expectation. It simply told
me that a .DLL was missing.
So-----
I put in a menu option "Attempt to use DirectX". Anyone who
wants to try it can try it. If it does not work then they can turn
it off again. Unless someone has a remarkable brainstorm, I
plan to leave it at that and go onto something else.
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
well this begs the question then. What ver of Direct X do you have installed on your Win 95 machine. And what ver on your win 98 machine?
Since DirectX's Diagnostic tool wasn't provided with earlier versions of direct X. Dxdiag needs DXdiag.cpl and will only work with (I think) version 6 and up.
moo
Since DirectX's Diagnostic tool wasn't provided with earlier versions of direct X. Dxdiag needs DXdiag.cpl and will only work with (I think) version 6 and up.
moo
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
well, as far as I know direct X didn't come with windows 95. So if you didn't put it there then chances are it's not there. Which would neatly explain why it's not working.
What you should do is download directX.. the users version not the developers. That should be only about 12 megs. Install that and then try running it.
being as this is a common and easily accessable program a lot of people (especially gamers) have a copy of it. If you like I think you can still find directX6 still if you want an earlier version than 8. It's unlikley that if anyone here has DX it would be anything less than that.
moo
What you should do is download directX.. the users version not the developers. That should be only about 12 megs. Install that and then try running it.
being as this is a common and easily accessable program a lot of people (especially gamers) have a copy of it. If you like I think you can still find directX6 still if you want an earlier version than 8. It's unlikley that if anyone here has DX it would be anything less than that.
moo
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
I don't think you yet understand. I want anyone who can
run NotePad to be able to run CSBwin. I do not want
to tell people they have to go get DirectX to run CSBwin.
You promised me that your code would check to see
if all the necessary libraries, etc. were present and if not
you would fall back to the standard Windows functions.
it to fall back, tell me that DirectX was not present, and I
would play the sounds as I always have in the past. Unfortunately,
your code said that it created the sound when it did not. Probably
a bug in my machine or my operating system. Nobody seems
to know. The bottom line is that it did not work whereas the
simple Windows interface does work.
I expected that on my Win2K machine the DirectX would work
and I would not have to play the sounds using the queue that
I recently implemented. This, in fact, has worked. But when I
exit the program it tries to load Dr. Watson Postmortem Debugger.
That is a bit ugly and sufficient reason for my wanting a way
to turn off the DirectX feature.
Therefore, as I said recently, I will install the code you provided,
give the user a Menu option to use it or not use it, and go onto
the text/wall decoration project. Any suggestions that I receive
concerning the DirectX implementation will be forwarded to you
for implementation/resolution. And I will happily install any
updates that you provide me. Fair enough?
Welcome to the world of writing programs for wide
distribution. I understand that someone out there
is running CSBuild/CSBwin on a 486. I have made a lot
of changes to accomodate that person. It is painful but
that is the way it is. I could add that my tooth is painful, too.
Been that way for 5 months. It has taught me some things.
All of this can be summarized in four letters. KISS
run NotePad to be able to run CSBwin. I do not want
to tell people they have to go get DirectX to run CSBwin.
You promised me that your code would check to see
if all the necessary libraries, etc. were present and if not
you would fall back to the standard Windows functions.
I did not expect it to use DirectX on my Win95 machine. I expectedThe function would always succeed and play the sound through whatever mechanism necessary (like falling back to WinMM if necessary).
it to fall back, tell me that DirectX was not present, and I
would play the sounds as I always have in the past. Unfortunately,
your code said that it created the sound when it did not. Probably
a bug in my machine or my operating system. Nobody seems
to know. The bottom line is that it did not work whereas the
simple Windows interface does work.
I expected that on my Win2K machine the DirectX would work
and I would not have to play the sounds using the queue that
I recently implemented. This, in fact, has worked. But when I
exit the program it tries to load Dr. Watson Postmortem Debugger.
That is a bit ugly and sufficient reason for my wanting a way
to turn off the DirectX feature.
Therefore, as I said recently, I will install the code you provided,
give the user a Menu option to use it or not use it, and go onto
the text/wall decoration project. Any suggestions that I receive
concerning the DirectX implementation will be forwarded to you
for implementation/resolution. And I will happily install any
updates that you provide me. Fair enough?
Welcome to the world of writing programs for wide
distribution. I understand that someone out there
is running CSBuild/CSBwin on a 486. I have made a lot
of changes to accomodate that person. It is painful but
that is the way it is. I could add that my tooth is painful, too.
Been that way for 5 months. It has taught me some things.
All of this can be summarized in four letters. KISS