Author Topic: BASS_ALAC Errors  (Read 2360 times)

juliomac

  • Posts: 21
BASS_ALAC Errors
« on: 14 Dec '11 - 12:18 »
Hi all,
I have some problems with the Apple Lossless plugin.

If I call the BASS_ALAC_StreamCreateFile with mem = true, passing it a buffer with loaded the AL file, all is working fine.

If I use the BASS_ALAC_StreamCreateFile with mem = false and passing the file path, I have a BASS_ERROR_FILEOPEN error.
I'm calling this method exactly the same way I call BASS_StreamCreateFile and BASS_FLAC_StreamCreateFile, that work just fine, and more, the strange thing is that I receive BASS_ERROR_FILEOPEN when I try to open an Apple Lossless file, while if I try to open another kind of audio file, I receive correctly an BASS_ERROR_FILEFORM error, so I am sure that the file path is passed correctly.
The file I pass to the method has no problem, because loaded on a buffer and passed to BASS_ALAC_StreamCreateFile with mem = true, it plays just fine.

I have a problem also with the BASS_ALAC_StreamCreateFileUser, that returns always  BASS_ERROR_ILLPARAM.
what I am trying to do is to feed the buffer with my own method in PUSH mode, so I call the method this way:

audiocorrente1 = BASS_ALAC_StreamCreateFileUser(STREAMFILE_BUFFERPUSH,0,Bfileproc,nil)

but no HSTREAM is returned and the error is BASS_ERROR_ILLPARAM.
again, I am calling the equivalent methods BASS_StreamCreateFileUser and BASS_ALAC_StreamCreateFileUser exactly the same way and they are working, so I can't figure where the problem is...

thank you in advance!

     Giulio

Ian @ un4seen

  • Administrator
  • Posts: 20427
Re: BASS_ALAC Errors
« Reply #1 on: 14 Dec '11 - 16:33 »
If I use the BASS_ALAC_StreamCreateFile with mem = false and passing the file path, I have a BASS_ERROR_FILEOPEN error.

If you are certain that the filename/path is correct, then one possibility is that the filename is in Unicode form while BASS is expecting ANSI, or vice versa. You could try adding/removing the BASS_UNICODE flag to/from the call. If you happen to be using Delphi, you can use the "UNICODE" symbol to determine what to do (see the examples in the BASS package).

I have a problem also with the BASS_ALAC_StreamCreateFileUser, that returns always  BASS_ERROR_ILLPARAM.
what I am trying to do is to feed the buffer with my own method in PUSH mode, so I call the method this way:

audiocorrente1 = BASS_ALAC_StreamCreateFileUser(STREAMFILE_BUFFERPUSH,0,Bfileproc,nil)

Unfortunately, BASS_ALAC doesn't currently support the buffered file system (STREAMFILE_BUFFER/PUSH). Only the unbuffered system (STREAMFILE_NOBUFFER) is supported.

juliomac

  • Posts: 21
Re: BASS_ALAC Errors
« Reply #2 on: 14 Dec '11 - 17:13 »
If you are certain that the filename/path is correct, then one possibility is that the filename is in Unicode form while BASS is expecting ANSI, or vice versa. You could try adding/removing the BASS_UNICODE flag to/from the call. If you happen to be using Delphi, you can use the "UNICODE" symbol to determine what to do (see the examples in the BASS package).

Thanks for your answer, I'm using a cross-platform RAD called REALBasic ( I would love to have some examples in RB ), and already tryed to add the BASS_UNICODE flag.
but my problem, to be sincerely, is that I'm not yet absolutely sure to pass in RB the correct values when there is a combination of flags (
Maybe there's some debug function that let me see the flags received from the method? - just to be sure sending correct flags...

Ian @ un4seen

  • Administrator
  • Posts: 20427
Re: BASS_ALAC Errors
« Reply #3 on: 14 Dec '11 - 17:46 »
I think you would generally use "Or" to combine flags in Basic languages.

Are you using the Visual Basic modules (eg. BASS.BAS) or rolling your own? If the latter, be sure to pay attention to the 64-bit parameters. I'm not familiar with REALBasic, but Visual Basic doesn't support 64-bit integers, so they are split into 2x 32-bit parameters (with wrapper functions) for that.

juliomac

  • Posts: 21
Re: BASS_ALAC Errors
« Reply #4 on: 14 Dec '11 - 18:09 »
I think you would generally use "Or" to combine flags in Basic languages.

yes, Im using OR, but for some misterious reason it seems that I must also perform a 1 bit shift left of the result. don't ask me why :)
It's the result os some empirical tests, but it seems to work, at least with other BASS methods

Are you using the Visual Basic modules (eg. BASS.BAS) or rolling your own? If the latter, be sure to pay attention to the 64-bit parameters. I'm not familiar with REALBasic, but Visual Basic doesn't support 64-bit integers, so they are split into 2x 32-bit parameters (with wrapper functions) for that.

I'm rolling my own, taking a look to the delphi examples
But in REALBasic I have Uint64, representing 64 bit integers, so this should not be the problem

I'll keep on trying, and think I'm going to but soon this excellent tool
Thank you!