Results 1 to 5 of 5

Thread: BASS, Compile Issues

  1. #1

    BASS, Compile Issues

    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:
    [pascal]
    {$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.
    [/pascal]

    So, my problem being...

    Quote Originally Posted by Bass Documentation
    ...
    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....
    --MagicRPG--

  2. #2

    BASS, Compile Issues

    I've never used BASS personally, but this looks like it might be what you're looking for.

    Procedure TBass.load(name:string;num:integer);
    var
    p : PChar;
    Begin
    p := PChar(name);

    stream[num] :=BASS_StreamCreateFile(FALSE,p,0,0,0);
    if (stream[num] = 0) then begin end;
    End;

  3. #3

    BASS, Compile Issues

    Ahah! Thanks, Jason! Exactly what I needed, I never thought of using a Pchar

    Well, now just to figure out how to load .mp3's, and not mod files

    It seems that particular function won't load a basic mp3.

    Well, just figured that one out too Need to load a sample, not a MOD.
    --MagicRPG--

  4. #4

    BASS, Compile Issues

    MUSIC functions are for modules, STREAM functions are for MP3s. They store the same type of result (a handle) so it isn't hard to store them and have a binary flag to indicate which is what.

  5. #5

    BASS, Compile Issues

    Yeah, I just figured that out as you replied Thanks anyways though.
    --MagicRPG--

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •