Mercurial > molko
annotate src/libmlk-core/core/sys_p.h @ 380:31e2f6d35c34
core: fix sndfile distortion issue
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 07 Jan 2022 08:20:12 +0100 |
parents | 67c1c46af2c8 |
children | f48367c5a92e |
rev | line source |
---|---|
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 /* |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 * sys_p.h -- libcore private definitions |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 * |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 * Copyright (c) 2020-2022 David Demelier <markand@malikania.fr> |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 * |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 * Permission to use, copy, modify, and/or distribute this software for any |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 * purpose with or without fee is hereby granted, provided that the above |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 * copyright notice and this permission notice appear in all copies. |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 * |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 */ |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 #ifndef MLK_CORE_SYS_P_H |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 #define MLK_CORE_SYS_P_H |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 #include <stddef.h> |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 #include <al.h> |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 #include <alc.h> |
380
31e2f6d35c34
core: fix sndfile distortion issue
David Demelier <markand@malikania.fr>
parents:
379
diff
changeset
|
26 #include <alext.h> |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
27 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
28 extern ALCdevice *audio_dev; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
29 extern ALCcontext *audio_ctx; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
30 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
31 struct audiostream { |
380
31e2f6d35c34
core: fix sndfile distortion issue
David Demelier <markand@malikania.fr>
parents:
379
diff
changeset
|
32 short *samples; |
379
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 ALsizei samplesz; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
34 ALsizei samplerate; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
35 ALuint buffer; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
36 ALuint source; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
37 ALenum format; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
38 }; |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
39 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 struct audiostream * |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 audiostream_open(const char *); |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
43 struct audiostream * |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
44 audiostream_openmem(const void *, size_t); |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
45 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
46 void |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
47 audiostream_finish(struct audiostream *); |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 |
67c1c46af2c8
core: replace SDL2_mixer with OpenAL, closes #2528 @3h
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
49 #endif /* !MLK_CORE_SYS_P_H */ |