[VB6] DirectSound.-VBForums
Results 1 to 6 of 6

Thread: [VB6] DirectSound.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2015
    Posts
    855

    [VB6] DirectSound.


    With Direct3D9 I did the type library and module support functions for DirectSound. The archive contains a type library dsvb.tlb and module DS_Functions.bas. In the future, I add a class module to support asynchronous notification until you can use clsTrickWait.cls. The module DS_Functions contains the following functions:
    • DSCreateSoundBufferFromFile - creates an object with interface IDirectSoundBuffer8 from a file. Supported only WAVE and MP3 files is. MP3 files can contain only the ID3v1 and ID3v2 tags, any other may not be recognized/will not work. Too long (by time) files are not supported. For streaming you need to write streaming decoding based on the function code DSCreateSoundBufferFromMemory;
    • DSCreateSoundBufferFromMemory - the same, but instead of the file is passed a pointer to the data file in memory and size.


    Also in the archive contains an example of a player that implements some methods IDirectSoundBuffer8 interface (volume, pan, frequency, effects). TLB especially did not well tested, so something may not work. If something is not working please write here.

    Download latest version.
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    536

    Re: [VB6] DirectSound.

    Hello The Trick.
    I want to report that I tested it and I get error 7 "Out of memory" at the line:

    Code:
    ReDim Preserve buffer(outSize - 1)
    of the function DSCreateSoundBufferFromMemory.

    (I needed to remove some error handling to get to the error line)

    I tested it with a Mp3 file that its size is 36 MB and has 26 minutes of audio.
    It is trying to redim the byte array buffer to 250435583.

    I have only 1 GB of physical RAM (on XP SP3) but that was never a problem to reproduce audio.

    PS: sometimes I'm glad that I'm working in a such old machine, I'm permanently testing all for the worst case!
    Last edited by Eduardo-; Jun 29th, 2017 at 05:36 PM.

  3. #3

  4. #4
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    536

    Re: [VB6] DirectSound.

    Ok, The trick.

  5. #5
    Hyperactive Member
    Join Date
    Sep 2012
    Posts
    404

    Re: [VB6] DirectSound.

    Quote Originally Posted by Eduardo- View Post
    Hello The Trick.
    I want to report that I tested it and I get error 7 "Out of memory" at the line:

    Code:
    ReDim Preserve buffer(outSize - 1)
    of the function DSCreateSoundBufferFromMemory.

    (I needed to remove some error handling to get to the error line)

    I tested it with a Mp3 file that its size is 36 MB and has 26 minutes of audio.
    It is trying to redim the byte array buffer to 250435583.

    I have only 1 GB of physical RAM (on XP SP3) but that was never a problem to reproduce audio.

    PS: sometimes I'm glad that I'm working in a such old machine, I'm permanently testing all for the worst case!
    Hi Eduardo-, I met the same problem as you. Have you solved your problem using circular buffer?

  6. #6
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    536

    Re: [VB6] DirectSound.

    Quote Originally Posted by dreammanor View Post
    Hi Eduardo-, I met the same problem as you. Have you solved your problem using circular buffer?
    No, I did what I needed to do at that time in another way (opening the mp3 file in Windows Media Player).
    MSDN online for VB6 - Language Reference - Controls Reference
    Download MSDN October 2001: disk 1, 2 and 3

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.