0
0

I use VB6 and Fmod 3.61

Can somebody give me some example of how to use ” FSOUND_Stream_SetEndCallback “?
Where it is necessary to locate it? In the section declarations, after FSOUND_Stream_Play, or where?
I have the version stdcall of Fmod, but I was not lucky proving with callbacks. 😥
Thank you.

  • You must to post comments
0
0

When using from VB, you need fmod 3.70 or higher, or the stdcallback version of fmod.dll 3.6x (and previous), and it works fine

  • You must to post comments
0
0

[quote="Anonymous":pzfkyhub]When using from VB, you need fmod 3.70 or higher, or the stdcallback version of fmod.dll 3.6x (and previous), and it works fine[/quote:pzfkyhub]

FMOD is stdcall by default now.

  • You must to post comments
0
0

I use endStream = 1 at the end of callback and not solve the problem…
Maybe I have too much instructions inside the callback and SetEndCallback need a fast response.

  • You must to post comments
0
0

Any little example?
Please.

  • You must to post comments
0
0

yes, stdcallback is default now since 3.70 if I remember right…
but the problem was with 3.61, where stdcallback was not yet standart and caused problems with vb6, but there had been a std-callbackverstion for older fmod version!

  • You must to post comments
0
0

Okey.
I use:

FSOUND_Stream_Play 1, stream(1)
FSOUND_Stream_SetEndCallback stream(1), Address of endStream,0

´endStream is my function to be called when stream ends.



Public Function endStream ()
´some code for probe endStream.
label1.caption = “Finish” ´In this point VB crash. 😕

End Function

What happen?
I use stdcall.

  • You must to post comments
0
0

I´m using 3.71 version…

  • You must to post comments
0
0

Your callback needs to be a certain format, I believe it should look like this:

[code:fd3pgzq4]
Public Function endStream(byval stream as long, byval buff as long, byval len as long, byval param as long) as long

label1.caption = "Finish"

end function[/code:fd3pgzq4]

And because you are using FSOUND_Stream_SetEndCallback the return value is ignored so you dont need to return anything.

  • You must to post comments
0
0

Yes! SetEndCallback work. Whit less code in callback, work fine. With a too long code the delay is too big and Fmod crash.

  • You must to post comments
0
0

I don’t understand well that data want to send you to the function “endStream”.
Concretely, I don’t understand for that to pass him “buff ” and “len” and that value would have. Or is it supposed that the callback sends them to him?
Equally, I proved with the function that you say and it continues without working (VB is crash after label1.caption), in that moment “buff” and “len” are equal to 0, and “stream” and “param ” they have the correct values.
VB enters in the function and it is hung when it executes label1.xxxxxx, maybe the error takes place when it leaves the function. Does the function have to return something? Will it be returning a mistaken value? Does SetEndCallback return a value Byte, will something have to see?

  • You must to post comments
0
0

[quote="Colores":mkae785w]Yes! SetEndCallback work. Whit less code in callback, work fine. With a too long code the delay is too big and Fmod crash.[/quote:mkae785w]

It is due to the “speed” of vb … Why no switching to [url=http://www.purebasic.com:mkae785w]PureBasic[/url:mkae785w] ? You will not have to learn the language as it is a basic and it is FAR MUCH powerfull than VB :)
Btw, it is not free but the license you paid is for the entire life and you can install it in as much computers as you want. And it is cross plateform ! (Windows/Linux/Amiga OS)
It cost the price of a video game :)

  • You must to post comments
0
0

FSOUND_Stream_SetEndCallback is a Stream callback, and if you look in the documentation under FSOUND_STREAMCALLBACK you will see that a stream callback needs to be a certain way.

[quote:2pfulfn6]From the documentation:
Parameters:
[b:2pfulfn6]stream[/b:2pfulfn6]: Pointer to the stream in question.

[b:2pfulfn6]buff[/b:2pfulfn6]: from FSOUND_Stream_Create – Pointer to the stream data buffer to write to
from FSOUND_Stream_SetEndCallback – NULL
from FSOUND_Stream_SetSynchCallback – Pointer to a string

