Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Go Back  Xtreme Visual Basic Talk > > > > Directsound with Visual Basic 2005???


Reply
 
Thread Tools Display Modes
  #1  
Old 03-26-2006, 04:11 PM
mistermitchell mistermitchell is offline
Freshman
 
Join Date: Mar 2006
Posts: 28
Default Directsound with Visual Basic 2005???


Hello...I've made a program with Visual Basic 2005 which plays .wav files using DirectX 8 DirectSound...but I can't find a way to add effects such as Echo or Distortion to a buffer...methods for doing this in VB6 don't seem to work at all so directx4vb.com didn't help....could someone please help me with this problem?
Reply With Quote
  #2  
Old 03-30-2006, 05:39 AM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Default

When setting the flags during creation you must set the FX flag in order to apply effects

if no effects are need then the following flags are ok

.lFlags = DSBCAPS_LOCDEFER Or DSBCAPS_CTRLFREQUENCY Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME Or DSBCAPS_CTRLPOSITIONNOTIFY Or DSBCAPS_STATIC

however the moment you add fx then you lose most of the thing you can do and have to use on the following flags

.lFlags = DSBCAPS_LOCDEFER Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME Or DSBCAPS_CTRLPOSITIONNOTIFY Or DSBCAPS_STATIC Or DSBCAPS_CTRLFX

as you can see DSBCAPS_CTRLFREQUENCY is missing, this is because you can't use DSBCAPS_CTRLFREQUENCY and DSBCAPS_CTRLFX at the same time.

Hope that helps.
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!
Reply With Quote
  #3  
Old 03-30-2006, 09:12 PM
mistermitchell mistermitchell is offline
Freshman
 
Join Date: Mar 2006
Posts: 28
Default

I tried that but I still keep getting the same errors...maybe you could look at this code and point out some errors to me...

If e.KeyData = Keys.Z Then
DSBuffer = DS.CreateSoundBufferFromFile(appPath & "\piano\noteZ.wav", BufferDesc)

DSBuffer.Play(DxVBLibA.CONST_DSBPLAYFLAGS.DSBPLAY_DEFAULT)
DSBuffer.SetFX(1, FXList, lReturn)
objFX_Distortion = DSBuffer.GetObjectinPath(DxVBLibA.AUDIOCONSTANTS.DSFX_STANDARD_DISTORT ION, _
1, DxVBLibA.AUDIOCONSTANTS.IID_DirectSoundFXDistortion)
objFX_Distortion.SetAllParameters(FX_Distortion)

This bit of code gives me an error when the Z key is pressed which reads...

System.Runtime.InteropServices.COMException (0x8002802B): Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND))
at DxVBLibA.DirectSoundSecondaryBuffer8.SetFX(Int32 lEffectsCount, Array& Buffers, Array& lResultIDs)

This error comes from the DSBuffer.SetFX(1, FXList, lReturn) line of the code.
Reply With Quote
  #4  
Old 04-01-2006, 01:43 AM
Rockoon's Avatar
Rockoon Rockoon is offline
Joseph Koss

* Guru *
 
Join Date: Aug 2003
Location: Unfashionable End
Posts: 3,615
Default

Are you sure that your hardware supports effects natively? I am quite certain that almost all audio programs that impliment effects do so in software, not hardware (excluding EAX support used in some games)

That often means processing the audio stream before it gets to the soundcards internal buffers (things like echo and reverb can be done without processing the stream by using multiple channels)
Reply With Quote
  #5  
Old 04-01-2006, 06:39 PM
mistermitchell mistermitchell is offline
Freshman
 
Join Date: Mar 2006
Posts: 28
Default

Ummm...I don't know where this hardware and software talk is coming from...I'm using direct x...which I always thought was software.
Reply With Quote
  #6  
Old 04-01-2006, 07:22 PM
Iceplug's Avatar
IceplugDirectsound with Visual Basic 2005??? Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

All software uses hardware. DirectSound software uses the speakers and the sound card software.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #7  
Old 04-02-2006, 06:30 AM
Rockoon's Avatar
Rockoon Rockoon is offline
Joseph Koss

* Guru *
 
Join Date: Aug 2003
Location: Unfashionable End
Posts: 3,615
Default

