|
alter
Posts: 10
|
 |
« Reply #200 on: 27 Apr '10 - 15:46 » |
Quote
|
I've got one problem with it. I am using FPC 2.4 if that matters.
I have Bass_StreamCreateURL declared as: function BASS_StreamCreateURL(url: PChar; offset: DWORD; flags: DWORD; proc: DOWNLOADPROC; user: Pointer):HSTREAM; stdcall; external bassdll;
When I use:
tmpChannel := BASS_StreamCreateURL(Pchar(URL2), 0, OpenFlag, nil, nil);
tmpChannel is always 0 and error code is BASS_ERROR_ILLPARAM(20). OpenFlag is 0. I've tried a few combinations also with pwidechar or/and BASS_UNICODE but still no success.
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15276
|
 |
« Reply #201 on: 28 Apr '10 - 18:09 » |
Quote
|
BASS_ERROR_ILLPARAM indicates that the URL ("URL2") is malformed. If it's not a Unicode issue (it happens with and without the BASS_UNICODE flag), check that the URL includes a protocol, eg. "http://" or "ftp://".
|
|
|
|
|
Logged
|
|
|
|
|
Anglachel
Posts: 1
|
 |
« Reply #202 on: 29 Apr '10 - 22:20 » |
Quote
|
Can anyone please give me a program for generating 3D positional Audio in BASS.NET? I need to implement that on Win CE platform... Thanks alot!
|
|
|
|
|
Logged
|
|
|
|
|
thyphuong
Posts: 2
|
 |
« Reply #203 on: 12 May '10 - 05:43 » |
Quote
|
I'm working on a windows mobile 6.0 Pro and facing a problem with "Can't PInvoke bass.dll". So I follow that solution It is pretty much like regular development. You don't reference the bass.dll in your project, you just need to make sure, that the bass.dll exists in your executable directory on the mobile device. When using an emulator (and not a real device), you might need to copy the bass.dll to your emulator's folder manually, e.g. using the "Windows Mobile Device Center" application. Then I copy bass.dll into the same folder of base.net.compact but not working. Still the same exception. Something I'm wrong?  Update: I updated the newest version of bass.dll and now exception has gone but there's other issue that my stream always get value 0. stream = Bass.BASS_StreamCreateURL(strUrl, 0, 0, null, IntPtr.Zero); Bass.BASS_ChannelPlay(stream, false); Update2: I found the solution here OKi, I just had a chat with Ian. The UNICODE flag isn't included in the official version yet. So here is a new version of BASS.NET, in which I don't use the UNICODE flag anymore. Please (re)download and try again: www.un4seen.com/filez/4/Bass24.Net_pre.zipBut it seems not to be used for windows mobile 6.0. Is there any update for bass.dll for compact framework that fixed the problem of StreamCreateUrl return 0
|
|
|
|
« Last Edit: 12 May '10 - 08:39 by thyphuong »
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15276
|
 |
« Reply #204 on: 12 May '10 - 16:29 » |
Quote
|
To determine whether it is a general BASS issue or .Net-specific, please try to reproduce the problem with the pre-compiled NETRADIO.EXE example. If the presets work in that but your URL doesn't, please also provide the troublesome URL to have a look at.
|
|
|
|
|
Logged
|
|
|
|
|
thyphuong
Posts: 2
|
 |
« Reply #205 on: 13 May '10 - 03:13 » |
Quote
|
Thanks Ian, my bad. my ISP blocked all mp3 files without telling me. the bass.dll and bass_compact.dll work amazing.
|
|
|
|
|
Logged
|
|
|
|
|
alter
Posts: 10
|
 |
« Reply #206 on: 26 May '10 - 00:08 » |
Quote
|
BASS_ERROR_ILLPARAM indicates that the URL ("URL2") is malformed. If it's not a Unicode issue (it happens with and without the BASS_UNICODE flag), check that the URL includes a protocol, eg. "http://" or "ftp://".
Thx, I've checked my code yet another time and I found that I've overlooked one line and parameter was indeed messed up but now it's working well. I have tried both BASS itself and .Net bindings. And now I have a question is there any preview of WMA or/and AAC plugins?
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15276
|
 |
« Reply #207 on: 26 May '10 - 16:50 » |
Quote
|
No, I'm afraid there aren't currently BASSWMA and BASS_AAC versions available for WinCE. In the case of BASSWMA, the required system libraries/APIs aren't available, and in the case of BASS_AAC, it would need to be modified to use fixed-point math due to the lack of an FPU. There is a DirectShow WMA codec available and a BASSDS add-on to make use of that, but the codec is not included in Windows Mobile. If you are using a WinCE platform that does include the codec (WMADMOD.DLL), I can send you the BASSDS add-on to try.
|
|
|
|
|
Logged
|
|
|
|
|
mabo42
Posts: 4
|
 |
