Author Topic: Android - Playback issue on reading a M4A file containing ALAC data  (Read 120 times)

jnyang

  • Guest
Hello,

I am using BASS with plugins (e.g., BASSALAC) on Android.
I am currently facing with a playback issue on a M4A file that contains ALAC audio data.
I uploaded an example file on the FTP (ftp.un4seen.com/incoming/).

The BASS and BASSALAC plugin are initialized. Then, when my app tries to load that file via BASS_StreamCreateFile, it loads successfully without any problems.
However, when that same file is loaded via BASS_StreamCreateFileUser with a custom callback, the BASS tries to play it but outputs strange noises. It seems that BASS plays with a corrupted data.

The latest stable BASS build (not the stuff build) and its plugins are used.
Can you check this issue?

Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 23553
I didn't try it on Android yet, but I did give that ALAC file a quick try with BASS_StreamCreateFileUser on Windows just now, and it played fine. To narrow down what the problem you're having is, are other ALAC files working OK with the same code, and if not, are other file formats working? Please also check the stream's "ctype" value with BASS_ChannelGetInfo, to confirm whether BASSALAC is handling it. Also confirm what "system" value you're using in the BASS_StreamCreateFileUser call (it should be STREAMFILE_NOBUFFER to replicate BASS_StreamCreateFile).

jnyang

  • Guest
Hi Ian,

I was using BASS_StreamCreateFileUser with "STREAMFILE_BUFFERPUSH" option, because the file data is from the network storage. I also checked the channel type and it was BASS_CTYPE_STREAM_ALAC (0x10e00) for both BASS channels created with BASS_StreamCreateFile and BASS_StreamCreateFileUser (with the STREAMFILE_BUFFERPUSH option).

I tried to load that file with "STREAMFILE_NOBUFFER" and BASS loads that file well without any issue. But when I changed it to "STREAMFILE_BUFFERPUSH" or even "STREAMFILE_BUFFER", then that issue happens. So I think it is related to the buffered BASSALAC channel.

Notice that the same code works well with the other file formats.

I couldn't check this issue on my computer because I am using macOS, which handles ALAC formats by OS codecs, not BASS's plugin.

Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 23553
I was using BASS_StreamCreateFileUser with "STREAMFILE_BUFFERPUSH" option, because the file data is from the network storage. I also checked the channel type and it was BASS_CTYPE_STREAM_ALAC (0x10e00) for both BASS channels created with BASS_StreamCreateFile and BASS_StreamCreateFileUser (with the STREAMFILE_BUFFERPUSH option).

I tried to load that file with "STREAMFILE_NOBUFFER" and BASS loads that file well without any issue. But when I changed it to "STREAMFILE_BUFFERPUSH" or even "STREAMFILE_BUFFER", then that issue happens. So I think it is related to the buffered BASSALAC channel.

Ah, there is indeed an issue when using the buffered file system. Here's a BASSALAC update that should fix it:

   www.un4seen.com/stuff/bassalac-android.zip

Let me know if you still see the problem happen with that.

jnyang

  • Guest
It works pretty well. Thanks, Ian! :)