OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

498 lines
17 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../espeak/espeak-1.45.04-use-system-portaudio-header.patch
  5. # Copyright (C) 2011 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff -ruN espeak-1.45.04-source-orig/src/portaudio.h espeak-1.45.04-source/src/portaudio.h
  17. --- espeak-1.45.04-source-orig/src/portaudio.h 2011-04-25 18:22:27.000000000 +0200
  18. +++ espeak-1.45.04-source/src/portaudio.h 1970-01-01 01:00:00.000000000 +0100
  19. @@ -1,466 +0,0 @@
  20. -// NOTE: Copy this file to portaudio.h in order to compile with V18 portaudio
  21. -
  22. -
  23. -#ifndef PORT_AUDIO_H
  24. -#define PORT_AUDIO_H
  25. -
  26. -#ifdef __cplusplus
  27. -extern "C"
  28. -{
  29. -#endif /* __cplusplus */
  30. -
  31. -/*
  32. - * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $
  33. - * PortAudio Portable Real-Time Audio Library
  34. - * PortAudio API Header File
  35. - * Latest version available at: http://www.audiomulch.com/portaudio/
  36. - *
  37. - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
  38. - *
  39. - * Permission is hereby granted, free of charge, to any person obtaining
  40. - * a copy of this software and associated documentation files
  41. - * (the "Software"), to deal in the Software without restriction,
  42. - * including without limitation the rights to use, copy, modify, merge,
  43. - * publish, distribute, sublicense, and/or sell copies of the Software,
  44. - * and to permit persons to whom the Software is furnished to do so,
  45. - * subject to the following conditions:
  46. - *
  47. - * The above copyright notice and this permission notice shall be
  48. - * included in all copies or substantial portions of the Software.
  49. - *
  50. - * Any person wishing to distribute modifications to the Software is
  51. - * requested to send the modifications to the original developer so that
  52. - * they can be incorporated into the canonical version.
  53. - *
  54. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  55. - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  56. - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  57. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
  58. - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  59. - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  60. - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  61. - *
  62. - */
  63. -
  64. -typedef int PaError;
  65. -typedef enum {
  66. - paNoError = 0,
  67. -
  68. - paHostError = -10000,
  69. - paInvalidChannelCount,
  70. - paInvalidSampleRate,
  71. - paInvalidDeviceId,
  72. - paInvalidFlag,
  73. - paSampleFormatNotSupported,
  74. - paBadIODeviceCombination,
  75. - paInsufficientMemory,
  76. - paBufferTooBig,
  77. - paBufferTooSmall,
  78. - paNullCallback,
  79. - paBadStreamPtr,
  80. - paTimedOut,
  81. - paInternalError,
  82. - paDeviceUnavailable
  83. -} PaErrorNum;
  84. -
  85. -/*
  86. - Pa_Initialize() is the library initialisation function - call this before
  87. - using the library.
  88. -
  89. -*/
  90. -
  91. -PaError Pa_Initialize( void );
  92. -
  93. -/*
  94. - Pa_Terminate() is the library termination function - call this after
  95. - using the library.
  96. -
  97. -*/
  98. -
  99. -PaError Pa_Terminate( void );
  100. -
  101. -/*
  102. - Pa_GetHostError() returns a host specific error code.
  103. - This can be called after receiving a PortAudio error code of paHostError.
  104. -
  105. -*/
  106. -
  107. -long Pa_GetHostError( void );
  108. -
  109. -/*
  110. - Pa_GetErrorText() translates the supplied PortAudio error number
  111. - into a human readable message.
  112. -
  113. -*/
  114. -
  115. -const char *Pa_GetErrorText( PaError errnum );
  116. -
  117. -/*
  118. - Sample formats
  119. -
  120. - These are formats used to pass sound data between the callback and the
  121. - stream. Each device has a "native" format which may be used when optimum
  122. - efficiency or control over conversion is required.
  123. -
  124. - Formats marked "always available" are supported (emulated) by all
  125. - PortAudio implementations.
  126. -
  127. - The floating point representation (paFloat32) uses +1.0 and -1.0 as the
  128. - maximum and minimum respectively.
  129. -
  130. - paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
  131. -
  132. -*/
  133. -
  134. -typedef unsigned long PaSampleFormat;
  135. -#define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/
  136. -#define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/
  137. -#define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/
  138. -#define paInt24 ((PaSampleFormat) (1<<3))
  139. -#define paPackedInt24 ((PaSampleFormat) (1<<4))
  140. -#define paInt8 ((PaSampleFormat) (1<<5))
  141. -#define paUInt8 ((PaSampleFormat) (1<<6))
  142. -#define paCustomFormat ((PaSampleFormat) (1<<16))
  143. -
  144. -/*
  145. - Device enumeration mechanism.
  146. -
  147. - Device ids range from 0 to Pa_CountDevices()-1.
  148. -
  149. - Devices may support input, output or both.
  150. -
  151. -*/
  152. -
  153. -typedef int PaDeviceID;
  154. -#define paNoDevice -1
  155. -
  156. -int Pa_CountDevices( void );
  157. -
  158. -typedef struct
  159. -{
  160. - int structVersion;
  161. - const char *name;
  162. - int maxInputChannels;
  163. - int maxOutputChannels;
  164. - /* Number of discrete rates, or -1 if range supported. */
  165. - int numSampleRates;
  166. - /* Array of supported sample rates, or {min,max} if range supported. */
  167. - const double *sampleRates;
  168. - PaSampleFormat nativeSampleFormats;
  169. -}
  170. -PaDeviceInfo;
  171. -
  172. -/*
  173. - Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the
  174. - default device ids for input and output respectively, or paNoDevice if
  175. - no device is available.
  176. - The result can be passed to Pa_OpenStream().
  177. -
  178. - On the PC, the user can specify a default device by
  179. - setting an environment variable. For example, to use device #1.
  180. -
  181. - set PA_RECOMMENDED_OUTPUT_DEVICE=1
  182. -
  183. - The user should first determine the available device ids by using
  184. - the supplied application "pa_devs".
  185. -
  186. -*/
  187. -
  188. -PaDeviceID Pa_GetDefaultInputDeviceID( void );
  189. -PaDeviceID Pa_GetDefaultOutputDeviceID( void );
  190. -
  191. -
  192. -
  193. -/*
  194. - Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure
  195. - for the device specified.
  196. - If the device parameter is out of range the function returns NULL.
  197. -
  198. - PortAudio manages the memory referenced by the returned pointer, the client
  199. - must not manipulate or free the memory. The pointer is only guaranteed to be
  200. - valid between calls to Pa_Initialize() and Pa_Terminate().
  201. -
  202. -*/
  203. -
  204. -const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device );
  205. -
  206. -/*
  207. - PaTimestamp is used to represent a continuous sample clock with arbitrary
  208. - start time that can be used for syncronization. The type is used for the
  209. - outTime argument to the PortAudioCallback and as the result of Pa_StreamTime()
  210. -
  211. -*/
  212. -
  213. -typedef double PaTimestamp;
  214. -
  215. -/*
  216. - PortAudioCallback is implemented by PortAudio clients.
  217. -
  218. - inputBuffer and outputBuffer are arrays of interleaved samples,
  219. - the format, packing and number of channels used by the buffers are
  220. - determined by parameters to Pa_OpenStream() (see below).
  221. -
  222. - framesPerBuffer is the number of sample frames to be processed by the callback.
  223. -
  224. - outTime is the time in samples when the buffer(s) processed by
  225. - this callback will begin being played at the audio output.
  226. - See also Pa_StreamTime()
  227. -
  228. - userData is the value of a user supplied pointer passed to Pa_OpenStream()
  229. - intended for storing synthesis data etc.
  230. -
  231. - return value:
  232. - The callback can return a non-zero value to stop the stream. This may be
  233. - useful in applications such as soundfile players where a specific duration
  234. - of output is required. However, it is not necessary to utilise this mechanism
  235. - as StopStream() will also terminate the stream. A callback returning a
  236. - non-zero value must fill the entire outputBuffer.
  237. -
  238. - NOTE: None of the other stream functions may be called from within the
  239. - callback function except for Pa_GetCPULoad().
  240. -
  241. -*/
  242. -
  243. -typedef int (PortAudioCallback)(
  244. - void *inputBuffer, void *outputBuffer,
  245. - unsigned long framesPerBuffer,
  246. - PaTimestamp outTime, void *userData );
  247. -
  248. -
  249. -/*
  250. - Stream flags
  251. -
  252. - These flags may be supplied (ored together) in the streamFlags argument to
  253. - the Pa_OpenStream() function.
  254. -
  255. -*/
  256. -
  257. -#define paNoFlag (0)
  258. -#define paClipOff (1<<0) /* disable default clipping of out of range samples */
  259. -#define paDitherOff (1<<1) /* disable default dithering */
  260. -#define paPlatformSpecificFlags (0x00010000)
  261. -typedef unsigned long PaStreamFlags;
  262. -
  263. -/*
  264. - A single PortAudioStream provides multiple channels of real-time
  265. - input and output audio streaming to a client application.
  266. - Pointers to PortAudioStream objects are passed between PortAudio functions.
  267. -*/
  268. -
  269. -typedef void PortAudioStream;
  270. -#define PaStream PortAudioStream
  271. -
  272. -/*
  273. - Pa_OpenStream() opens a stream for either input, output or both.
  274. -
  275. - stream is the address of a PortAudioStream pointer which will receive
  276. - a pointer to the newly opened stream.
  277. -
  278. - inputDevice is the id of the device used for input (see PaDeviceID above.)
  279. - inputDevice may be paNoDevice to indicate that an input device is not required.
  280. -
  281. - numInputChannels is the number of channels of sound to be delivered to the
  282. - callback. It can range from 1 to the value of maxInputChannels in the
  283. - PaDeviceInfo record for the device specified by the inputDevice parameter.
  284. - If inputDevice is paNoDevice numInputChannels is ignored.
  285. -
  286. - inputSampleFormat is the sample format of inputBuffer provided to the callback
  287. - function. inputSampleFormat may be any of the formats described by the
  288. - PaSampleFormat enumeration (see above). PortAudio guarantees support for
  289. - the device's native formats (nativeSampleFormats in the device info record)
  290. - and additionally 16 and 32 bit integer and 32 bit floating point formats.
  291. - Support for other formats is implementation defined.
  292. -
  293. - inputDriverInfo is a pointer to an optional driver specific data structure
  294. - containing additional information for device setup or stream processing.
  295. - inputDriverInfo is never required for correct operation. If not used
  296. - inputDriverInfo should be NULL.
  297. -
  298. - outputDevice is the id of the device used for output (see PaDeviceID above.)
  299. - outputDevice may be paNoDevice to indicate that an output device is not required.
  300. -
  301. - numOutputChannels is the number of channels of sound to be supplied by the
  302. - callback. See the definition of numInputChannels above for more details.
  303. -
  304. - outputSampleFormat is the sample format of the outputBuffer filled by the
  305. - callback function. See the definition of inputSampleFormat above for more
  306. - details.
  307. -
  308. - outputDriverInfo is a pointer to an optional driver specific data structure
  309. - containing additional information for device setup or stream processing.
  310. - outputDriverInfo is never required for correct operation. If not used
  311. - outputDriverInfo should be NULL.
  312. -
  313. - sampleRate is the desired sampleRate. For full-duplex streams it is the
  314. - sample rate for both input and output
  315. -
  316. - framesPerBuffer is the length in sample frames of all internal sample buffers
  317. - used for communication with platform specific audio routines. Wherever
  318. - possible this corresponds to the framesPerBuffer parameter passed to the
  319. - callback function.
  320. -
  321. - numberOfBuffers is the number of buffers used for multibuffered communication
  322. - with the platform specific audio routines. If you pass zero, then an optimum
  323. - value will be chosen for you internally. This parameter is provided only
  324. - as a guide - and does not imply that an implementation must use multibuffered
  325. - i/o when reliable double buffering is available (such as SndPlayDoubleBuffer()
  326. - on the Macintosh.)
  327. -
  328. - streamFlags may contain a combination of flags ORed together.
  329. - These flags modify the behaviour of the streaming process. Some flags may only
  330. - be relevant to certain buffer formats.
  331. -
  332. - callback is a pointer to a client supplied function that is responsible
  333. - for processing and filling input and output buffers (see above for details.)
  334. -
  335. - userData is a client supplied pointer which is passed to the callback
  336. - function. It could for example, contain a pointer to instance data necessary
  337. - for processing the audio buffers.
  338. -
  339. - return value:
  340. - Upon success Pa_OpenStream() returns PaNoError and places a pointer to a
  341. - valid PortAudioStream in the stream argument. The stream is inactive (stopped).
  342. - If a call to Pa_OpenStream() fails a non-zero error code is returned (see
  343. - PaError above) and the value of stream is invalid.
  344. -
  345. -*/
  346. -
  347. -PaError Pa_OpenStream( PortAudioStream** stream,
  348. - PaDeviceID inputDevice,
  349. - int numInputChannels,
  350. - PaSampleFormat inputSampleFormat,
  351. - void *inputDriverInfo,
  352. - PaDeviceID outputDevice,
  353. - int numOutputChannels,
  354. - PaSampleFormat outputSampleFormat,
  355. - void *outputDriverInfo,
  356. - double sampleRate,
  357. - unsigned long framesPerBuffer,
  358. - unsigned long numberOfBuffers,
  359. - PaStreamFlags streamFlags,
  360. - PortAudioCallback *callback,
  361. - void *userData );
  362. -
  363. -
  364. -/*
  365. - Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens
  366. - the default input and/or output devices. Most parameters have identical meaning
  367. - to their Pa_OpenStream() counterparts, with the following exceptions:
  368. -
  369. - If either numInputChannels or numOutputChannels is 0 the respective device
  370. - is not opened. This has the same effect as passing paNoDevice in the device
  371. - arguments to Pa_OpenStream().
  372. -
  373. - sampleFormat applies to both the input and output buffers.
  374. -
  375. -*/
  376. -
  377. -PaError Pa_OpenDefaultStream( PortAudioStream** stream,
  378. - int numInputChannels,
  379. - int numOutputChannels,
  380. - PaSampleFormat sampleFormat,
  381. - double sampleRate,
  382. - unsigned long framesPerBuffer,
  383. - unsigned long numberOfBuffers,
  384. - PortAudioCallback *callback,
  385. - void *userData );
  386. -
  387. -/*
  388. - Pa_CloseStream() closes an audio stream, flushing any pending buffers.
  389. -
  390. -*/
  391. -
  392. -PaError Pa_CloseStream( PortAudioStream* );
  393. -
  394. -/*
  395. - Pa_StartStream() and Pa_StopStream() begin and terminate audio processing.
  396. - Pa_StopStream() waits until all pending audio buffers have been played.
  397. - Pa_AbortStream() stops playing immediately without waiting for pending
  398. - buffers to complete.
  399. -
  400. -*/
  401. -
  402. -PaError Pa_StartStream( PortAudioStream *stream );
  403. -
  404. -PaError Pa_StopStream( PortAudioStream *stream );
  405. -
  406. -PaError Pa_AbortStream( PortAudioStream *stream );
  407. -
  408. -/*
  409. - Pa_StreamActive() returns one (1) when the stream is active (ie playing
  410. - or recording audio), zero (0) when not playing, or a negative error number
  411. - if the stream is invalid.
  412. - The stream is active between calls to Pa_StartStream() and Pa_StopStream(),
  413. - but may also become inactive if the callback returns a non-zero value.
  414. - In the latter case, the stream is considered inactive after the last
  415. - buffer has finished playing.
  416. -
  417. -*/
  418. -
  419. -PaError Pa_StreamActive( PortAudioStream *stream );
  420. -
  421. -/*
  422. - Pa_StreamTime() returns the current output time in samples for the stream.
  423. - This time may be used as a time reference (for example synchronizing audio to
  424. - MIDI).
  425. -
  426. -*/
  427. -
  428. -PaTimestamp Pa_StreamTime( PortAudioStream *stream );
  429. -
  430. -/*
  431. - Pa_GetCPULoad() returns the CPU Load for the stream.
  432. - The "CPU Load" is a fraction of total CPU time consumed by the stream's
  433. - audio processing routines including, but not limited to the client supplied
  434. - callback.
  435. - A value of 0.5 would imply that PortAudio and the sound generating
  436. - callback was consuming roughly 50% of the available CPU time.
  437. - This function may be called from the callback function or the application.
  438. -
  439. -*/
  440. -
  441. -double Pa_GetCPULoad( PortAudioStream* stream );
  442. -
  443. -/*
  444. - Pa_GetMinNumBuffers() returns the minimum number of buffers required by
  445. - the current host based on minimum latency.
  446. - On the PC, for the DirectSound implementation, latency can be optionally set
  447. - by user by setting an environment variable.
  448. - For example, to set latency to 200 msec, put:
  449. -
  450. - set PA_MIN_LATENCY_MSEC=200
  451. -
  452. - in the AUTOEXEC.BAT file and reboot.
  453. - If the environment variable is not set, then the latency will be determined
  454. - based on the OS. Windows NT has higher latency than Win95.
  455. -
  456. -*/
  457. -
  458. -int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate );
  459. -
  460. -/*
  461. - Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds.
  462. - You may sleep longer than the requested time so don't rely on this for
  463. - accurate musical timing.
  464. -
  465. - Pa_Sleep() is provided as a convenience for authors of portable code (such as
  466. - the tests and examples in the PortAudio distribution.)
  467. -
  468. -*/
  469. -
  470. -void Pa_Sleep( long msec );
  471. -
  472. -/*
  473. - Pa_GetSampleSize() returns the size in bytes of a single sample in the
  474. - supplied PaSampleFormat, or paSampleFormatNotSupported if the format is
  475. - no supported.
  476. -
  477. -*/
  478. -
  479. -PaError Pa_GetSampleSize( PaSampleFormat format );
  480. -
  481. -
  482. -#ifdef __cplusplus
  483. -}
  484. -#endif /* __cplusplus */
  485. -#endif /* PORT_AUDIO_H */
  486. diff -ruN espeak-1.45.04-source-orig/src/wavegen.cpp espeak-1.45.04-source/src/wavegen.cpp
  487. --- espeak-1.45.04-source-orig/src/wavegen.cpp 2011-05-27 15:49:38.376003719 +0200
  488. +++ espeak-1.45.04-source/src/wavegen.cpp 2011-05-27 15:40:41.372005925 +0200
  489. @@ -39,7 +39,7 @@
  490. //#undef INCLUDE_KLATT
  491. #ifdef USE_PORTAUDIO
  492. -#include "portaudio.h"
  493. +#include <portaudio.h>
  494. #undef USE_PORTAUDIO
  495. // determine portaudio version by looking for a #define which is not in V18
  496. #ifdef paNeverDropInput