7
#endif /* __cplusplus */
10
* $Id: pablio.h 1083 2006-08-23 07:30:49Z rossb $
12
* Portable Audio Blocking read/write utility.
14
* Author: Phil Burk, http://www.softsynth.com/portaudio/
16
* Include file for PABLIO, the Portable Audio Blocking I/O Library.
17
* PABLIO is built on top of PortAudio, the Portable Audio Library.
18
* For more information see: http://www.portaudio.com
19
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
21
* Permission is hereby granted, free of charge, to any person obtaining
22
* a copy of this software and associated documentation files
23
* (the "Software"), to deal in the Software without restriction,
24
* including without limitation the rights to use, copy, modify, merge,
25
* publish, distribute, sublicense, and/or sell copies of the Software,
26
* and to permit persons to whom the Software is furnished to do so,
27
* subject to the following conditions:
29
* The above copyright notice and this permission notice shall be
30
* included in all copies or substantial portions of the Software.
32
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
35
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
36
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
37
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42
* The text above constitutes the entire PortAudio license; however,
43
* the PortAudio community also makes the following non-binding requests:
45
* Any person wishing to distribute modifications to the Software is
46
* requested to send the modifications to the original developer so that
47
* they can be incorporated into the canonical version. It is also
48
* requested that these non-binding requests be included along with the
55
#include "portaudio.h"
56
#include "ringbuffer.h"
63
PortAudioStream *stream;
69
/* Values for flags for OpenAudioStream(). */
70
#define PABLIO_READ (1<<0)
71
#define PABLIO_WRITE (1<<1)
72
#define PABLIO_READ_WRITE (PABLIO_READ|PABLIO_WRITE)
73
#define PABLIO_MONO (1<<2)
74
#define PABLIO_STEREO (1<<3)
76
/************************************************************
77
* Write data to ring buffer.
78
* Will not return until all the data has been written.
80
long WriteAudioStream( PABLIO_Stream *aStream, void *data, long numFrames );
82
/************************************************************
83
* Read data from ring buffer.
84
* Will not return until all the data has been read.
86
long ReadAudioStream( PABLIO_Stream *aStream, void *data, long numFrames );
88
/************************************************************
89
* Return the number of frames that could be written to the stream without
92
long GetAudioStreamWriteable( PABLIO_Stream *aStream );
94
/************************************************************
95
* Return the number of frames that are available to be read from the
96
* stream without having to wait.
98
long GetAudioStreamReadable( PABLIO_Stream *aStream );
100
/************************************************************
101
* Opens a PortAudio stream with default characteristics.
102
* Allocates PABLIO_Stream structure.
104
* flags parameter can be an ORed combination of:
105
* PABLIO_READ, PABLIO_WRITE, or PABLIO_READ_WRITE,
106
* and either PABLIO_MONO or PABLIO_STEREO
108
PaError OpenAudioStream( PABLIO_Stream **aStreamPtr, double sampleRate,
109
PaSampleFormat format, long flags );
111
PaError CloseAudioStream( PABLIO_Stream *aStream );
115
#endif /* __cplusplus */
116
#endif /* _PABLIO_H */