Author Topic: BASS for Universal Windows Platform (UWP)  (Read 170069 times)

Ian @ un4seen

  • Administrator
  • Posts: 26083
BASS for Universal Windows Platform (UWP)
« on: 30 Jul '15 - 16:42 »
Universal Windows Platform (UWP) versions of BASS and the BASSAPE/DSD/FLAC/HLS/MIDI/OPUS/WV/mix add-ons are available here:

   www.un4seen.com/files/bass24-uwp.zip (updated: 6 Aug '24)

These add-ons are also available:

   www.un4seen.com/stuff/bass_tta-uwp.zip
   www.un4seen.com/files/z/0/bass_fx24-uwp.zip

There are 4 builds of each library, supporting the x86/x64/ARM/ARM64 architectures. A UWP version of the NETRADIO example is also included. The headers and documentation can be taken from the packages on the BASS page.

WASAPI (shared mode) is used for playback and recording. Media Foundation codecs are available in UWP and are supported by BASS, adding support for AAC/MP4 and WMA. An important thing to note is that UWP doesn't allow file/URL opening in the UI thread, so functions like BASS_StreamCreateFile/URL must be called asynchronously.

One feature that hasn't been implemented yet is FTP support. Everything else should be working.
« Last Edit: 6 Aug '24 - 14:44 by Ian @ un4seen »

ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #1 on: 31 Jul '15 - 11:43 »
This is great!

Will it work with Windows 10 IoT (Raspberry Pi 2) ?

/Ken

ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #2 on: 31 Jul '15 - 15:06 »
I tested the "Phone" dll on a Raspberry Pi 2 running Windows 10 IoT but that did not work.

The app is a "Universal Windows" and compiling ARM as its a RaspBerry PI. I get this error when running BassInit

Additional information: Unable to load DLL 'bass.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Code: [Select]

[DllImport("bass.dll", CharSet = CharSet.Unicode, ExactSpelling = false)]
private static extern bool BASS_Init(int device, int freq, int flags, IntPtr win, IntPtr clsid);



Is it possible to get it working on a RaspBerry Pi 2?

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #3 on: 31 Jul '15 - 17:04 »
I haven't tried that yet myself. I will give it a go early next week.

ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #4 on: 31 Jul '15 - 17:49 »
I haven't tried that yet myself. I will give it a go early next week.

Thats great news, Thanks!

I'm running the latest version of Win 10 IoT (10.0.10240.16384)  You find IoT here https://dev.windows.com/en-US/iot

/Ken

rv

  • Posts: 387
Re: BASS for Windows Store/Phone
« Reply #5 on: 31 Jul '15 - 17:59 »
Is it possible to get WASAPI exclusie mode, to get a very low latency?
for future bassmidi :)

lokinfey

  • Posts: 4
Re: BASS for Windows Store/Phone
« Reply #6 on: 1 Aug '15 - 09:09 »
Create news about that ! But I create UWP project , add bass.dll to my debug folder :

My code is

        [DllImport("bass.dll", CharSet = CharSet.Unicode)]
        public static extern bool BASS_Start();

but when I run , it say not found my bass.dll  .


ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #7 on: 1 Aug '15 - 20:11 »
Hi Ian,

I tested the "phone" dll on a Windows 8.1 phone (HTC S8) and I get the same error as on RaspBerry Pi with Win 10 IoT.

This time I used "BASS.Net.Compact" since ita a C# project. I have the bass.dll in the root of the project, "Build Action" is set to "Content" and "CopyToOutputDirectory" is "Copy if never" so the dll should be in the phone.

Quote
{"Unable to load DLL 'bass.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}

/Ken
 

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #8 on: 3 Aug '15 - 16:54 »
I tested the "Phone" dll on a Raspberry Pi 2 running Windows 10 IoT but that did not work.

The app is a "Universal Windows" and compiling ARM as its a RaspBerry PI. I get this error when running BassInit

Additional information: Unable to load DLL 'bass.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Although the error message suggests that BASS.DLL can't be found, I believe it can also be that it's a dependency of BASS.DLL that can't be found rather than BASS.DLL itself. Indeed, it looks like there is one function import that's preventing the Windows Phone BASS version loading on Windows 10; the imported function is in a different DLL in each Windows version. So it looks like a separate build will be needed for Windows 10, and one has now been added to the package in the 1st post. Please re-download to get that and see if you still get the problem with it.

Is it possible to get WASAPI exclusie mode, to get a very low latency?
for future bassmidi :)

BASS doesn't currently provide the option of exclusive mode, but it may be possible to add that option, at least for Windows Store apps (exclusive mode doesn't appear to be available on Windows Phone).

I tested the "phone" dll on a Windows 8.1 phone (HTC S8) and I get the same error as on RaspBerry Pi with Win 10 IoT.

This time I used "BASS.Net.Compact" since ita a C# project. I have the bass.dll in the root of the project, "Build Action" is set to "Content" and "CopyToOutputDirectory" is "Copy if never" so the dll should be in the phone.

