Results 1 to 6 of 6

Thread: Drive me INSANE (Dx8 sound)

  1. #1

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860

    Drive me INSANE (Dx8 sound)

    Alright, I've got this code... I don't understand how the error can happen:

    I have a general "loadsound" sub, so I don't have to look at DX code, lalala... anyways:

    VB Code:
    1. Public Sub LoadSound(ByVal Path As String, ByRef Buffer As DirectSoundSecondaryBuffer8)
    2. Dim DsDesc As DSBUFFERDESC
    3.    
    4.     DsDesc.lFlags = DSBCAPS_CTRLFREQUENCY Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME
    5.    
    6.     Set Buffer = DSound.CreateSoundBufferFromFile(App.Path & Path, DsDesc)
    7. 'ERROR: byref argument type mismatch
    8. 'DsDesc is highlighted. what could cause this?
    9. End Sub
    Don't pay attention to this signature, it's contradictory.

  2. #2
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Re: Drive me INSANE (Dx8 sound)

    Originally posted by alkatran
    Alright, I've got this code... I don't understand how the error can happen:

    I have a general "loadsound" sub, so I don't have to look at DX code, lalala... anyways:

    VB Code:
    1. Public Sub LoadSound(ByVal Path As String, ByRef Buffer As DirectSoundSecondaryBuffer8)
    2. Dim DsDesc As DSBUFFERDESC
    3.    
    4.     DsDesc.lFlags = DSBCAPS_CTRLFREQUENCY Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME
    5.    
    6.     Set Buffer = DSound.CreateSoundBufferFromFile(App.Path & Path, DsDesc)
    7. 'ERROR: byref argument type mismatch
    8. 'DsDesc is highlighted. what could cause this?
    9. End Sub
    What type does the CreateSoundBufferFromFile() function take as the last parameter? The error is saying its not DSBUFFERDESC. If it is then put DxVBLibA.DSBUFFERDESC as the type.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  3. #3
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    This is because your accessing both Dx7 & 8. so it doesn't know which library its getting the type from .
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  4. #4

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    That was actually my guess.. how do i get around the error?
    Don't pay attention to this signature, it's contradictory.

  5. #5

    Thread Starter
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    nevermind, noticed you were the same person and put DxVBLibA in front.
    Don't pay attention to this signature, it's contradictory.

  6. #6
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Same person, multiple personalitys . Who said that
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width