[b:2pfulfn6]len[/b:2pfulfn6]: from FSOUND_Stream_Create – Length of buffer specified in BYTES.
from FSOUND_Stream_SetEndCallback – 0
from FSOUND_Stream_SetSynchCallback – 0

[b:2pfulfn6]param[/b:2pfulfn6]: A user data value specified from FSOUND_Stream_Create,

[b:2pfulfn6]Return Value[/b:2pfulfn6]
If created by FSOUND_Stream_Create –
To allow the stream to continue, TRUE is returned.
To stop the stream, FALSE is returned.
The return value is ignored if created by FSOUND_Stream_SetEndCallback or FSOUND_Stream_SetSynchCallback[/quote:2pfulfn6]

  • You must to post comments
0
0

Pure Basic? Many say that has many advantages… but that disadvantages have? You already proved VB and Pure Basic. That objects lack in Pure Basic? Is it quicker than VB?

  • You must to post comments
0
0

Yes, it´s true. I don’t understand for that not work. I use FSOUND_Stream_OpenFile, not FSOUND_Stream_Create.
And enter in my function and then VB crash.
You need many details of my code?

  • You must to post comments
0
0

Of course, PureBasic (also know as pb 😉 ) has some disadvantages due to his relatively young age :

  • It lacks support of activex,
  • SGBD/ADO/DAO/MS JET : VB beats PureBasic here but PureBasic support ODBC on win32 AND Linux (and all other unices),
  • mmmhhh this is the only two things i see for the moment.

For the advantages :

  • PureBasic is far quicker than VB, you can compare it to C/C++ : all the PureBasic code is converted to the asm language, ready to be compiled by the PureBasic compiler or … nasm !
  • you can use asm inline using the fasm assembler,
  • PureBasic support real pointers though, you can do simple lists, linked list, binary lists, load balanced list etc … using pointer’s addresses or by using PureBasic internal list functions,
  • You can compile your code to a real DLL in both naming conventions : _cdecl and _stdcall, you can also compile it as a COM objet : PureBasic also support COM interfaces,
  • It is ready to be used as a language for making games : a lot of advances functions exist to do sprite, collision, pixels manipulations : 2D AND 3D is supported though DirectX and the Ogre 3D Engine, the last but not least : a physic engine compared to the one used in the half life 2 game (havok engine) will be added in the future. [url=http://www.master-creating.de/restricted/gfx/gallery.gif:1kl30cqn]Here[/url:1kl30cqn], you will find a commercial games maked in PureBasic, and [url=http://perso.wanadoo.fr/darkprograms/index2.html:1kl30cqn]here[/url:1kl30cqn], an “oldschool” shoot’em up,
  • It is really portable : for now the same code run on win32/Linux if you don’t us OS specific code (windows callbacks for example)
  • The community is different from other language : a lot of users are not beginners, they allmost all used language programming for a lot of years so, having a solution to your problem will not be a problem.
  • You can reach the PureBasic author easily, ask Microsoft to help you to compare :)
  • The last but not least : FMOD is fully supported by PureBasic using our code (FroggerProgger and me).

I miss a lot advantages and, surely some disadvantages, but i used to program in VB since the 2.0 version (on DOS) and when i figure out how PureBasic beats VB in a lot of domains, i ve switched to PureBasic.
I don’t touch VB for a year now, without regrets 😀

  • You must to post comments
0
0

In the latest version of Fmod (3.71) I find less VB examples (simplest directory) and I can’t find one complete example of how use SetEndCallback. I cannot make it work. I attempted in all the ways and it only works in the IDE of VB. In the .exe it crash. Could somebody make the same example with this function?

  • You must to post comments
0
0

I am really impressed. I will download a demo version to see it. Thank you.

  • You must to post comments
0
0

You need to return something at the end of your callback, put [code:g8zc35jz]endStream = 1[/code:g8zc35jz] at the end of your callback and see if that works.

  • You must to post comments
Showing 18 results
Your Answer

Please first to submit.