Quote
{"Unable to load DLL 'bass.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}

Did you also add a reference to the "Microsoft Visual C++ 2013 Runtime Package"? If not, please try that (it's under "Universal Windows -> Extensions"). Note that won't be necessary with the the new Windows 10 ARM build, as it's using the 2015 runtime (you could add a reference to the "Visual C++ 2015 Runtime" then but that appears to come installed with Win10).

Create news about that ! But I create UWP project , add bass.dll to my debug folder :

My code is

        [DllImport("bass.dll", CharSet = CharSet.Unicode)]
        public static extern bool BASS_Start();

but when I run , it say not found my bass.dll  .

Have you added the BASS.DLL to your project (like ken described above) and also added a reference to the "Microsoft Visual C++ 2013 Runtime Package"? If not, please try that.

ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #9 on: 3 Aug '15 - 19:24 »
Hi Ian,

After adding "Microsoft Visual C++ 2013 Runtime Package" to my Windows Phone 8.1 project, I can call the bass.dll, I can play a local mp3 with "BASS_StreamCreateFile" but when I tested "BASS_StreamCreateURL" I get error: "System.Runtime.InteropServices.SEHException"  I did test the unicode flag.

For Windows 10 IoT I added "Microsoft Visual C++ 2013 Runtime Package" but that did not help, also tested to add "Microsoft Visual C++ 2015 Runtime Package" without success.

/Ken

ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #10 on: 3 Aug '15 - 19:53 »
Hi Ian,

*Update*

I missed that you updated Windows 10. bass.dll now works on Windows 10 IoT, I can play local mp3, but same error as on Windows Phone 8.1 when playing an icecast stream.

When playing an local mp3 I get a "pop" in the speakers just before audio starts and a "pop" when the file is done playing.

"Universal Windows" app don't seam to like the Bass.Net component, so I have to make my own dll import calls to bass.

/Ken

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #11 on: 4 Aug '15 - 13:44 »
Did you make the BASS_StreamCreateURL call asynchronously? If not, please try that. I'm not a C#/.Net user myself, but I think it would look something like this there:

Code: [Select]
Task.Run(() =>
{
int handle = Bass.BASS_StreamCreateURL(...);
Bass.BASS_ChannelPlay(handle, 0);
});

If it's still crashing, please show how you are importing the BASS_StreamCreateURL function.

Regarding the "pop" sounds, does setting the BASS_CONFIG_DEV_NONSTOP option to 1 (via BASS_SetConfig) help with that?
« Last Edit: 4 Aug '15 - 16:52 by Ian @ un4seen »

ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #12 on: 4 Aug '15 - 19:21 »
Did you make the BASS_StreamCreateURL call asynchronously? If not, please try that. I'm not a C#/.Net user myself, but I think it would look
If it's still crashing, please show how you are importing the BASS_StreamCreateURL function.

Regarding the "pop" sounds, does setting the BASS_CONFIG_DEV_NONSTOP option to 1 (via BASS_SetConfig) help with that?

Ian, you C# code works just fine, I can now play a icecaststream. using BASS_CONFIG_DEV_NONSTOP  solve my pop problem, thanks!

Will you release the rest of the bass family (mix, aac, opus, flac, enc, fx) also?

Thanks again for great work!

** Works on Windows 10 IoT and Windows Phone 8.1 for me. AAC+ stream takes lite longer to start than a MP3 stream (icecast).
/Ken


« Last Edit: 5 Aug '15 - 10:13 by ken »

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #13 on: 5 Aug '15 - 12:28 »
Good to hear that things are working well now.

The add-ons will indeed be ported too. That should start soon. If there's a particular add-on that you need ported, feel free to make a request that it's one of the first.

rv

  • Posts: 387
Re: BASS for Windows Store/Phone
« Reply #14 on: 5 Aug '15 - 13:53 »
Bassmidi :)
Very curious to see if I can compile my vb.net low latency synth as universal windows 10 IOT binary for the RPI2

ken

  • Posts: 752
Re: BASS for Windows Store/Phone
« Reply #15 on: 5 Aug '15 - 15:04 »
Good to hear that things are working well now.

The add-ons will indeed be ported too. That should start soon. If there's a particular add-on that you need ported, feel free to make a request that it's one of the first.

bassmix would be nice to have first.

Will it be possible to run encoder, record to mp2,mp3 and opus?

/Kennet

N/A

  • Guest
Re: BASS for Windows Store/Phone
« Reply #16 on: 7 Aug '15 - 13:14 »
What about extensions like flac, ape, opus, alac, aac, wv, etc.!?

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #17 on: 7 Aug '15 - 16:11 »
Will it be possible to run encoder, record to mp2,mp3 and opus?

I don't think separate executables (eg. LAME.EXE) are supported in Windows Store apps, so it wouldn't be possible to use those with BASS_Encode_Start, but it would be possible to build an encoder library (eg. libmp3lame) into your app and use that via BASS_Encode_StartUser.

What about extensions like flac, ape, opus, alac, aac, wv, etc.!?

AAC is already supported by BASS with the help of Media Foundation. FLAC and ALAC too on Windows 10. The rest will be supported once the corresponding add-ons have been ported.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #18 on: 18 Aug '15 - 15:56 »
Windows Store versions of the BASSMIDI and BASSmix add-ons are now up in the 1st post. All of their usual features should be supported, except for MIDI input (BASS_MIDI_InInit/etc) and soundfont packing (BASS_MIDI_FontPack). ARM Windows 10 builds aren't included as the Windows Phone builds should work there. The BASS libraries have also been updated with a little fix to BASS_PluginLoad.

Please report any problems encountered.

mcooper

  • Posts: 53
Re: BASS for Windows Store/Phone
« Reply #19 on: 20 Aug '15 - 14:48 »
Hello,

I'm trying to use bass.net in a windows phone 8.1 (c#) project.  I've added the bass.dll to the project, and reference bass.net.compact.  The project builds and runs, but I get an error when I try to call BASS_StreamCreateFileUser:

{System.EntryPointNotFoundException: Unable to find an entry point named 'BASS_StreamCreateFileUser_' in DLL 'bass.dll'.
   at Un4seen.Bass.Bass.BASS_StreamCreateFileUser_(BASSStreamSystem A_0, BASSFlag A_1, FILECLOSEPROC A_2, FILELENPROC A_3, FILEREADPROC A_4, FILESEEKPROC A_5, IntPtr A_6)
   at Un4seen.Bass.Bass.BASS_StreamCreateFileUser(BASSStreamSystem system, BASSFlag flags, BASS_FILEPROCS procs, IntPtr user)

I've noticed that FILELENPROC and FILESEEKPROC in bass.net.compact have int return types, instead of long (as in bass.net).  Is that the issue?

Should I even be using bass.net.compact?  I also tried bass.net (v 4.0), but I get an error when I try to call BASS_GetDevice():

{System.TypeInitializationException: The type initializer for 'Un4seen.Bass.Bass' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
   at Un4seen.Bass.Bass.a()
   at Un4seen.Bass.Bass.b()
   at Un4seen.Bass.Bass..cctor()
   --- End of inner exception stack trace ---
   at Un4seen.Bass.Bass.BASS_GetDevice()

Thanks,

Matt

radio42

  • Posts: 4839
Re: BASS for Windows Store/Phone
« Reply #20 on: 20 Aug '15 - 16:15 »
I am just about to build a dedicated "Bass.Net.WinStore.dll" version.

As it turns out a dedicated lib/build is needed; which uses the portable framework.
There are till a few issues, as the portable library framework doesn't contain certain classes and options which I am using.
I hope to have something ready be tomorrow or latest over the weekend...

mcooper

  • Posts: 53
Re: BASS for Windows Store/Phone
« Reply #21 on: 21 Aug '15 - 13:16 »
Hello,

I've also noticed problems with HE-AAC (and HE-AAC v2) files, like this sample: http://download.wavetlan.com/SVV/Media/HTTP/AAC/MediaCoder/MediaCoder_test1_HE-AAC_v4_Stereo_VBR_64kbps_44100Hz.m4a

The call to BASS_StreamCreateURL returns a 0 but BASS_ErrorGetCode() returns BASS_OK.

This file (AAC-LC) works though : http://download.wavetlan.com/SVV/Media/HTTP/AAC/iTunes/iTunes_test4_AAC-LC_v4_Stereo_VBR_128kbps_44100Hz.m4a

Thanks,

Matt

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #22 on: 21 Aug '15 - 17:59 »
A few questions to perhaps help narrow down what's wrong... Are you only having problems with the files when opening them from the internet (using BASS_StreamCreateURL), or does it affect local copies of the files (using BASS_StreamCreateFile) too? Can you play them with other (non-BASS) Windows Store apps? Also, are you only having the problem on the Windows Store platform, not on normal Windows?

ileandros

  • Posts: 9
Re: BASS for Windows Store/Phone
« Reply #23 on: 23 Aug '15 - 21:40 »
The dlls provided can't be added on Windows Phone 8.1 applications. They are not compatible.

Ian @ un4seen

  • Administrator
  • Posts: 26083
Re: BASS for Windows Store/Phone
« Reply #24 on: 24 Aug '15 - 14:16 »
Are you trying to use "Add Reference" to add the BASS.DLL file to your project? If so, you should use "Add Existing Item" instead and enable the "Copy to Output Directory" option in the item's properties. If you're using C++, then you should also add BASS.LIB to the linker "Additional Dependencies" (and add its path to "Additional Library Directories"). If you're using C#, then you will currently need to import the functions yourself, eg. using "DllImport". A Windows Store version of BASS.Net to handle that for you should be available soon.