Author Topic: Integrating BASS with Flutter: BASS_StreamCreateURL problem  (Read 144 times)

teq

  • Posts: 78
Hi there!
It works fine, except when i run debug/release build which is connected to the Android Studio. In this case i got Error code 5(BASS_ERROR_HANDLE) when trying to play stream handle. I understand that the problem is very abstract, but maybe you could tell me something =)

Ian @ un4seen

  • Administrator
  • Posts: 24784
That looks like the BASS_StreamCreateURL call probably failed, so you got a 0 handle and a BASS_ERROR_HANDLE error when you try to play it. Please check the returned handle and error code from the BASS_StreamCreateURL call.

teq

  • Posts: 78
That looks like the BASS_StreamCreateURL call probably failed, so you got a 0 handle and a BASS_ERROR_HANDLE error when you try to play it. Please check the returned handle and error code from the BASS_StreamCreateURL call.
Thanks for the answer! streamHandle = 0, error code = 2 (BASS_ERROR_FILEOPEN)

Ian @ un4seen

  • Administrator
  • Posts: 24784
OK. That means it was unable to open the URL for some reason. Are you have the problem with all URLs or only a particular one?

Please see if you can reproduce the problem with the NETRADIO example that's included in the BASS package.

teq

  • Posts: 78
OK. That means it was unable to open the URL for some reason. Are you have the problem with all URLs or only a particular one?

Please see if you can reproduce the problem with the NETRADIO example that's included in the BASS package.
I tried many urls(http or https) and used my working code structure from C# project.
Code: [Select]
bass.BASS_SetConfig(BASS_CONFIG_DEV_NONSTOP, 1);

                      // set the device update period to 5ms
                      bass.BASS_SetConfig(BASS_CONFIG_DEV_PERIOD, 5);

                      // set the device buffer length on Android
                      if (Platform.isAndroid) {
                        bass.BASS_SetConfig(BASS_CONFIG_DEV_BUFFER, 10);
                      }

                      // set the update period to 5ms
                      bass.BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 5);

                      // set the buffer length to 12ms
                      bass.BASS_SetConfig(BASS_CONFIG_BUFFER, 12);

                      // disable ramping-in only: NORAMP is not defined?!?
                      //bass.BASS_SetConfig(BASS_CONFIG_NORAMP, 2);

                      // BASS_Init: -1 = default device, 44100 = sample rate, 0 = flags
                      if (Platform.isIOS) {
                        bass.BASS_Init(-1, 44100, 0, ffi.nullptr, ffi.nullptr);
                      } else if (Platform.isAndroid) {
                        bass.BASS_Init(-1, 48000, 0, ffi.nullptr, ffi.nullptr);
                      }
int streamHandle = bass.BASS_StreamCreateURL(
                        remoteFileName.toNativeUtf8().cast<ffi.Int8>(),
                        0,
                        0,
                        ffi.nullptr,
                        ffi.nullptr,
                      );
int result = bass.BASS_ChannelPlay(streamHandle, 0);