Coder Social home page Coder Social logo

fredvs / uos Goto Github PK

View Code? Open in Web Editor NEW
130.0 21.0 26.0 21.05 MB

United Open-libraries of Sound. United procedures for open-source audio libraries. For FPC/Lazarus/fpGUI/MSEgui.

License: Other

Pascal 100.00%
pascal opus mp3 fpc audio streaming audio-streaming dsp lazarus flac

uos's Introduction

uos2

uos : United OpenLib of Sound.

uos unifies the best open-source audio libraries.

For fpc, fpGUI, MSEgui and LCL.

With uos you can:

. Listen to mp3, ogg, wav, flac, m4a, opus, cda ... audio files.

. Deal with 16, 32 integer or float 32 bit resolution.

. Do internet audio streaming of mp3 and opus files.

. Record all types of input into wav or ogg file with 16 or 32 bit resolution.

. Add DSP effects and filters, however many you want and record it.

. Listen to multiple input and output.

. Produce sound from built-in synthesizer.

uos can use: PortAudio, SndFile, Mpg123, Faad, Mp4ff, Opus, OpusFile audio libraries and SoundTouch, Bs2b audio-effect libraries.

Included in the package:

. Examples fpGUI, MSEgui, LCL and console.

. Binaries of libraries included for Linux, arm32-aarch64 Rapsberry Pi, Windows, Mac OSX, OpenBSD and FreeBSD.

See you at uos forum: http://uos-forum.108.s1.nabble.com

Fred van Stappen [email protected]

uos's People

Contributors

brent576 avatar fredvs avatar jurassicpork avatar phoenixfenix avatar thelazytomcat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uos's Issues

Missing Identifiers

I tried using Online Package Manager to download and install this package, and when I append 'uos_flat' to the uses keyword, I get some compile errors.

Here's the Log: https://pastebin.com/qFkc9qQT

In short, there are a lot of missing identifiers. I'm new to the Lazarus world, so I don't know what to do :/

I also tried uninstalling the Online Package Manager version and downloading the latest release of this github repository, but to no avail (the same errors).

Any thoughts?

crash when there is no input API

There is a need, in uos.pas, at line 3127, for a test like:

  if DefDevInInfo <> nil then
    DefDevInAPIInfo := Pa_GetHostApiInfo(DefDevInInfo^.hostApi);

because DefDevInInfo may be nil.

Recording input stream to wav directly

Hi, SimpleRecorder example writes input stream in memory and saves wav file after clicking stop buttion. How to write input strem directly to wave file ?

Check Range error

Hello,
using some sounds, even wav, I get a "range" error with Lazarus in Debug mode:

function Tuos_Player.DSPLevel(Data: Tuos_Data): Tuos_Data;
...
if pf^[x] < minf[1] then
...

similar case
if ps^[x] < mins[1] then
if pl^[x] < minl[1] then

because "x" becomes equal to "Length(ps^)"

Test on "SimplePlayer" with this sound:
drip.zip

Mac OSX Libs not found.

I Just wrote a program using uos in Lazarus on Windows. It works good, but when I try to compile the project under Mac OSX i got the message "Error while loading libraries..." I looked up if the path is right - yes. its right. I tried it outside of the .app file and inside (under Content/MacOS/lib...) nothing works. And I wonder why the SoundTouch.dylib is missing.

Code:

opath := ordir;
showmessage(opath);
Edit1.Text := opath + 'lib/Mac/32bit/LibPortaudio-32.dylib';
Edit2.Text := opath + 'lib/Mac/32bit/LibSndFile-32.dylib';
Edit3.Text := opath + 'lib/Mac/32bit/LibMpg123-32.dylib';
Edit5.Text := opath + 'lib/Mac/32bit/libSoundTouch-32.dylib';
Edit4.Text := opath + 'sound/test.mp3';

The Showmessage gives: ...myproject/project1.app/Content/MacOS/ - and in the folder MacOS is the filder lib/Mac/32bit/(the libs)

Do you know where the problem is?

Debug output

