BASS for WinCE

Started by Ian @ un4seen, 2 Mar '09 - 16:46

Ian @ un4seen

OK. I'll send you a debug version to get some info on what's happening there.

Rawukal

Hi,
is it possible to play an mms stream with the bass CE Library?

Greetings

Ian @ un4seen

I'm afraid there isn't a BASSWMA build for WinCE, as the required system libraries/APIs aren't available, but there is a DirectShow WMA codec available and a BASSDS add-on to make use of that. The codec isn't included in Windows Mobile, but if you are using a WinCE platform that does include the codec (WMADMOD.DLL), I can send you the BASSDS add-on to try.

Rawukal

Hi,
thank you for your answere.
Specifically i use WinCe 6. I tested a mms stream with the included MediaPlayer (ceplayer.exe).
Does this app use the same .dll?
I would be glad that you can send me the plugin. Is there a .net Version?

Greetings

whitevv

#229
Hello Ian@un4seen,
I have changed the device and i not have any problems above, possible problem was in my hardware.  :)

I have other question:
There is possibility of the simultaneous start 2х instance BASS.DLL with different sample rate , or there is other way of the decision?

I need get simultaneously importance of the amplitudes for each frequency with different stepping frequencies(from 16 to 100Hz step 1 Hz and from 100 to 16000Hz Step 5 HZ)

i use
BASS_Init(-1, 44100, BASS_DEVICE_MONO, handle, nil);
Bass_ChannelGetData(chan, @data, BASS_DATA_FFT8192);  

Ian @ un4seen

I think it would be possible to dynamically load (eg. LoadLibrary) a renamed 2nd BASS.DLL, but I'm not sure that is what you really need, as BASS_ChannelGetData calls are not affected by the BASS_Init sample rate. Perhaps you want to create additional "chan" with different sample rates?

whitevv

thank you, I really may use different chan.

whitevv

Hello Ian@un4seen,
I make application with using 2 BASS_RecordStart.
In Microsoft Device Emulator V3  - working is  good.
But on hardware device, work only one BASS_RecordStart.
Second return BASS_ErrorGetCode=BASS_ERROR_DRIVER;

Procedure log(S:String);
Begin
 Form1.Memo1.Lines.Add(S);
end;   

procedure TForm1.FormCreate(Sender: TObject);

begin

 BASS_Init(-1, 44100, 0, handle, nil)
 if not r_init := BASS_RecordInit(0) then log('Can''t initialize device');

 chan := BASS_RecordStart(11025, 1, 0, @RecordingCallback, nil); // line 1
 Log('1BASS_ErrorGetCode='+IntToStr(BASS_ErrorGetCode()));                                       

 chan2 := BASS_RecordStart(44100, 1, 0, @RecordingCallback2, nil);  // line2
 Log('2BASS_ErrorGetCode='+IntToStr(BASS_ErrorGetCode()));

end;

i have error to chan2, if i replace line1 and line2, to I have error to chan



Ian @ un4seen

That looks like the device doesn't support multiple simultaneous recordings. I'll send you a debug version to confirm things.

whitevv

#234
I see registry on my hardware device, it use K3_ASP_WAVEDEV2.dll driver.
In emulator using s3c2410x_wavedev.dll driver.
If on hardware i run 2 simultaneously application my and sectrum, they worked good.

Maybe you may give application for testing two stream simultaneously.

hiddenman37

Hi;

I'm using visual studio 2008 and windows mobile emulator 6 and using VB. Same codes is working. It works but this code is not working. I'm getting "Notsupportedexception" error message for BASS_POS_BYTES.

But this code is working in vista or xp (x86 mode). How to fix it.

Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Integer) As Integer
Declare Function BASS_GetVolume Lib "bass.dll" () As Double
Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long
Declare Function BASS_ChannelBytes2Seconds Lib "bass.dll" (ByVal handle As Integer, ByVal pos As Long) As Double
Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long


Dim SongTime As Long               
SongTime = BASS_ChannelBytes2Seconds(STREAM, Bass.BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES))


radio42

Are you using the Bass.Net_compact version with it?
Or have you declared your own functions?

hiddenman37

Yes.

Imports System.IO
Imports Un4seen.Bass
Imports Un4seen.Bass.Misc
Imports Un4seen.Bass.AddOn.Wma
Imports Un4seen.Bass.AddOn.Tags
Imports Un4seen.Bass.AddOn.Enc



