View Full Version : TBASS_SampleLoad()+MusicLoad()- what parameters to set up?

22-10-2012, 18:48
In the meantime I came to add sounds to my game, but there I've got some problems to figure out how to set up the parameters/arguments for

TBASS_SampleLoad(unknown, PointsToSoundInMemory, unknown, LengthOfSound, unknown, unknownEquates)

same issue for TBASS_MusicLoad()

The helpfile just tells: Topic to be finish... and the samples do not tell anything about the meaning of arguments there.
especially the equate to play a sound just once would be of interest to me.
Also do I want to know, how it works to play more than one sound at the time.

Can anybody help?

Petr Schreiber
23-10-2012, 11:46

I prepaired brief documentation for these keywords here:
TBASS_SampleLoad (http://www.thinbasic.com/community/showthread.php?11162-Help-file-TBASS_SampleLoad&highlight=tbass_sampleload)
TBASS_MusicLoad (http://www.thinbasic.com/community/showthread.php?11160-Help-file-TBASS_MusicLoad&highlight=tbass_musicload)

I am sure Eros will put it in help file soon.


Petr Schreiber
23-10-2012, 11:52
You might be interested in sound wrapper I created in the past. It is called simply Sound3D, I attach it to this post.
To use it in your script, just place this to your code:

%Sound3D_WantDebug= 0
%Sound3D_WantTBGL = 0
#INCLUDE "unit_Sound3d.tBasicU"

' -- before program starts

' -- Use some sounds you have on your PC
DWord sndCrash = Sound3D_ChannelLoad(APP_SourcePath + "SoundEffects\crash.wav")
DWord sndScratch = Sound3D_ChannelLoad(APP_SourcePath + "SoundEffects\scratch.wav")

MsgBox 0, "First sound"

MsgBox 0, "Second sound"

' -- before program ends

It should play side by side (new sound should not interrupt the current one)


23-10-2012, 16:33
Thank you Petr, the thread I've found already in the meantime. Also the small link to BASS and I already tried, but didn't get a "beep" out of that thing. I'll use the unit_Sound3D.tbasicu now.

It works! Great!
But why does that Console-alike-Window open? Can I avoid that somehow?

Petr Schreiber
23-10-2012, 17:20

I attach for you updated version from today :)
It does not use Console anymore to report debug messages.

If you want debug/error messages use:

%Sound3D_WantDebug= 1


MsgBox 0, Sound3D_DebugGetErrorLog() ' -- To get info about possible problems, function returns string


25-10-2012, 19:05
you might move or close this thread, we're far off topic - does not have anything to do with TBASS any more ;)

Petr Schreiber
25-10-2012, 19:42
Hi Rene,

I moved the posts here: http://www.thinbasic.com/community/showthread.php?11907-Rene-s-project-consulting