Hello Fred!

I noticed that uos produces debug output, even when DEBUG is not defined. I believe that it comes from the binaries. Would it be possible to have binaries without debug output? This is for the Eschecs project.

No emergency, just a question. ;)

Regards.

Roland

[roland@localhost eschecs-202104122121]$ ./eschecs
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_dmix.c:1009:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
[roland@localhost eschecs-202104122121]$ 

UOS recording mono audio source

Hi, I'm trying to recording from USB Microphone audio devices (mono source).

I'm using the library from the trunk. The output from the mono source is more faster (twice) and half length (in time), but the basic frequencies (tune) are ok (as when a speed filter is applied).

The same problem using the simplerecorder demo.

Also uos.pas has some problems when libraries are disabled in define.inc

I found a little bug:

- for x2 := 0 to StreamIn[x].Data.WantFrames do
+ for x2 := 0 to StreamIn[x].Data.WantFrames-1 do

Thanks for your great work.

Compilation failure with default FPC language syntax mode

Hi,

It was reported in the FPC Users mailing list, and I confirmed it too, that if you try and compile UOS or any of its examples with the default FPC language syntax (equivalent to -Mfpc as defined in $HOME/.fpc.cfg), you will get the following compiler error:

Compiling uos_portaudio.pas
uos_portaudio.pas(359,9) Error: Identifier not found "Result"
uos_portaudio.pas(364,10) Error: Identifier not found "Result"
uos_portaudio.pas(368,7) Error: Identifier not found "result"
uos_portaudio.pas(412,13) Error: Identifier not found "Result"
uos_portaudio.pas(439) Fatal: There were 4 errors compiling module, stopping
Fatal: Compilation aborted

I really don't know why Free Pascal still defaults to the FPC language syntax instead of the ObjFPC language syntax, but it does. :-/

To fix the problem for all possible scenarios I suggest you place the following line of code at the beginning of each of the UOS units:

  {$mode objfpc}{$H+}

That will override any ~/.fpc.cfg or project settings, and tell the compiler to instead use the ObjFPC language syntax.

No external libraries

I am looking for a solution that generates an audio test tone (1kHz sine wave) in pure pascal code without any additional libraries. Is uos capable of that? It seems to have dependencies on lots of external libraries.

Russian Device Names

Hi, i have a problem with devices infos example. I'm russain, so devices named russian symbols, but i see somthing like this ???.???? (VIA HD Audio (WIN 10) ("?" instead of russian symbols). What i should do to solve this problem ?
default

Highpass filter not working

Hi Fred, many thanks for your great software and a Happy New Year!

I'm trying to use your uos_InputAddFilter() to make a sound-to-light interface. The bandpass filters work as expected, but I get a working lowpass filter when I use fHighPass (4) for the 6th parameter of the function. I hoped that using fLowPass to get a highpass filter, but I got some strange results.
BTW, I checked the filters with the online tone generator: http://www.szynalski.com/tone-generator/

Thanks, Dets ...

Range check error when trying to play mono audio files.

Hi, I found an error (201) with monoaural audio files, "uos_SetDSPVolumeIn" is used and the compiler is set to full debug.

Error in line 1555 of uos.pas:

function uos_DSPVolume(Data: Tuos_Data; fft: Tuos_FFT): TDArFloat;
...
ps^[x] := trunc(ps^[x] * vleft);
...

Do you know any workaround?

Thanks

Zip File Corrupted

I at first downloaded the zip file rather that clone the code. Most of the uos.pas file was missing.

mpg123 - missing function mpg123_meta_free

Hello!
While trying the uos - btw. nice library, i will definitely use it - I have noticed that in the binding to mpg123 (file ./src/uos_mpg123.pas), a declaration of function mpg123_meta_free is missing. Dunno for which version of mpg123 the binding was written, so maybe it was not introduced at that point.
Also, there may be more things missing, can't say as I have not checked (sorry, got too little time to do so right now).

How to configure cards ?

Trying to make this work under Gentoo x64, tried few examples and none worked.
For example conswebstream gives me this :

