Hekkus Sound System wrapper

Discussion in 'Additional Libraries' started by Louis, Aug 16, 2007.

  1. Louis

    Louis Active Member Licensed User

    Hi. Would someone who knows about dll building for Basic4ppc convert this .NET library from Sean Cross, Intuitex.com into one that works for us Basic4ppc game programmers who want multisounds and to control them in realtime? It allows 3 mods and 64 waves to be played from within your app simultaneously, on whatever speaker or speakers you want, at whatever volume you want. Lots of Basic4ppc programmers will benefit from it, especially us Pocket PC users. I am struggling with dll building at the moment but am determined to learn.
    Thanks.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you provide a link to their site?
     
  3. Louis

    Louis Active Member Licensed User

    It is at http://www.intuitex.com
    If you click on the PocketPC Libraries link, you should see the Hekkus.NET sound library for the .NET Framework. There should be one on the site for the desktop as well but I'm unsure where that is.
    HTH.
     
    Last edited: Aug 16, 2007
  4. Erel

    Erel Administrator Staff Member Licensed User

    I've done a small modification to the Hekkus .Net wrapper and you can now use it.
    The change I did was to add a Value property for Music / Sound objects.
    There is a small example inside that should help you get started.
    I know very little about the Hekkus Sound System so I won't be able to help too much.
    This is their site: http://www.shlzero.com/modules.php?name=Content&pa=showpage&pid=1
    Make sure to read the product license there.

    There are four important files in the zip file:
    hssNetDesktop.dll - Add this file using the Components dialog, to the desktop.
    hssNetDevice.dll - Add this file using the Components dialog, to the device.
    hssDesktop.d - The native dll file, should be located on the same folder as your source code (desktop only).
    hssDevice.d - Should be copied to Basic4ppc folder: \Program Files\Basic4ppc (device only).
     

    Attached Files:

  5. taximania

    taximania Well-Known Member Licensed User

    Where do you find the time to do all the work you do Erel.
    Have you got a team of designers behind you ?

    :sign0188:
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    A small team (me and another guy).
    Sometimes things look more complicated than they really are.
    This wrapper is only a small modification of the original wrapper.
     
  7. Louis

    Louis Active Member Licensed User

    Hi Erel, Nice job!
    Are you going to include this wrapper in upcoming Basic4ppc versions?

    Also, for users of this library who are stuck, I attached the class references so you can have some direction in what each class is and what all the functions in the class do. HTH.
     

    Attached Files:

    Last edited: Aug 17, 2007
  8. Erel

    Erel Administrator Staff Member Licensed User

    As I haven't tested this library too much, and didn't write any documentation about it I'm not including this library with all other libraries,
     
  9. conf

    conf Member

    I want to ask one thing: did this library support .mp3 file?
     
  10. Louis

    Louis Active Member Licensed User

    Hi. It only supports .mod and .wav. There are free software programs that convert .mp3 to .wav quite nicely. One I know of is called "ABC Audio Converter" from "Process TextGroup". HTH.
     
  11. conf

    conf Member

    Thank Louis, but .wav file is much larger then .mp3 file. And do you know any software to convert .mp3 to .mod ?
     
  12. agraham

    agraham Expert Licensed User

    Sorry but I don't think that this is possible. A mod file is essentially a description of synthesized intruments and an associated score rather than being an actual audio file. So you could "play" a mod file into any audio format (wav, mp3 ogg etc..) but you can't go the other way.

    However the FMOD library included with B4PPC that interfaces to the Firelight Technologies FMOD libraries can play mp3 and ogg so why don't you try that?
     
  13. conf

    conf Member

    Thank you Agraham. I learned so much :D
     
  14. Louis

    Louis Active Member Licensed User

    Hi Agraham, The reason why i recommended this library in the first place is because the FMOD library does NOT play multiple sounds at once, but if it did yes it would be my first recommendation; even if you have 2 objects created of the FMOD type class using Basic4ppc. HTH.
     
  15. Louis

    Louis Active Member Licensed User

    Hi Erel, Thanks so much for your help in this matter. There is one last question and actually this library would be completely wrapped for b4ppc. There is a channels class, however the new1 method you call needs the memory pointer, which is a intPTR typed variable so that each object you create can manipulate the sounds at runtime. I tried this code and got the following error:
    'Create an object of type sound called sound1, another one called speaker of type speaker, another one of type const called constant, and one more of type channel called channel1.
    Sub Globals
    End Sub
    Sub App_Start
    form1.show
    sound1.new1
    speaker.new1
    constant.new1
    speaker.Open(44100, 16, true, 0, 16)
    sound1.load("jet.wav", constant.HSS_PlayFree)
    c = speaker.PlaySound(sound1.value) 'Returns the channel the current playing file is located on.
    d = speaker.channel(c) 'Returns a pointer to the channel currently specified by PlaySound and/or PlayMusic.
    channel1.new1(d)
    channel1.position(200)
    End Sub
    Sub form1_close
    speaker.close
    End Sub

    Basic4ppc Error
    Input string was NOT in a correct format.

    The line it is commenting on which you will see is channel1.new1(d). Is there a way to pass pointers in Visual Basic maybe have another value property for the speaker and constant objects that can accept any type of value so Basic4ppc's conversion won't get in the way of this, and that speaker.value and/or constant.value can be passed to the channel object? E.G.
    Sub App_Start
    speaker.new1
    constant.new1
    speaker.open(44100, 16, true, 0, 16)
    sound1.new1
    sound1.load("jet.wav", constant.HSS_Play_Free)
    constant.value = speaker.PlaySound(sound1.value)
    speaker.value = speaker.channel(constant.value))
    channel1.new1(speaker.value)
    channel1.position(200)
    End Sub
    ...
    ? You have done a good job. And this library will be 100% complete if we can somehow get this error out of the way. Thanks again, and Erel and everyone keep up the great work!
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    Try to pass the pointer directly:
    channel1.new1(speaker.channel(speaker.PlaySound(sound1.value) ))
     
  17. Louis

    Louis Active Member Licensed User

    I tried that and got another error saying the input string was not in a correct format.
     
  18. Erel

    Erel Administrator Staff Member Licensed User

    Next version of Basic4ppc will support pointers conversation (IntPtr).
    Then you will be able to use Music/Sound.UnmanagedObject.
     
  19. Louis

    Louis Active Member Licensed User

    Erel you're the man! Thanks.
     
Loading...