Module BassMod

    Structure BASS_DX8_REVERB           ' DSFXWavesReverb
        Dim fInGain As Single           ' [-96.0,0.0]            default: 0.0 dB
        Dim fReverbMix As Single        ' [-96.0,0.0]            default: 0.0 db
        Dim fReverbTime As Single       ' [0.001,3000.0]         default: 1000.0 ms
        Dim fHighFreqRTRatio As Single  ' [0.001,0.999]          default: 0.001
    End Structure

    Structure BASS_DX8_FLANGER ' DSFXFlanger
        Dim fWetDryMix As Single
        Dim fDepth As Single
        Dim fFeedback As Single
        Dim fFrequency As Single
        Dim lWaveform As Integer ' 0=triangle, 1=sine
        Dim fDelay As Single
        Dim lPhase As Integer ' BASS_FX_PHASE_xxx
    End Structure

    Structure BASS_DX8_ECHO ' DSFXEcho
        Dim fWetDryMix As Single
        Dim fFeedback As Single
        Dim fLeftDelay As Single
        Dim fRightDelay As Single
        Dim lPanDelay As Integer
    End Structure

    Structure BASS_DX8_PARAMEQ
        Dim fCenter As Single
        Dim fBandwidth As Single
        Dim fGain As Single
    End Structure



    'Sound
    Public FLeftPos As Integer
    Public AMaster As Single
    Public StreamPos As Double
    Public StreamLength As Double
    Public StreamInfo As BASS_CHANNELINFO

    Public IniECHO As Integer
    Public IniECHO_OnOff As Boolean = False
    Public IniFLANGER As Integer
    Public IniFLANGER_OnOff As Boolean = False
    Public IniREVERB As Integer
    Public IniREVERB_OnOff As Boolean = False
    Public IniEQ1 As Integer = 0
    Public IniEQ2 As Integer = 0
    Public IniEQ3 As Integer = 0
    Public IniEQ4 As Integer = 0
    Public IniEQ5 As Integer = 0
    Public IniEQ6 As Integer = 0
    Public IniEQ7 As Integer = 0
    Public IniEQ8 As Integer = 0
    Public IniEQ9 As Integer = 0
    Public IniEQ10 As Integer = 0

    Public xEQU As BASS_DX8_PARAMEQ
    Public xECHO As BASS_DX8_ECHO
    Public xFLANGER As BASS_DX8_FLANGER
    Public xREVERB As BASS_DX8_REVERB

    Public FX(13) As Int32


    Public flags As Integer


    '************************
    '* Initialization flags *
    '************************
    Public Const BASS_DEVICE_8BITS As Short = 1 'use 8 bit resolution, else 16 bit
    Public Const BASS_DEVICE_MONO As Short = 2 'use mono, else stereo
    Public Const BASS_DEVICE_3D As Short = 4 'enable 3D functionality
    ' If the BASS_DEVICE_3D flag is not specified when initilizing BASS,
    ' then the 3D flags (BASS_SAMPLE_3D and BASS_MUSIC_3D) are ignored when
    ' loading/creating a sample/stream/music.
    Public Const BASS_DEVICE_LATENCY As Short = 256 'calculate device latency (BASS_INFO struct)
    Public Const BASS_DEVICE_SPEAKERS As Short = 2048 'force enabling of speaker assignment


    Public Function MakeLong(ByRef LoWord As Integer, ByRef HiWord As Integer) As Integer
        'Replacement for the c++ Function MAKELONG
        MakeLong = (LoWord And &HFFFF) Or (HiWord * &H10000)
    End Function

    Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Integer) As Integer
    Declare Function BASS_GetVolume Lib "bass.dll" () As Double
    Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long
    Declare Function BASS_ChannelBytes2Seconds Lib "bass.dll" (ByVal handle As Integer, ByVal pos As Long) As Double
    'Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Long

    Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Integer, ByVal Mode As BASSMode) As Int64

    'Declare Function BASS_Init Lib "bass.dll" (ByVal device As Integer, ByVal freq As UInteger, ByVal flags As UInteger, ByVal win As IntPtr, ByVal clsid As UInteger) As Boolean
    'Declare Function BASS_Free Lib "bass.dll" () As Boolean
    'Declare Function BASS_ChannelStop Lib "bass.dll" (ByVal handle As IntPtr) As Boolean
    'Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As IntPtr, ByVal mode As Integer) As Integer
    'Declare Function BASS_StreamFree Lib "bass.dll" (ByVal handle As IntPtr) As Boolean
    'Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As IntPtr, ByVal mode As Integer) As Integer
    'Declare Function BASS_ChannelPlay Lib "bass.dll" (ByVal handle As IntPtr, ByVal restart As Boolean) As Boolean
    'Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Single) As Boolean
    'Declare Function BASS_StreamCreateFile Lib "bass.dll" Alias "BASS_StreamCreateFile" (ByVal mem As Boolean, ByVal file As String, ByVal offset As UInteger, ByVal offsethigh As UInteger, ByVal length As UInteger, ByVal lengthhigh As UInteger, ByVal flags As UInteger) As IntPtr
    'Declare Function BASS_SampleLoad Lib "bass.dll" Alias "BASS_SampleLoad" (ByVal mem As Boolean, ByVal file As String, ByVal offset As UInteger, ByVal offsethigh As UInteger, ByVal length As UInteger, ByVal max As UInteger, ByVal flags As UInteger) As IntPtr
    'Declare Function BASS_SampleFree Lib "bass.dll" (ByVal handle As IntPtr) As Boolean
    'Declare Function BASS_SampleGetChannel Lib "bass.dll" (ByVal handle As IntPtr, ByVal onlynew As Boolean) As IntPtr
    'Declare Function BASS_SampleStop Lib "bass.dll" (ByVal handle As IntPtr) As Boolean