$ ./conswebstream 
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_dmix.c:1041:(snd_pcm_dmix_open) unable to open slave
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_dmix.c:979:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_dmix.c:1041:(snd_pcm_dmix_open) unable to open slave
===> Libraries are loaded.
===> uos_CreatePlayer => ok
===> uos_AddFromURL => ok
===> uos_AddIntoDevOut => ok
===> All ready to play.
Press a key to play...

Nothing happens when I press a key btw.
Looking at those messages seems like it can't find a sound card or something.
I have integrated realtek sound card, never had problems before, have no clue what's going on with this. Same happens with SimplePlayer example, I click on "Load that libraries" then in terminal I get this :

$ ./SimplePlayer
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_dmix.c:1041:(snd_pcm_dmix_open) unable to open slave
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_dmix.c:979:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.1.2/work/alsa-lib-1.1.2/src/pcm/pcm_dmix.c:1041:(snd_pcm_dmix_open) unable to open slave

Compilation fails in DEBUG mode

Hello Fred!

As the title says, the compilation of latest uos fails in DEBUG mode.

There is something to fix here:

procedure Tuos_Player.ReadFile(x : integer);  
{$IF DEFINED(neaac) or DEFINED(debug)}
var
{$endif}
{$IF DEFINED(neaac)}
outBytes: longword;
{$endif}
{$IF DEFINED(debug) and DEFINED(unix)}
i : integer;
 st : string;
{$endif}
begin

problem on threaded uos_File2Buffer

Hy,
tempoutmemory was declared as a global var and if i use multiple thread of uos_File2Buffer is not a good solution..
i have implemented, in the writeout procedure the use of the pointer Streamout[x].BufferOut
and i have add a funcion called uos_Stream2Buffer (like uos_File2Buffer but with a tstream)

i post my uos.pas with my change
i are interested i have made the change for use this library with delphi...
sorry for my bad english
Alessandro

uos.zip

DELPHI?

Do you have a DELPHI version?

Device Enumeration

How to enumerate IN devices?
When i use this code, i have lots of repeating Devices.

while x < UOSDeviceCount do
    begin
      if   uosDeviceInfos[x].DeviceType= 'In' then begin
      ComboBox1.Items.Add(SysToUTF8(uosDeviceInfos[x].DeviceName));

capt

But really i have only one Line In and Mic.

I try to enumerate IN devices and then chose one as recording source. How can i do that ?
THNX

mpg123 - wrong declaration of records

Hi!
Lets get straight to the point - currently, records in binding to mpg123 (file ./src/uos_mpg123.pas) are all declared as packed - that is, without any fields alignment. This should NOT be so, as the mpg123 does not use structure packing. Structures used there have default field alignment.
Most of the records are not affected by this, but some are - namely mpg123_text and mpg123_id3v2, mabe more - therefore with current declaration, they cannot be used (it would result in AV).
Solution should be simple enough - all records in mentioned file should be declared without the packed directive. I have tested it and it seems to resolve the problem.

BTW - i was testing only on windows, can't say how it is on other systems, but I can see no reason why it should differ there.

uos_EndProc not working on linux 64-bit xfce using uos v2.0.1 ?

Hi,

It seems that uos_EndProc(myplayerindex,@mycallbackprocedure) is not working in the latest version of uos (v 2.0.1) running on linux 64-bit xfce.

In particular, uos_EndProc is not working in any of the uos example programs present in uos version 2.0.1 such as 'MultiInput' or 'WaveForm'. The 'Play' buttons remain disabled after a sound plays, 'Stop' buttons remain enabled, etc.

However, uos_EndProc in uos v1.0.7 is working on linux 64-bit xfce, but that uos version does not have the play-from-tmemorystream capabilities which I need.

I should note that the play-from-tmemorystream capabilities of the latest uos (v 2.0.1) work well on linux 64-bit xfce - the only stumbling block is that uos_EndProc() seems to be failing as indicated above. Please also note that I am using uos with lazarus.

Any help would be appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.