Recent

Author Topic: United OpenLib of Sound (UOS)  (Read 74149 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #60 on: January 31, 2013, 08:04:13 pm »
@ Dido : i need help of Professor Blaazen.  :-[

It is a ratio with sample rate ( 44100 htz/second ) and the number of samples.

I think ( but im absolutely not sure ) time in second = Number of samples  / (sample rate div channels).
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Blaazen

  • Hero Member
  • *****
  • Posts: 3235
  • POKE 54296,15
    • Eye-Candy Controls
Re: United OpenLib of Sound (UOS)
« Reply #61 on: January 31, 2013, 08:15:47 pm »
Number of channels does not affect the time. It affects only the file size.

time in second = Number of samples  / sample rate.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #62 on: January 31, 2013, 08:21:39 pm »
@ Blaazen : many thanks.

@ Dibo : maybe your first function for UOS ?
Quote
function ConvertSampletoTime (lengthinsample : integer) : ttime;
« Last Edit: January 31, 2013, 08:48:08 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

lainz

  • Guest
Re: United OpenLib of Sound (UOS)
« Reply #63 on: January 31, 2013, 11:14:21 pm »
Thanks for this, keep going on, finally a decent lib for sound

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: United OpenLib of Sound (UOS)
« Reply #64 on: February 01, 2013, 12:54:46 pm »
Thanks Blaazen!

Here is some extension for UOS:

Code: Pascal  [Select][+][-]
  1. function InputLengthSeconds(InputIndex: integer): Int64;
  2. function InputLengthTime(InputIndex: integer): TTime;
  3.  
  4. implementation
  5.  
  6. function TUOS_Player.InputLengthSeconds(InputIndex: integer): Int64;
  7. begin
  8.   Result := 0;
  9.   if (InputIndex > -1) and (InputIndex < length(StreamIn)) then
  10.     Result := StreamIn[InputIndex].Data.Lengthst div StreamIn[InputIndex].Data.SampleRate;
  11. end;
  12.  
  13. function TUOS_Player.InputLengthTime(InputIndex: integer): TTime;
  14. var
  15.   tmp: Int64;
  16.   h, m, s: Integer;
  17. begin
  18.   Result := 0;
  19.   if (InputIndex > -1) and (InputIndex < length(StreamIn)) then
  20.   begin
  21.     tmp    := InputLengthSeconds(InputIndex);
  22.     h      := tmp div 3600;
  23.     m      := tmp div 60 - h * 60;
  24.     s      := tmp - (h * 3600 + m * 60) ;
  25.     Result := EncodeTime(h,m,s,0);
  26.   end;
  27. end;
  28.  

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #65 on: February 01, 2013, 02:36:17 pm »
@ Dibo : Yeeeep, many , many, many thanks from all the audio-lazarus lovers.

I gonna add your code asap (im in a cyber-cafe without my laptop and i promise not to code for one week  :-X ).

Many thanks, finally uos gonna live.  ::)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #66 on: February 01, 2013, 02:49:51 pm »
@ Dibo : i have seen the code of the open project "Cactus", a player developed in Lazarus.

Nice code but...

That project do not use any sound libraries or web component, it use... mplayer.exe:-X ).

See here part of cactus code how they do internet-streaming :

Code: [Select]
FMplayerPath := FMplayerPath + 'mplayer.exe';
      MPlayerProcess.CommandLine:=FMplayerPath + ' STREAMING_MODE';
      MPlayerProcess.Options:= MPlayerProcess.Options + [poUsePipes, poDefaultErrorMode, poNoConsole];
      MPlayerProcess.Execute;

So, till now no "real" open source audio player exists in Lazarus or FPC or Delphi...
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

varianus

  • New Member
  • *
  • Posts: 22
Re: United OpenLib of Sound (UOS)
« Reply #67 on: February 01, 2013, 03:31:25 pm »
Have you seen my application Ovoplayer ?

It can use various audio engines as Mplayer, VLC, Bass, Xine, Gstreamer or DirectShow.

I've also started a rudimentary interface to portaudio + mpg123 + sndfile "stealing" the import units ( and some code) from earlier version of UOS...

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #68 on: February 01, 2013, 08:55:39 pm »
Quote
Have you seen my application Ovoplayer ?

Whaouw, superb...  :D

Quote
"stealing" the import units ( and some code) from earlier version of UOS...

You do not steal anything, UOS is yours  ;)

EDIT: And if you use the new release, you directly have Ovoplayer working for OSX with his own audio engine...
« Last Edit: February 01, 2013, 09:17:09 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #69 on: February 01, 2013, 11:12:09 pm »
@ Dibo : i have got my laptop (  :-X ).

I think it is a good idea to add some more Dibo's procedure :

Quote
function TUOS_Player.InputPosition(InputIndex: integer): longint;
Quote
function TUOS_Player.InputPositionSeconds(InputIndex: integer): Int64;  // Done
Quote
function TUOS_Player.InputPositionTime(InputIndex: integer): TTime;  //Done

and also for seek :

Quote
procedure TUOS_Player.SeekSeconds(InputIndex: integer; pos:int64);  //// change position in seconds
begin
  if (InputIndex > -1) and (InputIndex < length(StreamIn)) then
    StreamIn[InputIndex].Data.Poseek := pos *  StreamIn[InputIndex].Data.SampleRate ;
end; //Done

but for :
Quote
procedure TUOS_Player.SeekTime(InputIndex: integer; pos: TTime);  //// change position in time format // to do
begin
  if (InputIndex > -1) and (InputIndex < length(StreamIn)) then
    StreamIn[InputIndex].Data.Poseek := ?TimetoSample(pos)? //NOT Done;
end;

 :-[
« Last Edit: February 01, 2013, 11:17:03 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #70 on: February 02, 2013, 02:45:44 pm »
@ Dibo : Is there a reason that
Quote
function TUOS_Player.InputlengthSeconds(InputIndex: integer): Int64
has a integer result ?

Because SndFile and Mpg123 have a precision of ms (0.001 sec).

If you are ok, may i change your procedure with :
Quote
function TUOS_Player.InputLengthSeconds(InputIndex: integer): cfloat

Thanks
« Last Edit: February 02, 2013, 02:47:30 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: United OpenLib of Sound (UOS)
« Reply #71 on: February 02, 2013, 03:03:54 pm »
No problem :)

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #72 on: February 02, 2013, 06:56:43 pm »
Hello everybody. ;)
 
Here the new release of UOS with Dibo's time procedures (see SimplePlayer example).
Also added  reference counting in PortAudio  ( many thanks to Max Karpushin ).

Download it here :
http://fredvs.github.io/uos/
UOS is in GitHub as well, everybody is welcome.
https://github.com/fredvs/uos/

PS : Indeed, GitHub is terrific  ;D
« Last Edit: May 16, 2013, 03:28:09 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: United OpenLib of Sound (UOS)
« Reply #73 on: February 03, 2013, 07:13:36 pm »
Do you know any multiplatform library for playing wmv (wma?) music format which could be supported by UOS?

Fred vS

  • Hero Member
  • *****
  • Posts: 3149
    • StrumPract is the musicians best friend
Re: United OpenLib of Sound (UOS)
« Reply #74 on: February 03, 2013, 07:16:42 pm »
Quote
Do you know any multiplatform library for playing wmv (wma?) music format which could be supported by UOS?

No and that lib is welcome in UOS. But im not sure it exists open-source ( you know Microsoft is not fan about open-source :-[ ).
« Last Edit: February 03, 2013, 07:19:02 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018