End Module


And

STREAM = Bass.BASS_StreamCreateFile(TRACKDIR & TRACKNAME, 0, 0, BASSFlag.BASS_STREAM_AUTOFREE)

Dim SongTime As Long               
           SongTime = BASS_ChannelBytes2Seconds(STREAM, Bass.BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES))


radio42

?Yes what? The above question was an OR question!
From your code it looks like you are mixing things, i.e. using Bass.Net_compact but also declare your own imports?!

hiddenman37

#239
Yes. I'm using the Bass.Net_compact version ( Bass24.Net_compact.zip )
No. I haven't declared my own functions.

For example:
Bass.BASS_Init(1, FREQUENCY, flags, Me.Handle, Nothing)
Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_BUFFER, 1000)
Bass.BASS_ChannelSetAttribute(BASSConfig.BASS_CONFIG_NET_AGENT,BASSAttribute.BASS_ATTRIB_PAN, BALANCE)
Bass.BASS_SetVolume(MASTER_VOLUME / 100)

Thanks for reply...

I am using the program at both the operating system. The problem therefore occurs. a bad solution. but the problem is solved.

If OsControl = False Then
SongTime = BASS_ChannelBytes2Seconds(STREAM, BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES)) ' for x86. own declarated function
Else
SongTime = Bass.BASS_ChannelBytes2Seconds(STREAM, Bass.BASS_ChannelGetLength(STREAM, BASSMode.BASS_POS_BYTES)) 'for mobile. bass net function
End If

radio42

I am not sure what problem you are actually facing, as the Bass.Net_compact version as well as the regular Bass.Net version both fully support the "BASS_ChannelGetLength" overload you are using.

But you must use the correct and related bass.dll with it, i.e.:
- the regular bass.dll with the Bass.Net.dll
- the CE version of bass.dll with the Bass.Net_compact.dll

ken

Ian,

Is there a version of BASSmix for WinCE?  Also the new "server" for BASSenc will that work in WinCE ?

/Ken

Ian @ un4seen

BASSmix isn't available for WinCE at the moment. It heavily uses floating-point, and that will need to be changed to fixed-point in a WinCE version. That shouldn't be too much trouble though, if there is demand for a WinCE version.

Regarding BASSenc, the server and casting features are currently not included in the WinCE version. The thing is I'm not sure there are any encoders available to make those features useful, but it should be fairly straightforward to add support should it turn out that usable encoders do exist.

TripleKill

Hi everyone!

I try to build a .NET CF app for web radio, and get a "can't find PInvoke "bass.dll"" error, though I have bass.dll in place.
The device I debug on is Cowon Q5W with MIPS R4k CPU inside. Does it cause the error?
Can I find BassCE for MIPS R4k CPU anywhere? My e-mail is pontovnet@rambler.ru

Thanks in advance.

TripleKill, Russia.

radio42

The error indicates, that the native bass.dll coul not be found.
Note, that the Bass.Net_compact version is just a .Net CE wrapper for the native CE version of bass!

TripleKill

I used CE version of bass.dll of course))
Am I doing something wrong? Should I somehow add bass.dll itself into project?
The problem appears when I run compiled exe (i.e. without debugging).
Bass.dll (it's CE version) resides in the same folder with exe, still it gives out the same error.

Here's a screenshot of files I have on device, app's form and error popup (clickable):

TripleKill

And again I'd like to point out that the application is being run on MIPS R4k machine.
PEInfo analyzer indicates that bass.dll I use is intended to run on ARM type processors.
Maybe this causes incompatibility?

Ian @ un4seen

Here is a MIPS build to try...

   www.un4seen.com/stuff/bass24-ce-mips.zip

That isn't the latest stuff (it's a 2.4.3 build), but you can at least use it to confirm that the problem is indeed a CPU architecture mismatch. I will post an update later.

TripleKill

I tried it. Works perfectly!! Thank you!!

TripleKill

One more question...

I have two different URLs. The first one is type of IP:port (I tested this: http://94.23.40.70:8010/).
The second one is "file" URL: (tested http://www.snakenetmetalradio.com:8000/Snakenet-96k.asp).

I use the same method on them, BASS_StreamCreateURL. The first one works, but the second doesn't.
Is there a difference in methods I should use to open those?