« Reply #208 on: 19 Jun '10 - 12:14 » |
Quote
|
Hello Ian,
I've been testing the bass.dll for WinCE since a couple of days. I am using both a LG750GM (WinMo 6.5) and the Visual Studio Emulator (Window Mobile 6.5 Professional WQVGA Emulator). Most is running fine so far, but there are problems with all position/length related functions
BASS_ChannelGetLength BASS_ChannelGetPosition BASS_ChannelSetPosition BASS_ChannelBytes2Seconds BASS_ChannelSeconds2Bytes
These are all throwing a NotSupportedException, both on the device and on the emulator. The bass.dll is of version 2.4.5.18 (created on March, 3rd, 2010 March, 31, 2010). Isn't that not the current version? Are the problems already reported by others? Any help or hints would be very appreciated.
|
|
|
|
« Last Edit: 19 Jun '10 - 12:17 by mabo42 »
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15276
|
 |
« Reply #209 on: 21 Jun '10 - 18:02 » |
Quote
|
Please confirm how you are using BASS on WinCE. It sounds like you may be using .Net? If so, are you using the "compact" BASS.Net version posted in this thread (see 1st post), or are you rolling your own?
|
|
|
|
|
Logged
|
|
|
|
|
mabo42
Posts: 4
|
 |
