Ayuda con Bass.dll y alguna función.

Aquí puedes preguntar o compartir tus dudas y conocimientos acerca del programa
Hola buenas, hace unos días empecé a tocar las DLL con AMS y gracias al programa de ceone y el ejemplo que viene para la librería bass aprendí a utilizarla para reproducir con el AMS, pero me he encontrado algún problema con alguna función que provoca que el programa se cierre y quería haber si alguien me podría echar una mano.

El ejemplo es este:

HIDE: ON
Hidebb Message Hidden Description


Y el código que me falla es este:
local posicion = DLL.CallFunction(cPathDLL, "BASS_ChannelSetPosition", iDLL..", 100000 ,BASS_POS_BYTES", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
He conseguido abrir la librería, cargar plugins en la misma y hacer una barra de progreso con la reproducción pero un simple "Seek" se me resiste...

Gracias anticipadas ;)
crap:
 "\""..
I would love to see this wonderful work
:yes: :yes: :yes:
Así que te ha dado por exprimir las librerías Bass... ;)
ams8user escribió:crap:
 "\""..
No me ha servido de mucho...
Does AMS give you any errors before just closing?
Tipical windows error "This program has encountered an error and must close" (I think that's the message in english).
local posicion = DLL.CallFunction(cPathDLL, "BASS_ChannelSetPosition", iDLL..", 100000 ,BASS_POS_BYTES", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
You have not defined iDLL anywhere at all in your code this means its getting a blank/nil request I think this is why it might be closing for you without knowing what that iDLL is its hard to see what is happing.

Usted no ha definido el iDLL dondequiera en absoluto en su código que éste significa su conseguir una petición del espacio en blanco/de la nada pienso que esta es la razón por la cual puede ser que sea cerrada para usted sin saber cuál es su duro ese iDLL considerar lo que happing.
Do you have the help file or a website for these DLL's and I think the SetPosition function could be wrong


Usted tiene el archivo de la ayuda o un Web site para estos DLL' s y yo pensamos que la función de SetPosition podría ser incorrecta
In posted code isn't defined but it's defined in APZ:
-- Primer files
cPathDLL = "Autoplay\\docs\\bass.dll";   -- required library (http://www.un4seen.com/)
-- Mod music also supported (some modification in code required) but use for this smaller bassmod.dll

-- Parameters for playing, see included sources and help for bass.dll for more parameters
BASS_MUSIC_MONO = "0";
BASS_MUSIC_LOOP = "0";

-- Initializing, loading and playing (place PlayBassMusic() function in 'On Startup' actions)
function PlayBassMusic(cPathMuz)
	-- Loading dll into the memory
	hDLL = DLL.CallFunction("kernel32.dll", "LoadLibraryA", "\""..cPathDLL.."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); 
	if (hDLL ~= 0) then -- if loaded then
		-- Initializes an output device
		fDll = DLL.CallFunction(cPathDLL, "BASS_Init", "-1,44100,0,0,0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); 
		 if (fDLL ~= 0) then -- if initialized then
			DLL.CallFunction(cPathDLL, "BASS_PluginLoad", "\"Autoplay\\docs\\bassflac.dll\", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
			DLL.CallFunction(cPathDLL, "BASS_PluginLoad", "\"Autoplay\\docs\\bass_aac.dll\", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
			DLL.CallFunction(cPathDLL, "BASS_PluginLoad", "\"Autoplay\\docs\\bass_alac.dll\", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
			DLL.CallFunction(cPathDLL, "BASS_PluginLoad", "\"Autoplay\\docs\\bass_ape.dll\", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
			DLL.CallFunction(cPathDLL, "BASS_PluginLoad", "\"Autoplay\\docs\\bass_mpc.dll\", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
			DLL.CallFunction(cPathDLL, "BASS_PluginLoad", "\"bass_ofr.dll\", 0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
			--Starts the output
		   sDLL = DLL.CallFunction(cPathDLL, "BASS_Start", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); 
		   if (sDLL ~= 0) then -- if successful then
				-- Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file
				-- Please note: new bass.dll v2.4 used in some functions 64-bit parameters (QWORD)
				-- In this case parameters must be doubled (64 = 32 and 32), for example: "result, result, integer, integer"
				iDLL = DLL.CallFunction(cPathDLL, "BASS_StreamCreateFile", "0,\""..cPathMuz.."\", 0, 0, 0, 0,"..BASS_MUSIC_MONO+BASS_MUSIC_LOOP, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
				if (iDLL ~= 0) then
				-- Starts playback of a stream
					DLL.CallFunction(cPathDLL, "BASS_ChannelPlay", iDLL..",1", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
					tam = DLL.CallFunction(cPathDLL, "BASS_ChannelGetLength", iDLL..", BASS_FILEPOS_END", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); 
					Progress.SetRange("Progress1", 0, 100); 
				end 
			end 
		end 
	end 
end 

-- Unload dll from the memory
-- Please note: this function must be called every time before exiting from setup
-- Place it on each screen on 'On Cancel' properties:
--[[
if g_ConfirmSetupAbort() then
    UnloadBassMusic()
	Application.Exit(EXIT_REASON_USER_ABORTED);
end
]]--
-- On finish page place it on 'On Next' (and 'On Cancel') screen properties
--[[
UnloadBassMusic()
Screen.Next();
]]--
function UnloadBassMusic()
	Page.StopTimer(10);
  -- Frees all resources used by the output device, including all its samples, streams and MOD musics
  DLL.CallFunction(cPathDLL, "BASS_Free", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); 
  DLL.CallFunction("kernel32.dll", "FreeLibrary", hDLL, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
end
Bass DLL have an help file but now i can post it.
Yes I found that iDLL was in the play function after thats why I asked about the help file as I trying to see if you have set the SetPoss right, I never used these dlls in the past so was hoping there was info on them.

I have just looked at there website and thats no help at all, maybe you will do better then me, link at bottom of post.

Encontré sí que el iDLL estaba en la función del juego después que es porqué pregunté por el archivo de la ayuda como I que intentaba considerar si usted ha fijado la derecha de SetPoss, yo nunca utilizó estos dlls en el pasado así que esperaba que había Info en ellos. Acabo de mirar allí Web site y ésa no es ninguna ayuda en absoluto, usted me hará quizá mejor entonces, acoplamiento en la parte inferior del poste.

Bass URL:
http://www.un4seen.com/forum/
Maybe i found the problem:

Código: Seleccionar todo

User streams (created with BASS_StreamCreate) are not seekable, but it is possible to reset a user stream (including its buffer contents) by setting its position to byte 0.

And the program just open the file in stream mode:
iDLL = DLL.CallFunction(cPathDLL, "BASS_StreamCreateFile", "0,\""..cPathMuz.."\", 0, 0, 0, 0,"..BASS_MUSIC_MONO+BASS_MUSIC_LOOP, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
Then i've to change the open mode.
thanks you verrrrrrrrrry much
local posicion = DLL.CallFunction(cPathDLL, "BASS_ChannelSetPosition", iDLL..", 100000 ,BASS_POS_BYTES", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);

Primero, eso es una constante, donde está definida? segundo, si fuera un string que no lo es, deberia ir entre \" como bien dice el hijo de puta de ams8 user.

Creo que ese valor viene de ejecutar otra funcion y es lo que deberias buscar
Lo miraré haber si lo encuentro, gracias por la info Pabloko.

Edit: He estado mirando el Source de la DLL y está definido en la misma, pero claro seguramente no pase al AMS y entonces de ahí el error:

Código: Seleccionar todo

#define BASS_POS_BYTE			0		// byte position
Cuando esté en casa intentaré poner en vez de "BASS_POS_BYTE", pondré un 0.
tnx
Haber que se Hace
thanks
Intentare probar con esas soluciones
El link esta caido