20 Jun '13 - 06:33 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2
1  Developments / BASS / Re: BASS for Linux on: 20 Oct '08 - 22:58
  Wink My first test using Mandriva Linux and FreeBasic.

code1.bas
'Simple code example using

'FreeBasic = http://www.freebasic.net

'Bass for Linux = http://www.un4seen.com/

#include once "bass.bi"

screenres 512, 418

Dim chan As QWord

Dim argv As String

Dim chanLength As QWord

Dim mpos As QWord

dim kbin As String

argv = "./test.mp3"



If( BASS_GetVersion( ) < MAKELONG(2,2) ) Then

Print "Error: BASS version 2.2 or above required"

'Sleep

End 1

End If



If( BASS_Init( -1, 44100, 0, 0, 0 ) = 0 ) Then

Print "Error: BASS_Init failed"

Sleep

End 0

End If



chan = BASS_StreamCreateFile( FALSE, argv, 0, 0, BASS_SAMPLE_LOOP)



If chan = 0 Then

Print "Error: BASS Stream Load failed"

Sleep

BASS_Free

End 1

End If



chanLength = BASS_ChannelGetLength(chan,BASS_POS_BYTE)



BASS_ChannelPlay( chan, FALSE )



While BASS_ChannelIsActive (chan) = 1   

Locate 1,1

Print "Press button 9 for exit."

    Locate 2, 1

    Print "Length: " & chanLength

    Locate 3, 1

    mpos = BASS_ChannelGetPosition(chan, BASS_POS_BYTE)

    Print "Pos...: "; mpos

   

    kbin = inkey

    Select Case kbin

    case "9"

    goto EndEx

    End Select   

Wend



EndEx:



BASS_ChannelStop( chan )



BASS_StreamFree( chan )

BASS_Stop

BASS_Free

bass.bi
#inclib "bass"



#ifdef __FB_WIN32__

# include once "win/wtypes.bi"

#else

'type BYTE as ubyte

type WORD as ushort

type DWORD as uinteger

type BOOL as integer

#define TRUE 1

#define FALSE 0

#define MAKELONG(a,b) cint( cushort(a) or (cuint(cushort(b)) shl 16) )

#endif '' __FB_WIN32__



type QWORD as ulongint

type HMUSIC as DWORD

type HSAMPLE as DWORD

type HCHANNEL as DWORD

type HSTREAM as DWORD

type HRECORD as DWORD

type HSYNC as DWORD

type HDSP as DWORD

type HFX as DWORD

type HPLUGIN as DWORD



#define BASS_SAMPLE_LOOP 4 'looped

#define BASS_POS_BYTE 0 'byte position



#ifdef __FB_WIN32__

declare function BASS_Init alias "BASS_Init" (byval device as integer, byval freq as DWORD, byval flags as DWORD, byval win as HWND, byval dsguid as GUID ptr) as BOOL

#else

declare function BASS_Init alias "BASS_Init" (byval device as integer, byval freq as DWORD, byval flags as DWORD, byval win as any ptr, byval dsguid as any ptr) as BOOL

#EndIf



declare function BASS_Start alias "BASS_Start" () as BOOL

declare function BASS_Stop alias "BASS_Stop" () as BOOL



declare function BASS_SetDevice alias "BASS_SetDevice" (byval device as DWORD) as BOOL

declare function BASS_GetDevice alias "BASS_GetDevice" () as DWORD

declare function BASS_Free alias "BASS_Free" () as BOOL



declare function BASS_GetVersion alias "BASS_GetVersion" () as Dword



declare function BASS_StreamCreateFile alias "BASS_StreamCreateFile" (byval mem as BOOL, byval file as zstring ptr, byval offset as QWORD, byval length as QWORD, byval flags as DWORD) as HSTREAM

declare function BASS_StreamFree alias "BASS_StreamFree" (byval handle as HSTREAM) as BOOL



declare function BASS_ChannelPlay alias "BASS_ChannelPlay" (byval handle as DWORD, byval restart as BOOL) as BOOL

declare function BASS_ChannelStop alias "BASS_ChannelStop" (byval handle as DWORD) as BOOL

declare function BASS_ChannelGetLength alias "BASS_ChannelGetLength" (byval handle as  DWORD,byval mode as DWORD) as QWORD

declare function BASS_ChannelSetPosition alias "BASS_ChannelSetPosition" (byval handle as DWORD,byval pos as QWORD,byval mode as DWORD) as BOOL

declare function BASS_ChannelGetPosition alias "BASS_ChannelGetPosition" (byval handle as DWORD,byval mode as DWORD) as QWORD

declare function BASS_ChannelIsActive alias "BASS_ChannelIsActive" (byval handle as DWORD) as DWORD



'double BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos);

'QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos);

'DWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle);

