Sign in Join
Wiki copytemporary

Multimedia Programming/zh CN: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Multimedia Programming/zh CN

OldNewLine
1+## 播放视频
2+
3+The [[Video Playback Libraries]] page contains an annotated list of libraries for Windows, as well as any operating system which is supported by FFmpeg or by VLC. These libraries can be used to embed video playback in your applications.
4+
5+## 播放音频
6+
7+### 本地解决方案
8+
9+#### macOS
10+
11+- [[macOS Play Alert Sound|System Sound Services]] For up to 30 second sound clips, alerts etc.
12+- [[macOS Audio Player|AVAudioPlayer]] For longer audio files with volume control, pause, stop, resume, loop control, background music etc.
13+- [[macOS NSSound]] A very simple method for playing system sounds, application bundle sound files, other sound files with volume control, pause, stop, resume, loops etc.
14+- OpenAL comes pre-installed on macOS (Deprecated at WWDC2019; to be removed in a future macOS release).
15+
16+#### Windows
17+
18+##### Windows API
19+
20+你可以使用Windows API来播放,例如wav文件:
21+
22+``` pascal
23+...
24+uses MMSystem;
25+...
26+sndPlaySound('C:\sounds\test.wav', snd_Async or snd_NoDefault);
27+```
28+
29+自动处理故障的方法,这将允许附加路径和非拉丁文字母的文件名:
30+
31+``` pascal
32+...
33+uses LazUTF8;
34+...
35+sndPlaySound(pchar(UTF8ToSys('C:\sounds\测试.wav')), snd_Async or snd_NoDefault);
36+```
37+
38+或者
39+
40+``` pascal
41+...
42+uses LazUTF8;
43+...
44+sndPlaySound(pchar(UTF8ToConsole('C:\sounds\测试.wav')), snd_Async or snd_NoDefault);
45+```
46+
47+##### Audiere库
48+
49+Has bindings for Delphi, but they do not work with FPC:
50+
51+- <http://code.google.com/p/audiere-bind-delphi/>
52+
53+##### Squall sound
54+
55+Squall sound 与FPC一起工作地很好.它有3D音频和EAX效果,但是仅支持MP3,OGG和WAV格式. Open sourced in 在2009年开放源码,似乎已死亡.仅支持Windows.
56+
57+<https://github.com/xtreme3d/squall>
58+
59+### 跨平台
60+
61+#### ACS (Audio Component Suite)
62+
63+For more information, read the article about the [[ACS|Audio Component Suite]]
64+
65+#### Audorra Library
66+
67+This library for Linux and Windows works well with Lazarus:
68+
69+<http://sourceforge.net/projects/audorra/>
70+
71+#### BASS
72+
73+Closed source. Free for non-commercial.
74+
75+The BASS library can be downloaded from: <http://www.un4seen.com/> and <http://www.un4seen.com/forum/?topic=8682.0>
76+
77+There is a DJ application, for Windows, Linux and macOS, written with Lazarus and using Bass lib: <https://sites.google.com/site/fiensprototyping/>
78+
79+#### FMOD
80+
81+[FMOD Core](https://www.fmod.com/core) comes with an elegant API compatible with C, C++, C#, and Javascript, and runs on all major platforms. It is a closed source solution. It is free for use for non-comercial software, but requires the payment of license fees for commercial software.
82+
83+#### FPSound
84+
85+FPSound is a new library being developed in the mold of fpspreadsheet and fpvectorial: it has independent modules to read, write and play sound files and also an intermediary representation for editing. See [[FPSound]]. Uses OpenAL. Appears dead and non-working.
86+
87+#### OMEGA Engine
88+
89+The OMEGA Engine is a full game engine in single Omega.dll file which is just 50kb. It can successfully play FLAC, OGG, MP3, MP2, AMR and WMA files. It searches and uses installed audio codecs from the system. Windows and Linux only.
90+
91+<http://sourceforge.net/projects/omega-engine/files/>
92+
93+The project is dead, but it is very easy to use:
94+
95+``` pascal
96+Media_Play('Music.mp3', TRUE);
97+```
98+
99+#### OpenAL Library
100+
101+> **Note:** The OpenAL Library Framework is pre-installed on all Apple computers running macOS -- see /System/Library/Frameworks/OpenAL.framework. Apple announced at WWD2019 that **OpenAL is now deprecated** and will be removed completely in a future release of macOS.
102+
103+OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio applications.
104+
105+The library models a collection of audio sources moving in a 3D space that are heard by a single listener somewhere in that space. The basic OpenAL objects are a Listener, a Source, and a Buffer. There can be a large number of Buffers, which contain audio data. Each buffer can be attached to one or more Sources, which represent points in 3D space which are emitting audio. There is always one Listener object (per audio context), which represents the position where the sources are heard -- rendering is done from the perspective of the Listener.
106+
107+- See the [OpenAL website](https://www.openal.org) for documentation, downloads etc.
108+
109+- A tutorial for Delphi can be found [here](http://www.noeska.com/doal/tutorials.aspx).
110+
111+- Free Pascal comes with a unit for accessing OpenAL located in fpc/packages/openal as well as [usage examples](http://svn.freepascal.org/svn/fpc/trunk/packages/openal/examples).
112+
113+- There is an alternative OpenAL sound manager unit to play wav files by [Lulu](https://forum.lazarus.freepascal.org/index.php?action=profile;u=59515) [here](https://github.com/Lulu04/OALSoundManager). Tested on macOS Mojave 10.14.
114+
115+#### Play Sound Package
116+
117+The [[Play Sound Multiplatform|Play Sound Package]] takes a different approach to playing sound cross-platform. For Windows, it uses the native sound system; for Linux it searches the system for programs which will play sound and executes those asynchronously or synchronously via [[TProcess]] or [[TAsyncProcess]]. Note: only works with Windows and Linux.
118+
119+#### PortAudio
120+
121+Various bindings for [PortAudio](http://www.portaudio.com/), a cross-platform, open source library for audio playback and recording, are available.
122+
123+Forum user FredvS has written a [Pascal unit](http://lazarus.freepascal.org/index.php/topic,17521.0.html) that dynamically loads PortAudio.
124+
125+Some examples can be found [here](http://breakoutbox.de/pascal/pascal.html#PortAudio).
126+
127+#### SDL + SDL_mixer
128+
129+The basic SDL library comes with a very simple sound system. On top of that, SDL mixer adds more sound APIs which build a more flexible solution.
130+
131+Units for accessing SDL libraries are located in fpc/packages/sdl.
132+
133+#### SFML/CSFML for FPC
134+
135+[Simple and Fast Multimedia Library](https://www.sfml-dev.org/) aka SFML provides a simple interface to the various components of your PC, to ease the development of games and multimedia applications. It is composed of five modules: system, window, graphics, audio and network. With SFML, your application can compile and run out of the box on the most common operating systems: Windows, Linux, macOS and soon Android & iOS.
136+
137+Pre-compiled SDKs for your favorite OS are available on the [download page](https://www.sfml-dev.org/download.php).
138+
139+CSFML headers binding for FPC can be found at <https://github.com/DJMaster/csfml-fpc>
140+
141+#### uos (United OpenLib of Sound)
142+
143+**uos**: United OpenLib of Sound. **uos** unifies the best open-source audio libraries.
144+
145+With **uos** you can:
146+
147+- Listen to mp3, ogg, wav, flac, m4a, opus, cd audio, ... audio files.
148+- With 16, 32 or float 32 bit resolution.
149+- Record all types of input into a file.
150+- Add DSP effects and filters, however many you want and record it.
151+- Do web audio-streaming (listen to web-radio and apply filters).
152+- Listen to multiple inputs and outputs.
153+- Produce sound with built-in synthesizer.
154+
155+**uos** can use the PortAudio, SndFile, Mpg123, Faad, Mp4ff, OpusFile audio libraries and SoundTouch, Bs2b plug-in library.
156+
157+Included in the package:
158+
159+- examples.
160+- binary libraries for Linux 32/64, Windows 32/64, macOS 32/64, FreeBSD 32/64 and ARM Rpi.
161+
162+It can play mp3, ogg, wav, flac, m4a, opus, cda files.
163+
164+<http://github.com/fredvs/uos/>
165+
166+## Recording Sound
167+
168+### Native solutions
169+
170+#### macOS
171+
172+- [[macOS Audio Recorder|AVAudioRecorder]] allows you to make audio recordings straight to a file with very little programming overhead.
173+
174+### Cross platform solutions
175+
176+#### uos (United OpenLib of Sound)
177+
178+**uos**: United OpenLib of Sound. **uos** unifies the best open-source audio libraries.
179+
180+With **uos** you can:
181+
182+- Record all types of input into a file.
183+- Add DSP effects and filters, however many you want and record it.
184+
185+**uos** can use the PortAudio, SndFile, Mpg123, Faad, Mp4ff, OpusFile audio libraries and SoundTouch, Bs2b plug-in library.
186+
187+Included in the package:
188+
189+- examples.
190+- binary libraries for Linux 32/64, Windows 32/64, macOS 32/64, FreeBSD 32/64 and ARM Rpi.
191+
192+<http://github.com/fredvs/uos/>
193+
194+## MIDI
195+
196+Musical Instrument Digital Interface (MIDI) is a technical standard that describes a communications protocol, digital interface, and electrical connectors that connect a wide variety of electronic musical instruments, computers, and related audio devices for playing, editing and recording music.
197+
198+See the [[MIDI]] article for more details about the MIDI software aspect.
199+
200+## Text-To-Speech
201+
202+See [[Speech Synthesis]] for native and cross-platform solutions.
203+
204+## See also
205+
206+- [[Audio libraries]]
207+- [[Video Playback Libraries]]
208+
209+---
210+*From the Free Pascal wiki, page "Multimedia Programming/zh CN", as it stood on 2021-01-11 after a change by Robsean, 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).*

Back to history