ov:Lib v0.27 - Stream OggVorbis in PureBasic (3.94 / 4.00)

Developed or developing a new product in PureBasic? Tell the world about it.
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

Inf0Byt3 wrote:Veeery very nice lib. And extremely usefull. Could this be used for VOIP apps ?
Speex is better and coded for this task ;)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Thanks for the tip :D. I'm going to search for it.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
User avatar
yoxola
Enthusiast
Enthusiast
Posts: 386
Joined: Sat Feb 25, 2006 4:23 pm

Post by yoxola »

Really hope it can get updated for PB4, ovLib did a great job in streaming OGG music.
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Yes it would be nice - count me in for a PB4 version when possible. Excellent work traumatic!
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Sorry for the delay... Private life issues prevented me from working
on PureBasic for quite some time now. :roll:


That being said, here's ov:Lib 0.27, updated for PureBasic v4.0:
http://files.connection-refused.org/ovL ... ibOnly.zip

Sorry, no new functions (checks) added this time.
This is a PB4 maintenance release only! (string handling and
dependency errors fixed)

Feel free to report any problems. Thank you.
Last edited by traumatic on Tue Oct 10, 2006 4:23 pm, edited 2 times in total.
Good programmers don't comment their code. It was hard to write, should be hard to read.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Here's an updated fft.pb for those who may have problems:

Code: Select all

;
; ov:Lib v0.27 - FFT Example
;
; (c) :traumatic! 2004/2005/2006
;
;

OpenWindow(0, 0, 0, 256, 200, "[ov:Lib] - FFT Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

CreateImage(0, 256, 100)
CreateImage(1, 256, 100)

Dim fftData.f(2047) ; array to hold fft data
Dim pcmData.b(2047) ; array to hold pcm data

ovInitFFT()

If ovOpen("PurePower.ogg")
  ovPlay()

  Repeat
    fftData() = ovGetSpectrumData()
    pcmData() = ovGetBufferData()
    
    ; draw raw pcm data
    StartDrawing(ImageOutput(0))
    Box(0, 0, 256, 100)
    x=0
    For i=1 To 2047 Step 4
      Plot(x, 50+pcmData(i), $FF00)
      x+1
    Next 
    LineXY(0, 99, 256, 99, $A0A0A0)
    StopDrawing()
  
    ; draw fft data
    StartDrawing(ImageOutput(1))
    Box(0, 0, 256, 100,$40)
    For i=1 To 256
      fft.f = fftData(i)*0.0001
      Box(i, 100, 1, -1+fft, $FF00)
    Next
    StopDrawing()
  

    StartDrawing(WindowOutput(0))
      DrawImage(ImageID(0), 0, 0)
      DrawImage(ImageID(1), 0, 100)
    StopDrawing()
    
    Delay(10)
  Until WindowEvent()=#PB_Event_CloseWindow Or GetAsyncKeyState_(#VK_ESCAPE)
  
Else
  MessageRequester("ov:Lib", "Couldn't open PurePower.ogg") 
EndIf

ovClose()
End
Good programmers don't comment their code. It was hard to write, should be hard to read.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

Excellent mate.

Nice to see that you still do code from time to times. Hope life is going
well for you. keep it up !
regards,
benny!
-
pe0ple ar3 str4nge!!!
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Thanks very much traumatic!
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

Give this man a cigar!
The Human Code Machine / Masters' Design Group
Motu
Enthusiast
Enthusiast
Posts: 160
Joined: Tue Oct 19, 2004 12:24 pm

thank you :)

Post by Motu »

hey traumatic, this lib of yours is very cool!

thanks for being so nice to share it. :)
Motu
Enthusiast
Enthusiast
Posts: 160
Joined: Tue Oct 19, 2004 12:24 pm

But...

Post by Motu »

What shall I do if I want to play multiple files at the same time? The open/play function do not recive pointer or playback numbers - so it seems I only can play one file at a time...
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: But...

Post by traumatic »

Motu wrote:What shall I do if I want to play multiple files at the same time? The open/play function do not recive pointer or playback numbers - so it seems I only can play one file at a time...
That's true, streaming multiple files is not supported. Sorry.
Good programmers don't comment their code. It was hard to write, should be hard to read.
Post Reply