« Reply #210 on: 21 Jun '10 - 20:38 » |
Quote
|
Yes you are right, ist .NET / C#. Simple code with a handful P/Invokes: public partial class Form1 : Form { private int stream = 0;
public Form1() { InitializeComponent(); BASS_Init(-1, 44100, 0, IntPtr.Zero, IntPtr.Zero); // works fine }
private void btnClose_Click(object sender, EventArgs e) { BASS_Free(); // works fine Close(); }
private void btnPlay_Click(object sender, EventArgs e) { stream = BASS_StreamCreateFile(0, @"\Storage Card\test.mp3", 0, 0, BASS_DEFAULT | BASS_UNICODE); // works fine //long byteLen = BASS_ChannelGetLength(stream, BASS_POS_BYTES); // this line throws NotSupportedException BASS_ChannelPlay(stream, 1); // works fine }
private const int BASS_DEFAULT = 0; private const int BASS_UNICODE = -2147483648; private const int BASS_POS_BYTES = 0;
[DllImport("bass", CharSet = CharSet.Auto)] private static extern int BASS_Init(int device, int freq, int flags, IntPtr hwnd, IntPtr clsid);
[DllImport("bass", CharSet = CharSet.Auto)] private static extern int BASS_Free();
[DllImport("bass", CharSet = CharSet.Auto)] private static extern int BASS_StreamCreateFile(int memory, string file, long offset, long length, int flags);
[DllImport("bass", CharSet = CharSet.Auto)] private static extern long BASS_ChannelGetLength(int handle, int mode);
[DllImport("bass", CharSet = CharSet.Auto)] private static extern int BASS_ChannelPlay(int handle, int restart); }
Is there any wrong with the P/Invoke signatures? Or could it be, there is a problem with Windows Mobile 6.5?
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #211 on: 21 Jun '10 - 22:22 » |
Quote
|
Yes, there are a couple of issues - not really with your signature - but more with marshaling limitations of the .Net compact framework. These things have been worked out in the Bass.Net_compact version - so you might simply try the Bass.Net_compact version instead of your own...
|
|
|
|
|
Logged
|
|
|
|
|
mabo42
Posts: 4
|
 |
« Reply #212 on: 22 Jun '10 - 08:47 » |
Quote
|
Hello radio42,
thanks for your advice. I can get hand on my dev env this evening, I will try then and inform you. But marshaling problems with a method "long method(int, int)", that I would have thought as a last.
Thanks again Matthias
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #213 on: 22 Jun '10 - 09:11 » |
Quote
|
Yes, the .Net compact framework (beside other limits) doesn't support unmanaged function calls which return a 'long' or 'float' value.
|
|
|
|
|
Logged
|
|
|
|
|
mabo42
Posts: 4
|
 |
« Reply #214 on: 22 Jun '10 - 16:29 » |
Quote
|
Hi radio42, I followed your advice and have used the Bass.Net_compact version. Everything now works as described  You've convinced me to go with your wrapper and not to p/invoke my own. It's more than a wrapper, actually it's a Managed-Bass-on-WinCE-survival-kit ... Thanks for your efforts and the great lib. Greetings Matthias
|
|
|
|
|
Logged
|
|
|
|
|
whitevv
Guest
|
 |
« Reply #215 on: 20 Jul '10 - 10:32 » |
Quote
|
Hello I'm try recording from mic, but nothing not working on WinCE, but working on the WinXP:'( Why Driver name is null? Code: procedure TForm1.Button2Click(Sender: TObject); var R:Dword; info: BASS_DEVICEINFO; info1: BASS_INFO; info2: BASS_RECORDINFO; begin r:= BASS_GetDevice(); Log('BASS_GetDevice='+IntToStr(r)); if not BASS_GetDeviceInfo(r,info) Then Log('BASS_GetDeviceInfo='+IntToStr(r)+'-err') else Begin log('BASS_GetDeviceInfo'); log('Driver='+info.driver); log('Name='+info.name); log('Flag='+IntToStr(info.flags)); end; r:= BASS_ErrorGetCode(); Log('BASS_ErrorGetCode='+IntToStr(r));
IF BASS_GetInfo(info1) Then Log('BASS_GetInfo=OK') else Log('BASS_GetInfo=Err'); Log('Flag='+IntToStr(info1.flags)); Log('hwsize='+IntToStr(info1.hwsize)); Log('hwfree='+IntToStr(info1.hwfree)); Log('freesam='+IntToStr(info1.freesam)); Log('free3d='+IntToStr(info1.free3d)); Log('minrate='+IntToStr(info1.minrate)); Log('maxrate='+IntToStr(info1.maxrate)); Log('minbuf='+IntToStr(info1.minbuf)); Log('dsver='+IntToStr(info1.dsver)); Log('latency='+IntToStr(info1.latency)); Log('initflags='+IntToStr(info1.initflags)); Log('speakers='+IntToStr(info1.speakers)); Log('freq='+IntToStr(info1.freq));
BASS_RecordGetInfo(info2);
Log('BASS_RecordGetInfo'); Log('Flag='+IntToStr(info2.flags)); Log('formats='+IntToStr(info2.formats)); Log('freq='+IntToStr(info2.freq)); Log('inputs='+IntToStr(info2.inputs)); Log('singlein='+BoolToStr(info2.singlein)); end; Output: BASS_GetDevice=1 BASS_GetDeviceInfo Driver= Name=A Flag=7 BASS_ErrorGetCode=0 BASS_GetInfo=OK Flag=0 hwsize=0 hwfree=0 freesam=0 free3d=0 minrate=0 maxrate=0 minbuf=66 dsver=0 latency=166 initflags=256 speakers=2 freq=44100 BASS_RecordGetInfo Flag=0 formats=0 freq=0 inputs=1 singlein=-1
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15276
|
 |
« Reply #216 on: 20 Jul '10 - 17:14 » |
Quote
|
The BASS_DEVICEINFO "driver" value is always NULL in the WinCE version. Another thing is that the "name" string is Unicode in the WinCE version, so you would need to change the "PAnsiChar" to "PWideChar" there. Perhaps BASS.PAS could be modified like this... // Device info structure BASS_DEVICEINFO = record {$ifdef wince} name: PWideChar; // description driver: PWideChar; // driver {$else} name: PAnsiChar; // description driver: PAnsiChar; // driver {$endif} flags: DWORD; end;
Regarding the recording problem... you appear to be using BASS_GetDeviceInfo above; should that be BASS_RecordGetDeviceInfo? To see if the problem may be something particular to your app, is the pre-compiled RECTEST.EXE example (in the WinCE package) working?
|
|
|
|
|
Logged
|
|
|
|
|
whitevv
Guest
|
 |
« Reply #217 on: 20 Jul '10 - 18:56 » |
Quote
|
Thank's for explanations. I try modify bass.pas tomorrow. RECTEST.EXE - is working
|
|
|
|
|
Logged
|
|
|
|
|
Rawukal
Posts: 3
|
 |
« Reply #218 on: 29 Jul '10 - 06:18 » |
Quote
|
Hi, I am developing on Win CE 6. I tested the webradio sample successfully. After a view changes in the BSP of my Win CE the sample doesn't work anymore. So is there a list which catalog items has to be checked, so that the BASS Lib is fully functional?
Kind Regards
|
|
|
|
|
Logged
|
|
|
|
|
Ian @ un4seen
Administrator
Posts: 15276
|
 |
« Reply #219 on: 29 Jul '10 - 13:47 » |
Quote
|
Is it only the internet streaming that isn't working, eg. you can still initialize BASS? If so, perhaps you are missing SYSGEN_WININET?
|
|
|
|
|
Logged
|
|
|
|
|