summaryrefslogtreecommitdiff
path: root/platform/javascript/godot_audio.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-10-02 16:25:10 +0200
committerGitHub <noreply@github.com>2020-10-02 16:25:10 +0200
commit1ff3e60ee03ddbd80e67b811a39b0b3509600657 (patch)
tree92096a0959ad1c2e8ca9eb90836f9cbeecc5b262 /platform/javascript/godot_audio.h
parent0d07a935e90eea0f652448784ea9cf6542593912 (diff)
parenta618535628176e519494a84fd3b04c32fa2a9d64 (diff)
Merge pull request #42505 from Faless/js/4.0_audio_threads
[HTML5] Move audio processing to thread when threads are enabled.
Diffstat (limited to 'platform/javascript/godot_audio.h')
-rw-r--r--platform/javascript/godot_audio.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/platform/javascript/godot_audio.h b/platform/javascript/godot_audio.h
new file mode 100644
index 0000000000..f7f26e5262
--- /dev/null
+++ b/platform/javascript/godot_audio.h
@@ -0,0 +1,58 @@
+/*************************************************************************/
+/* godot_audio.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef GODOT_AUDIO_H
+#define GODOT_AUDIO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "stddef.h"
+
+extern int godot_audio_is_available();
+
+extern int godot_audio_init(int p_mix_rate, int p_latency);
+extern int godot_audio_create_processor(int p_buffer_length, int p_channel_count);
+
+extern void godot_audio_start(float *r_buffer_ptr);
+extern void godot_audio_resume();
+extern void godot_audio_finish_async();
+
+extern float godot_audio_get_latency();
+
+extern void godot_audio_capture_start();
+extern void godot_audio_capture_stop();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GODOT_AUDIO_H */