Sign in Join
Wiki copytemporary

uos: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-![](/wiki-images/6/62/Uoslogo.png)
1+[![uoslogo.png](/wiki-images/7/76/uoslogo.png)](</File:uoslogo.png>)
22
3-**uos** (United OpenLib of Sound) is a multi-platform package of audio handling routines that unifies the best open-source audio libraries.
3+**uos** (United OpenLib of Sound) is a multi-platform package of audio handling routines that unifies the best open-source audio libraries.
44
55# Features
66
7-- play .mp3, .ogg, .wav, .flac, .m4a, .opus and cdrom audio files.
8-- 16, 32 or float 32 bit resolution
9-- record all types of input into file, in 16 or 32 bit resolution, mono or stereo.
10-- add DSP effects and filters, however many you want and record it.
11-- play multiple inputs and outputs simultaneously
12-- internet audio streaming of mp3 and opus files.
13-- produce sound by the build-in synthesizer.
7+ * Play .mp3, .ogg, .wav, .flac, .m4a, .opus, .mod, .it, .s3m, .xm and cdrom audio files.
8+ * Deal with 16, 32 integer or float 32 bit resolution.
9+ * Record all types of input into wav or ogg file with 16 or 32 bit resolution.
10+ * Add DSP effects and filters, however many you want and record it.
11+ * Play multiple inputs and outputs simultaneously.
12+ * Internet audio streaming of mp3, aac and opus files.
13+ * Produce sound by the build-in synthesizer.
1414
15-Uos can use the [[SoundTouch]], [[PortAudio]], [[SndFile]], [[Mpg123]], [[Faad]], [[OpusFile]] and [[Mp4ff]] audio libraries.
15+Uus can use the [[SoundTouch]], [[PortAudio]], [[SndFile]], [[Mpg123]], [[Faad]], [[OpusFile]], [[Libxmp]] and [[Mp4ff]] audio libraries.
1616
17-Included in the package: Examples and binary libraries for Linux 32/64, arm aarch64 Raspberry Pi, Windows 32/64, macOS 32/64 and FreeBSD 32/64.
17+Included in the package: Examples and binary libraries for Linux 32/64, arm aarch64 Raspberry Pi, Windows 32/64, macOS 32/64 and FreeBSD 32/64.
1818
1919# Download
2020
21-- <http://fredvs.github.io/uos/>
22-- <https://github.com/fredvs/uos/tree/main>
21+ * <http://fredvs.github.io/uos/>
22+ * <https://github.com/fredvs/uos/tree/main>
2323
2424# Forum
2525
26-- <http://uos-forum.108.s1.nabble.com>
26+ * <http://uos-forum.108.s1.nabble.com>
2727
2828# uoslib
2929
30-Pascal users should use uos instead.
30+Pascal users should use uos instead.
3131
32-**uoslib** is the Universal Library version of **uos** unit and is accessible from Pascal and all other languages (C, Java, ...).
32+**uoslib** is the Universal Library version of **uos** unit and is accessible from Pascal and all other languages (C, Java, ...).
3333
34-Some methods of uos are not accessible.
34+Some methods of uos are not accessible.
3535
36-Included in the package: Examples and binary libraries for Linux 32/64, Windows 32/64, macOS 32/64 and FreeBSD 32/64.
36+Included in the package: Examples and binary libraries for Linux 32/64, Windows 32/64, macOS 32/64 and FreeBSD 32/64.
3737
38-- <http://fredvs.github.io/uoslib/>
39-- <http://github.com/fredvs/uoslib/>
38+ * <http://fredvs.github.io/uoslib/>
39+ * <http://github.com/fredvs/uoslib/>
4040
4141# Install
4242
43-The best way to show how uos works is to look at the examples in /uos/examples package. All is included, you only have to compile the demos and run it...
44-
45-Here some examples how to use uos :
43+The best way to show how uos works is to look at the examples in /uos/examples package. All is included, you only have to compile the demos and run it...
4644
47-- Copy all the files in /uos/src/ into the directory of your project.
48-- add *uos_flat* or *uos* in your uses section. (for uoslib add *uoslib_h*)
49- - *uos_flat* =\> All is done by the unit. The procedures are more "universal", same syntax as uoslib.
50- - *uos* =\> The application must declare uos class and variables. The procedures can be used as oop way.
51-- All the examples in uos packages use *uos_flat*. There is a example using only *uos* =\> SimplePlayer_noflat
45+Here some examples how to use uos :
5246
53-Those libraries can be used by uos:
47+ * Copy all the files in /uos/src/ into the directory of your project.
48+ * add _uos_flat_ or _uos_ in your uses section. (for uoslib add _uoslib_h_)
49+ * _uos_flat_ => All is done by the unit. The procedures are more "universal", same syntax as uoslib.
50+ * _uos_ => The application must declare uos class and variables. The procedures can be used as oop way.
51+ * All the examples in uos packages use _uos_flat_. There is a example using only _uos_ => SimplePlayer_noflat
5452
55-- PortAudio for dealing with audio devices of sound card,
56-- SndFile for decoding wav, flac, org audio files,
57-- Mpg123 for decoding mp3 audio files,
58-- Faad and Mp4ff for decoding m4a audio files,
59-- OpusFile for decoding opus audio files,
60-- SoundTouch plugin for changing tempo of any type of audio files,
61-- bs2b plugin to apply stereo to binaural effect.
53+Those libraries can be used by uos:
6254
63-You may load those libraries with:
55+ * PortAudio for dealing with audio devices of sound card,
56+ * SndFile for decoding wav, flac, org audio files,
57+ * Mpg123 for decoding mp3 audio files,
58+ * Faad and Mp4ff for decoding m4a audio files,
59+ * OpusFile for decoding opus audio files,
60+ * Libxmp for decoding mod, it, s3m, xm audio files,
61+ * fdkaac for decoding aac web-stream audio files.
62+ * SoundTouch plugin for changing tempo of any type of audio files,
63+ * bs2b plugin to apply stereo to binaural effect.
6464
65-```text
66-uos_LoadLib( pchar(PortAudioFileName), pchar(SndFileFileName), pchar(Mpg123FileName), pchar(Mp4ffFileName), pchar(FaadFileName), pchar(OpusFileFileName) );
65+You may load those libraries with:
6766```
68-
69-If some libraries are not needed, just replace the filename with "nil".
67+uos_LoadLib( pchar(PortAudioFileName), pchar(SndFileFileName), pchar(Mpg123FileName), pchar(Mp4ffFileName), pchar(FaadFileName), pchar(OpusFileFileName), pchar(LibxmpFileFileName),pchar(fdkaacFilename) );
68+```
7069
71-If you replace the filename with pchar('system'), the library of the system will be used (if exists).
70+If some libraries are not needed, just replace the filename with "nil".
7271
73-WARNING: Do not forget to call **uos_free()** when application terminates.
72+If you replace the filename with pchar('system'), the library of the system will be used (if exists).
7473
75-Play a file 'MySong.mp3':
74+WARNING: Do not forget to call **uos_free()** when application terminates.
7675
77-``` pascal
76+Play a file 'MySong.mp3':
77+```
7878begin
79- uos_LoadLib( PortAudioFileName, nil, Mpg123FileName, nil, nil, nil); // only PortAudio and Mpg123 are needed.
80- uos_CreatePlayer( 0 ); // you may create how many players you want, from 0 to to what you computer can do...
81- uos_AddIntoDevOut( 0 ); // Add Output with default parameters
82- uos_AddFromFile( 0, 'MySong.mp3' ); // Input from audio file
83- // And let's play it...
84- uos_Play(0); // Play the song...
85-end;
86-...
87-uos_free; // Call this at end of application.
79+ uos_LoadLib( PortAudioFileName, nil, Mpg123FileName, nil, nil, nil, nil, nil); // only PortAudio and Mpg123 are needed.
80+ uos_CreatePlayer( 0 ); // you may create how many players you want, from 0 to to what you computer can do...
81+ uos_AddIntoDevOut( 0 ); // Add Output with default parameters
82+ uos_AddFromFile( 0, 'MySong.mp3' ); // Input from audio file
83+ // And let's play it...
84+ uos_Play(0); // Play the song...
85+ end;
86+ ...
87+ uos_free; // Call this at end of application.
8888```
8989
90-Play a sound file with some dsp effects (only for uos, in future for uoslib too):
91-
92-``` pascal
90+Play a sound file with some dsp effects (only for uos, in future for uoslib too):
91+```
9392begin
94- uos_LoadLib( pchar(PortAudioFileName), nil, pchar(Mpg123FileName), nil, nil, nil); // only PortAudio and Mpg123 are needed.
95- uos_CreatePlayer( 0 ); // First create the player:
96- uos_AddIntoDevOut( 0 ); // Add Output with default parameters
97- uos_AddFromFile( 0, 'MySong.mp3' ); // Input from audio file
98- uos_InputAddDSP( 0, 1 ); // Add as many dsp effects you want
99- uos_InputAddDSP( 0, 2 );
100- uos_Play( 0 ); // Play the song with DSP effect...
101-end;
102-...
103-uos_free; // Call this at end of application.
93+ uos_LoadLib( pchar(PortAudioFileName), nil, pchar(Mpg123FileName), nil, nil, nil, nil, nil); // only PortAudio and Mpg123 are needed.
94+ uos_CreatePlayer( 0 ); // First create the player:
95+ uos_AddIntoDevOut( 0 ); // Add Output with default parameters
96+ uos_AddFromFile( 0, 'MySong.mp3' ); // Input from audio file
97+ uos_InputAddDSP( 0, 1 ); // Add as many dsp effects you want
98+ uos_InputAddDSP( 0, 2 );
99+ uos_Play( 0 ); // Play the song with DSP effect...
100+ end;
101+ ...
102+ uos_free; // Call this at end of application.
104103```
105104
106-Listen to your mic into your loudspeakers (for uoslib too) :
107-
108-``` pascal
105+Listen to your mic into your loudspeakers (for uoslib too) :
106+```
109107begin
110- uos_LoadLib( pchar(PortAudioFileName), nil, nil, nil, nil, nil); // only PortAudio is needed.
111- uos_CreatePlayer( 0 );
112- uos_AddIntoDevOut( 0 );
113- uos_AddFromDevIn( 0 ); // Input from IN Device
114- uos_Play( 0 ); // Listen to your mic in your loudspeakers...
115-end;
116-...
117-uos_free; // Call this at end of application.
108+ uos_LoadLib( pchar(PortAudioFileName), nil, nil, nil, nil, nil, nil, nil); // only PortAudio is needed.
109+ uos_CreatePlayer( 0 );
110+ uos_AddIntoDevOut( 0 );
111+ uos_AddFromDevIn( 0 ); // Input from IN Device
112+ uos_Play( 0 ); // Listen to your mic in your loudspeakers...
113+ end;
114+ ...
115+ uos_free; // Call this at end of application.
118116```
119117
120-Now, listen to your mic, listen to a mp3, apply some effects and record the mic into wav file at same time:
121-
122-``` pascal
118+Now, listen to your mic, listen to a mp3, apply some effects and record the mic into wav file at same time:
119+```
123120begin
124- uos_LoadLib( pchar(PortAudioFileName), pchar(SndFileFileName), pchar(Mpg123FileName), nil, nil, nil);
125- uos_CreatePlayer( 0 );
126- uos_AddIntoDevOut( 0 ) ; // Output into OUT Device
127- uos_AddIntoFile( 0, 'Myrecord.wav' ); // Output into wav file
128- uos_AddFromDevIn( 0 ); // Input from IN Device
129- uos_InputAddDSP( 0, 1 ); // Add as many dsp's you want
130- uos_InputAddDSP( 0, 2 );
131- uos_CreatePlayer( 1 );
132- uos_AddFromFile( 1, 'MySong.mp3' ); // the background audio file
133- uos_AddIntoDevOut( 1 ) ; // Output into OUT1 Device;
134-
135- uos_Play(0); // Listen your mic with DSP effects and record it ...
136- uos_Play(1); // Listen to mp3 while recording
137-end;
138-...
139-uos_free; // Call this at end of application.
121+ uos_LoadLib( pchar(PortAudioFileName), pchar(SndFileFileName), pchar(Mpg123FileName), nil, nil, nil, nil, nil);
122+ uos_CreatePlayer( 0 );
123+ uos_AddIntoDevOut( 0 ) ; // Output into OUT Device
124+ uos_AddIntoFile( 0, 'Myrecord.wav' ); // Output into wav file
125+ uos_AddFromDevIn( 0 ); // Input from IN Device
126+ uos_InputAddDSP( 0, 1 ); // Add as many dsp's you want
127+ uos_InputAddDSP( 0, 2 );
128+ uos_CreatePlayer( 1 );
129+ uos_AddFromFile( 1, 'MySong.mp3' ); // the background audio file
130+ uos_AddIntoDevOut( 1 ) ; // Output into OUT1 Device;
131+
132+ uos_Play(0); // Listen your mic with DSP effects and record it ...
133+ uos_Play(1); // Listen to mp3 while recording
134+ end;
135+ ...
136+ uos_free; // Call this at end of application.
140137```
141138
142139# Syntax
143140
144-Here are the basic uos methods. Each method has its equivalent with arguments for custom parameters.
145-
146-Initialization methods:
141+Here are the basic uos methods. Each method has its equivalent with arguments for custom parameters.
147142
148-```text
149-uos_LoadLib( ); // Load dynamic libraries for uos
150-uos_LoadLibs( ); // Load dynamic libraries for uoslibs
151-uos_UnLoadLib(); // To unload libraries.
152-uos_Free; // To use when application terminate.
143+Initialization methods:
153144```
154-
155-Output
145+uos_LoadLib(); // Load dynamic libraries for uos
146+ uos_LoadLibs(); // Load dynamic libraries for uoslibs
147+ uos_UnLoadLib(); // To unload libraries.
148+ uos_Free; // To use when application terminate.
149+```
156150
157-```text
151+Output
152+```
158153uos_AddIntoDevOut(); // Output into OUT Device
159-uos_AddIntoFile(); // Output into Wav File
160-uos_AddIntoMemoryBuffer() // Add a Output into memory buffer
161-uos_AddIntoMemoryStream() // Add a Output into memory stream
162-uos_AddIntoIceServer() // Add a Output into a IceCast server
163-uos_AddIntoFileFromMem() // Add a Output into audio wav file from TMemoryStream
154+ uos_AddIntoFile(); // Output into Wav File
155+ uos_AddIntoMemoryBuffer() // Add a Output into memory buffer
156+ uos_AddIntoMemoryStream() // Add a Output into memory stream
157+ uos_AddIntoIceServer() // Add a Output into a IceCast server
158+ uos_AddIntoFileFromMem() // Add a Output into audio wav file from TMemoryStream
164159```
165160
166-Input
167-
168-```text
161+Input
162+```
169163uos_AddFromDevIn(); // Input from IN device
170-uos_AddFromFile(); // Input from Audio File
171-uos_AddFromMemoryBuffer(); // Input from decoded pcm buffer
172-uos_AddFromMemoryStream(); // Input from a TMemoryStream of Audio File
173-uos_AddFromFileIntoMemory(); // Input from audio file and stored into memory buffer
174-uos_AddFromURL(); // Input from internet URL mp3/opus files
175-uos_AddFromSynth(; // Input form built-in Synthesizer
176-uos_InputLength(); // Length of Input in samples
177-uos_InputPosition(); // Get position
178-uos_InputSeek(); // Change position in byte
179-uos_InputSeekTime(); // Change position in time
180-uos_InputSeekSeconds(); // Change position in second
164+ uos_AddFromFile(); // Input from Audio File
165+ uos_AddFromMemoryBuffer(); // Input from decoded pcm buffer
166+ uos_AddFromMemoryStream(); // Input from a TMemoryStream of Audio File
167+ uos_AddFromFileIntoMemory(); // Input from audio file and stored into memory buffer
168+ uos_AddFromURL(); // Input from internet URL mp3/opus/aac files
169+ uos_AddFromSynth(; // Input form built-in Synthesizer
170+ uos_InputLength(); // Length of Input in samples
171+ uos_InputPosition(); // Get position
172+ uos_InputSeek(); // Change position in byte
173+ uos_InputSeekTime(); // Change position in time
174+ uos_InputSeekSeconds(); // Change position in second
181175```
182176
183-Player
184-
185-```text
177+Player
178+```
186179uos_Play(); // Start playing
187-uos_PlayPaused(); // Start playing paused.
188-uos_PlayNoFree(); // Start playing but do not free the player after stop.
189-uos_PlayPausedNoFree(); // Start playing paused but do not free the player after stop.
190-uos_RePlay(); // Resume playing after pause
191-uos_Stop(); // Stop playing and free thread
192-uos_Pause(); // Pause playing
193-uos_FreePlayer(); // Free the player. Works only when PlayNoFree() was used.
180+ uos_PlayPaused(); // Start playing paused.
181+ uos_PlayNoFree(); // Start playing but do not free the player after stop.
182+ uos_PlayPausedNoFree(); // Start playing paused but do not free the player after stop.
183+ uos_RePlay(); // Resume playing after pause
184+ uos_Stop(); // Stop playing and free thread
185+ uos_Pause(); // Pause playing
186+ uos_FreePlayer(); // Free the player. Works only when PlayNoFree() was used.
194187```
195188
196-DSP
197-
198-``` pascal
189+DSP
190+```
199191uos_InputAddDSP() // DSP procedure for input
200-uos_OutputAddDSP() // DSP procedure for output
201-uos_InputSetDSP() // Set DSP In
202-uos_OutputSetDSP() // Set DSP out
203-uos_InputSetDSPVolume(...) // Set Volume
204-uos_InputAddFilter(...) // Add filer
205-uos_AddPlugin(...) // Add pluggin
192+ uos_OutputAddDSP() // DSP procedure for output
193+ uos_InputSetDSP() // Set DSP In
194+ uos_OutputSetDSP() // Set DSP out
195+ uos_InputSetDSPVolume(...) // Set Volume
196+ uos_InputAddFilter(...) // Add filer
197+ uos_AddPlugin(...) // Add pluggin
206198```
207199
208200And much more other procedures/functions (see in uos.pas...)
209201
210202---
211-*From the Free Pascal wiki, page "uos", as it stood on 2021-08-08 after a change by Fredvs, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
212-Category: Audio
213-Category: Lazarus
214-Category: Libraries
203+*From the Free Pascal wiki, page "uos", as the Internet Archive kept it on 2025-03-12, last changed on 2024-10-08. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history