2 * QEMU Audio subsystem header
4 * Copyright (c) 2003-2004 Vassili Karpov (malc)
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
36 typedef struct SWVoice SWVoice
;
38 SWVoice
* AUD_open (SWVoice
*sw
, const char *name
, int freq
,
39 int nchannels
, audfmt_e fmt
);
41 void AUD_log (const char *cap
, const char *fmt
, ...)
42 __attribute__ ((__format__ (__printf__
, 2, 3)));;
43 void AUD_close (SWVoice
*sw
);
44 int AUD_write (SWVoice
*sw
, void *pcm_buf
, int size
);
45 void AUD_adjust (SWVoice
*sw
, int leftover
);
46 void AUD_reset (SWVoice
*sw
);
47 int AUD_get_free (SWVoice
*sw
);
48 int AUD_get_buffer_size (SWVoice
*sw
);
50 void AUD_enable (SWVoice
*sw
, int on
);
51 int AUD_calc_elapsed (SWVoice
*sw
);
53 static inline void *advance (void *p
, int incr
)
59 uint32_t popcount (uint32_t u
);
60 inline uint32_t lsbindex (uint32_t u
);
62 #define audio_MIN(a, b) ((a)>(b)?(b):(a))
63 #define audio_MAX(a, b) ((a)<(b)?(b):(a))