Not all hardware has the same features, and the DirectX API does not attempt to impliment all features that might be lacking in the hardware via software.

This is why a video or sound card for example might advertise itself as "compatible" OR "compliant" with DirectX 8.1 meaning that it supports a specific minimum specification OR the entire specification.

The DirectX API does not attempt to emulate ANYTHING that is part of the minimum specification.

Further, the DirectX API (as well as OpenGL and OpenAL) often has "extensions" specific to particular hardware that goes above and beyond the entire specification. Pixel shaders were once an "extension" of DirectX and OpenGL.. ie, not part of the specification at all!

I believe that in your specific case, the hardware you are using does not support the features you are trying to utilize and further that those features are probably not part of the minimum specification.
Reply With Quote
  #8  
Old 04-02-2006, 12:23 PM
mistermitchell mistermitchell is offline
Freshman
 
Join Date: Mar 2006
Posts: 28
Default

Well....that is certainly something to consider...but...if I can get direct sound to change the frequency of buffered sounds...then I'd say it should be able to do something like add distortion....Pretty well everything in Visual Basic 2005 is different from VB6....I've been running into these sorts of problems alot where it's just a matter of knowing the new way of doing things.
Reply With Quote
  #9  
Old 04-03-2006, 02:56 AM
Rockoon's Avatar
Rockoon Rockoon is offline
Joseph Koss

* Guru *
 
Join Date: Aug 2003
Location: Unfashionable End
Posts: 3,615
Default

Quote:
Originally Posted by mistermitchell
Well....that is certainly something to consider...but...if I can get direct sound to change the frequency of buffered sounds...then I'd say it should be able to do something like add distortion....Pretty well everything in Visual Basic 2005 is different from VB6....I've been running into these sorts of problems alot where it's just a matter of knowing the new way of doing things.
Changing the frequency is extremely simple to impliment... (simply send samples faster or slower to the DAC than is considered normal.. usualy 44.1khz is considered normal)

...feedback isn't.
Reply With Quote
  #10  
Old 04-08-2006, 07:28 PM
mistermitchell mistermitchell is offline
Freshman
 
Join Date: Mar 2006
Posts: 28
Default

Well...I decided to revert back to VB6 for this project and I can now add sound effects like I wanted to...thanks for your attempts to help...there are way too many changes in Visual Basic 2005 for a beginner such as myself to learn with...I'll have to wait until more people know about it before I can learn how to use it.
Reply With Quote
  #11  
Old 04-09-2006, 01:04 PM
Leade's Avatar
Leade Leade is offline
Junior Contributor
 
Join Date: Jul 2005
Location: Wherever i fall over
Posts: 222
Talking try it one more time.

Quote:
Originally Posted by mistermitchell
Well...I decided to revert back to VB6 for this project and I can now add sound effects like I wanted to...thanks for your attempts to help...there are way too many changes in Visual Basic 2005 for a beginner such as myself to learn with...I'll have to wait until more people know about it before I can learn how to use it.
I figure out the problem anyway

you cannot set the effects while the sample is playing, to have to get all the sound effect classes before you play the sound the afterward you can adjust them in real time as you wish.

Also when creating you cannot use the DSBCAPS_STATIC with DSBCAPS_FX i forgot to take that out sorry.
__________________
Fact: The best ideas come when your smashed of your face. So drink beer and be merry!!!
Reply With Quote
  #12  
Old 04-14-2006, 08:08 PM
mistermitchell mistermitchell is offline
Freshman
 
Join Date: Mar 2006
Posts: 28
Default

Have you done this with Visual Basic 2005? I could not get effects to work at all with that bull****...It is good in the way it creates buffers automatically but it's pretty well impossible for me to find a way to apply effects....as a result the vb2005 and vb6 versions of my program are pretty well 2 different programs that do different things...What I'd really like to know is how to have both progams open at the same time handling keystrokes....With the vb2005 program controlling the num pad and the vb6 controlling everything else.
Reply With Quote
  #13  
Old 04-20-2006, 11:50 AM
death_entry's Avatar
death_entry death_entry is offline
Centurion
 
Join Date: Mar 2005
Posts: 167
Default

I was under the impression that only one program could have focus at any one time.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005??? Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
 
Directsound with Visual Basic 2005???
Directsound with Visual Basic 2005???
 
-->