Author Topic: Sound plays intermittently when the audios are on drive connected to USB 3.0  (Read 143 times)

Ferry

  • Guest
I am using BASS across dart:ffi on Windows 10 and Windows 11. As mentioned in subject, the sound is intermittenly.
Quote
when i add folder at USB hard drives, the sound is intermittent.
And this problem was gone when i was using a SSD or an HDD which connected with SATA to my computer directly.
Mine is a HDD (USB 3.0). I have tested these connections:
1.the HDD to a USB2.0 port.
2.a USB drive to the 2.0 port.
3.another HDD to the 2.0 port.
4.the USB drive to a 3.0 port.
5.the HDD (in connection 3) to the 3.0 port.
and both it worked properly.
But the problem(intermitten sound) was still there when i read files from that drive connected to that 3.0 port.
This is my code:
I init BASS with this code.
Code: [Select]
final dyLibPath = path.join(path.dirname(Platform.resolvedExecutable), 'bass.dll');
_dyLib = ffi.DynamicLibrary.open(dyLibPath);
_bass = Bass(_dyLib);
_bass.BASS_Init(1, 48000, 0, ffi.nullptr, ffi.nullptr);
Then play the audio.
Code: [Select]
final pathPointer = path.toNativeUtf16() as ffi.Pointer<ffi.Void>;
_fstream = _bass.BASS_StreamCreateFile(FALSE, pathPointer, 0, 0, BASS_UNICODE);
_bass.BASS_ChannelStart(_fstream!);
Could anyone give me some infomation about it? Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 25780
Enabling asynchronous file reading/buffering may help. You can do that by adding the BASS_ASYNCFILE flag to your BASS_StreamCreateFile call.