'BOOL BASSDEF(BASS_ChannelSetDevice)(DWORD handle, DWORD device);



'BOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info);

'const char *BASSDEF(BASS_ChannelGetTags)(DWORD handle, DWORD tags);

'DWORD BASSDEF(BASS_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask);

'BOOL BASSDEF(BASS_ChannelUpdate)(DWORD handle, DWORD length);

'BOOL BASSDEF(BASS_ChannelLock)(DWORD handle, BOOL lock);

'BOOL BASSDEF(BASS_ChannelPlay)(DWORD handle, BOOL restart);

'BOOL BASSDEF(BASS_ChannelStop)(DWORD handle);

'BOOL BASSDEF(BASS_ChannelPause)(DWORD handle);

'BOOL BASSDEF(BASS_ChannelSetAttribute)(DWORD handle, DWORD attrib, float value);

'BOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, float *value);

'BOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, float value, DWORD time);

'BOOL BASSDEF(BASS_ChannelIsSliding)(DWORD handle, DWORD attrib);

'BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol);

'BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, float *outvol);

'BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel);

'BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);

'QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode);

'BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode);

'QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode);

'DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle);

'DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length);

'HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user);

'BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync);

'HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, int priority);

'BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp);

'BOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan);

'BOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan);

'HFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type, int priority);

'BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx);



declare function BASS_MusicLoad alias "BASS_MusicLoad" (byval mem as BOOL, byval file as zstring ptr, byval offset as DWORD, byval length as DWORD, byval flags as DWORD, byval freq as DWORD) as HMUSIC

Next example using Grafic GTK
VU
CPU
POSITION
and more
ReplyReply Reply with quoteQuote
2  Developments / BASS / Re: BASS for Linux on: 1 Sep '08 - 23:12
No GUI... simple compile for console....
Please... example for familiar.
ReplyReply Reply with quoteQuote
3  Developments / BASS / Re: BASS for Linux on: 1 Sep '08 - 14:50
More... compile... only Windows and MacOS...
ReplyReply Reply with quoteQuote
4  Developments / BASS / Re: BASS for Linux on: 31 Aug '08 - 11:26
And sources examples C or other for LINUX?
Some my idea is create examples for freeBasic.

Thanks
ReplyReply Reply with quoteQuote
5  Developments / BASS / Re: BASS for Linux on: 25 Aug '08 - 16:16
I do not understand. BassMOD or MP3 and WAV BassLinux Etc..?
ReplyReply Reply with quoteQuote
6  Developments / BASS / Re:mixpoint detection on: 29 Aug '04 - 14:05
Please MindWorkSoft place here source code full of MixPoint. Ou send fo me largatobega@ig.com.br.

Thanks...

Hi RevG,
Bass notes usually at the lower freq. which is at the beginning part of the FFT data, in my code I just access the first 3 array of the FFT buffer to priorities the low frequency and to speed up reading the buffer, hope the code below will speak more.


------------------------------------------------------------------------
Do While InStreamPos < InSamLen
        InStreamPos = BASS_ChannelGetPosition(IntroChan)
        BASS_ChannelGetData IntroChan, prvBUFF(0), BASS_DATA_FFT512
        If InStreamPos < PrevChanel.SongStart Then
            co = vbRed
        End If
        If InStreamPos > PrevChanel.SongStart Then
            co = vbGreen
        End If
        For i = 1 To 3
            pcIntroWave.Line (x, (pcIntroWave.Height - 100) - (prvBUFF(i) * 2000))-(x, pcIntroWave.Height), co
        Next i
        x = x + InInterval
        DoEvents  'do other events
       
  Loop


ReplyReply Reply with quoteQuote
7  Developments / BASS / Re:directx plug-in on: 27 Feb '04 - 00:54
 Huh
Is anybody possible to convert TBassPlayer for Visual Basic?  
Thank you very much.
ReplyReply Reply with quoteQuote
8  Developments / BASS / Exclude MP3 Windows XP on: 13 Feb '04 - 01:36
Hello to all.  
Because all reproduces a MP3 and of STOP I don't get to exclude MP3?
ReplyReply Reply with quoteQuote
9  Developments / BASS / Help Bass_SetBufferLength on: 14 Jan '04 - 02:20
LiveFX - VB

Bass_SetBufferLength
Doesn't exist for version 2.0?  Embarrassed
ReplyReply Reply with quoteQuote
10  Developments / BASS / Detect Silence. on: 12 Jan '04 - 23:18
Detect silence of the file. Only for VB. Excuse me.

http://www.lbaudio.hpg.ig.com.br/detectsilence.rar

She not to get to do the download, send email for me.

