DarknessX
01-06-2007, 12:01 AM
Operating System: WindowsXP
Libraries: BASS, slightly modified (to make the Result work)
Compiler: PURE FPC
Ok, well, I've been trying out different types of audio setups, and so far, this is what I've done, in BASS:
{$mode delphi}
program BassTest;
uses bass, crt;
var
x : integer;
error : ansistring;
volume : integer;
begin
error := '';
writeln('Stage 1: Initilization.');
BASS_Init(-1,22040,BASS_DEVICE_SPEAKERS,0,nil);
error := BASS_ErrorGetCode;
if error <> '' then writeln(error) else writeln('Initlization Completed Successfully!');
readkey;
writeln;
writeln('Stage 2: Check Volume.');
volume := BASS_GetVolume;
error := Bass_ErrorGetCode;
if error <> '' then writeln(error) else writeln('Volume Check completed successfully.');
readkey;
writeln;
Writeln('Stage 3: Set Volume.');
writeln('Type a number between 1 and 100 to set the volume. 0 mutes it.');
readln(x);
Bass_SetVolume(x);
error := bass_errorgetcode;
if error <> '' then writeln(error) else begin volume := bass_getvolume; writeln('Set Volume Successfully! Volume is now at: ',volume); end;
readkey;
writeln;
writeln('Stage 4: Load Music File');
bass_musicload(false,'D:\Music\If I Cant.mp3',0,0,BASS_MUSIC_AUTOFREE,0);
error := bass_errorgetcode;
if error <> '' then writeln(error) else writeln('Music loaded successfully!');
readkey;
writeln;
bass_free;
end.
So, my problem being...
...
Parameters
mem TRUE = load the MOD music from memory.
file Filename (mem = FALSE) or a memory location (mem = TRUE).
offset File offset to load the MOD music from (only used if mem = FALSE).
length Data length... 0 = use all data up to the end of file. If length over-runs the end of the file, it'll automatically be lowered to the end of the file.
...
{The code in question is in Stage 4, loading music files, BASS_MusicLoad}
So, as you can see in my code, I have the parameter mem = FALSE. However, I get this annoying error message while trying to compile, yelling at me that the parameter #2 (file) must be a pointer, not an ansistring... So, I tried setting it true. No difference. I'm positive it's looking for something like...
$wholebunchofnumbers ($0040928234)
Maybe not, but is there some way to make it work? I can edit the BASS file, if needed....
Libraries: BASS, slightly modified (to make the Result work)
Compiler: PURE FPC
Ok, well, I've been trying out different types of audio setups, and so far, this is what I've done, in BASS:
{$mode delphi}
program BassTest;
uses bass, crt;
var
x : integer;
error : ansistring;
volume : integer;
begin
error := '';
writeln('Stage 1: Initilization.');
BASS_Init(-1,22040,BASS_DEVICE_SPEAKERS,0,nil);
error := BASS_ErrorGetCode;
if error <> '' then writeln(error) else writeln('Initlization Completed Successfully!');
readkey;
writeln;
writeln('Stage 2: Check Volume.');
volume := BASS_GetVolume;
error := Bass_ErrorGetCode;
if error <> '' then writeln(error) else writeln('Volume Check completed successfully.');
readkey;
writeln;
Writeln('Stage 3: Set Volume.');
writeln('Type a number between 1 and 100 to set the volume. 0 mutes it.');
readln(x);
Bass_SetVolume(x);
error := bass_errorgetcode;
if error <> '' then writeln(error) else begin volume := bass_getvolume; writeln('Set Volume Successfully! Volume is now at: ',volume); end;
readkey;
writeln;
writeln('Stage 4: Load Music File');
bass_musicload(false,'D:\Music\If I Cant.mp3',0,0,BASS_MUSIC_AUTOFREE,0);
error := bass_errorgetcode;
if error <> '' then writeln(error) else writeln('Music loaded successfully!');
readkey;
writeln;
bass_free;
end.
So, my problem being...
...
Parameters
mem TRUE = load the MOD music from memory.
file Filename (mem = FALSE) or a memory location (mem = TRUE).
offset File offset to load the MOD music from (only used if mem = FALSE).
length Data length... 0 = use all data up to the end of file. If length over-runs the end of the file, it'll automatically be lowered to the end of the file.
...
{The code in question is in Stage 4, loading music files, BASS_MusicLoad}
So, as you can see in my code, I have the parameter mem = FALSE. However, I get this annoying error message while trying to compile, yelling at me that the parameter #2 (file) must be a pointer, not an ansistring... So, I tried setting it true. No difference. I'm positive it's looking for something like...
$wholebunchofnumbers ($0040928234)
Maybe not, but is there some way to make it work? I can edit the BASS file, if needed....