ReplyReply Reply with quoteQuote
11  Developments / BASS / Re:What will Bass 2.0 contain? on: 29 Sep '03 - 21:39
Please Ian. Send for me the version 2.0 to test. I am having problems with the version 1.8 in relation to the simultaneous use of two sound card.
ReplyReply Reply with quoteQuote
12  Developments / BASS / Re: Recording in WMA on: 29 Mar '03 - 14:23
Thank you Yan. Grin
ReplyReply Reply with quoteQuote
13  Developments / BASS / Re: left/right meter on: 30 Mar '03 - 05:48
----In Timer-----
Dim VU As Long
Dim L , R As Single

  VU = Bass_ChannelGetLevel(Handle)
  L = Int(GetLoWord(VU))
  R = Int(GetHiWord(VU))
  Label1.Caption = L
  Label2.Caption = R Grin
ReplyReply Reply with quoteQuote
14  Developments / BASS / Re: BASS_FX v1.2 beta - is here :) on: 1 Jul '03 - 14:36
Would not this version have support for DSP/EFFECTS of Winamp?

Thanks.
ReplyReply Reply with quoteQuote
15  Developments / BASS / Re: c++ source and ocx for winamp dsp/vis plugins on: 2 Jul '03 - 04:59
Cry Please help me. I still didn't get to play two audio files with StreamProc.  Cry


Function STREAMPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long
   
    Dim decbuff(decblock * 2) As Byte
    Dim tempbuffer() As Byte
    ReDim tempbuffer(length) As Byte
    Dim a As Long
    Dim c As Long
    Dim nBufferPos As Long
    nBufferPos = 0
   
    c = length
   
    If exlen Then
       a = 0
       If (c < exlen) Then
           a = c
       Else
           a = exlen
       End If
         
       Call CopyMemory(tempbuffer(nBufferPos), excess(0), a)
       Call CopyMemory(excess(0), excess(a), exlen)
       nBufferPos = nBufferPos + a
       c = c - a
   End If
   
   Do While (c)
       a = BASS_ChannelGetData(m_hStream, decbuff(0), decblock)
       If a < 0 Then
           Exit Do
       End If
       
      If frmMain.started Then
      a = 4 * frmMain.ActiveVis1.ModifySamples(VarPtr(decbuff(0)), a / 4, 16, 2, 44100)
      End If
       
       If (a > c) Then
           Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), c)
           exlen = a - c
           Call CopyMemory(excess(0), decbuff(c), exlen)
           c = 0
       Else
           Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), a)
           nBufferPos = nBufferPos + a
           c = c - a
       End If
   Loop
   
   Call CopyMemory(ByVal buffer, tempbuffer(0), length - c)
   
   STREAMPROC = length - c
End Function
ReplyReply Reply with quoteQuote
16  Developments / BASS / Re: c++ source and ocx for winamp dsp/vis plugins on: 20 Jun '03 - 23:50
"EXCUSE" didn't translate for English. Tongue

Revg, don't know the reason, but the ADAPT-X worked again. I am awaiting the help in relation to execution of two audio files. When I only execute a, it works perfect, but when I execute two audio, he/she begins to appear some defects. But once, thank you very much.
ReplyReply Reply with quoteQuote
17  Developments / BASS / Re: c++ source and ocx for winamp dsp/vis plugins on: 20 Jun '03 - 23:47
Revg, não sei o motivo, mas o ADAPT-X voltou a funcionar. Estou aguardando a ajuda em relação a execução de dois arquivos de audio. Quando executo somente um, funciona perfeito, mas quando executo dois audios, começa a aparecer uns defeitos. Mas uma vez, muito obrigado.
ReplyReply Reply with quoteQuote
18  Developments / BASS / Re: c++ source and ocx for winamp dsp/vis plugins on: 19 Jun '03 - 21:12
Huh I am not getting to execute two audio files. I only get to execute an audio file. When I execute two audio files, the audio is bad. I don't get to understand, how to play two audio files at the same time.  
 
Wink A Great Hug: You are very helpful and efficient.
ReplyReply Reply with quoteQuote
19  Developments / BASS / Re: c++ source and ocx for winamp dsp/vis plugins on: 19 Jun '03 - 15:30
You can send me for the email: largatobega@ig.com.br
ReplyReply Reply with quoteQuote
20  Developments / BASS / Re: c++ source and ocx for winamp dsp/vis plugins on: 19 Jun '03 - 15:27
Huh  Hello RevG. The new code source no this more one executing Plugin DSP Adapt-x 3.5. This near the code source two ActiveX, the previous and the new. The previous works Plugin DSP Adapt-x 3.5.  I tried in several ways to play the two audio, but I didn't get. I am putting a link of my code source for you to help me. I have many other ideas that I should put here soon. Help me please.   Embarrassed

http://www.lagartobega.kit.net/lagartodsprevg.zip
ReplyReply Reply with quoteQuote
Pages: [1] 2
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines