├── .gitignore ├── .gitmodules ├── AUTHORS ├── CONTRIBUTING ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── build ├── genie.lua ├── readme.txt └── soloud_devel.bat ├── contrib ├── CMakeLists.txt ├── Configure.cmake ├── README.md ├── cmake │ ├── FindSDL2.cmake │ ├── Install.cmake │ ├── InstallExport.cmake │ ├── OptionDependentOnPackage.cmake │ └── PrintOptionStatus.cmake ├── demos.cmake ├── gen_glue.cmake └── src.cmake ├── demos ├── android │ ├── default.properties │ └── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── main.cpp ├── c_test │ └── main.c ├── common │ ├── glew │ │ └── GL │ │ │ ├── LICENSE.txt │ │ │ ├── README.txt │ │ │ ├── glew.c │ │ │ ├── glew.h │ │ │ ├── glxew.h │ │ │ └── wglew.h │ ├── imgui │ │ ├── LICENSE.txt │ │ ├── imconfig.h │ │ ├── imgui.cpp │ │ ├── imgui.h │ │ ├── imgui_demo.cpp │ │ ├── imgui_draw.cpp │ │ ├── imgui_internal.h │ │ ├── stb_rect_pack.h │ │ ├── stb_textedit.h │ │ └── stb_truetype.h │ ├── soloud_demo_framework.cpp │ ├── soloud_demo_framework.h │ └── stb_image.h ├── console │ ├── generated.inc │ └── main.cpp ├── emscripten │ ├── build_monotone │ └── build_piano ├── enumerate │ └── main.cpp ├── env │ └── main.cpp ├── glue │ ├── cs │ │ └── hello.cs │ ├── gamemaker │ │ └── hello.txt │ ├── python │ │ ├── test_gfx.py │ │ └── test_python.py │ ├── rpgmaker │ │ ├── c_test.rb │ │ ├── simplest.rb │ │ └── space.rb │ └── ruby │ │ └── test_ruby.rb ├── megademo │ ├── 3dtest.cpp │ ├── annex.cpp │ ├── ay.cpp │ ├── filterfolio.cpp │ ├── main.cpp │ ├── mixbusses.cpp │ ├── monotone.cpp │ ├── multimusic.cpp │ ├── pewpew.cpp │ ├── radiogaga.cpp │ ├── space.cpp │ ├── speakers.cpp │ ├── speechfilter.cpp │ ├── tedsid.cpp │ ├── thebutton.cpp │ ├── virtualvoices.cpp │ └── wavformats.cpp ├── null │ └── main.cpp ├── piano │ ├── RtMidi.cpp │ ├── RtMidi.h │ ├── main.cpp │ ├── soloud_adsr.h │ ├── soloud_basicwave.cpp │ ├── soloud_basicwave.h │ ├── soloud_padsynth.cpp │ └── soloud_padsynth.h ├── simplest │ └── main.cpp └── welcome │ └── main.cpp ├── docsrc ├── SoLoud.tex ├── attenuator.mmd ├── attributes.mmd ├── audiosource.mmd ├── backends.mmd ├── basics.mmd ├── bassboostfilter.mmd ├── biquadfilter.mmd ├── bmx_api.mmd ├── c_api.mmd ├── codegen.graphml ├── codegen.mmd ├── collider.mmd ├── concepts.graphml ├── concepts.mmd ├── concepts3d.mmd ├── console.mmd ├── core3d.mmd ├── coremisc.mmd ├── cs_api.mmd ├── css │ ├── highlight.pack.js │ ├── logo.png │ ├── soloud.css │ └── vs.css ├── d_api.mmd ├── dcremovalfilter.mmd ├── dirstruct.graphml ├── dirstruct.mmd ├── downloads.mmd ├── echofilter.mmd ├── epub.css ├── examples.mmd ├── faders.mmd ├── faq.mmd ├── fftfilter.mmd ├── file.graphml ├── file.mmd ├── filters.mmd ├── flangerfilter.mmd ├── foreign_interface.mmd ├── freeverbfilter.mmd ├── gamemaker_api.mmd ├── html.pandoc ├── htmlpost.txt ├── htmlpre.txt ├── images │ ├── SoLoudLogo.pdf │ ├── SoLoudLogo.svg │ ├── att_exp_max.pdf │ ├── att_exp_max.png │ ├── att_exp_max.svg │ ├── att_exp_min.pdf │ ├── att_exp_min.png │ ├── att_exp_min.svg │ ├── att_exp_rolloff.pdf │ ├── att_exp_rolloff.png │ ├── att_exp_rolloff.svg │ ├── att_inv_max.pdf │ ├── att_inv_max.png │ ├── att_inv_max.svg │ ├── att_inv_min.pdf │ ├── att_inv_min.png │ ├── att_inv_min.svg │ ├── att_inv_rolloff.pdf │ ├── att_inv_rolloff.png │ ├── att_inv_rolloff.svg │ ├── att_lin_max.pdf │ ├── att_lin_max.png │ ├── att_lin_max.svg │ ├── att_lin_min.pdf │ ├── att_lin_min.png │ ├── att_lin_min.svg │ ├── att_lin_rolloff.pdf │ ├── att_lin_rolloff.png │ ├── att_lin_rolloff.svg │ ├── clipping.pdf │ ├── clipping.png │ ├── clipping.svg │ ├── clocked_1.pdf │ ├── clocked_1.png │ ├── clocked_1.svg │ ├── clocked_2.pdf │ ├── clocked_2.png │ ├── clocked_2.svg │ ├── clocked_3.pdf │ ├── clocked_3.png │ ├── clocked_3.svg │ ├── codegen.pdf │ ├── codegen.png │ ├── concepts.pdf │ ├── concepts.png │ ├── cover.png │ ├── demo_3dtest.pdf │ ├── demo_3dtest.png │ ├── demo_3dtest.svg │ ├── demo_env.pdf │ ├── demo_env.png │ ├── demo_env.svg │ ├── demo_mixbusses.pdf │ ├── demo_mixbusses.png │ ├── demo_mixbusses.svg │ ├── demo_monotone.pdf │ ├── demo_monotone.png │ ├── demo_monotone.svg │ ├── demo_multimusic.pdf │ ├── demo_multimusic.png │ ├── demo_multimusic.svg │ ├── demo_pewpew.pdf │ ├── demo_pewpew.png │ ├── demo_pewpew.svg │ ├── demo_piano.pdf │ ├── demo_piano.png │ ├── demo_piano.svg │ ├── demo_simplest.pdf │ ├── demo_simplest.png │ ├── demo_simplest.svg │ ├── demo_space.pdf │ ├── demo_space.png │ ├── demo_space.svg │ ├── demo_tedsid.pdf │ ├── demo_tedsid.png │ ├── demo_tedsid.svg │ ├── demo_virtualvoices.pdf │ ├── demo_virtualvoices.png │ ├── demo_virtualvoices.svg │ ├── demo_welcome.pdf │ ├── demo_welcome.png │ ├── demo_welcome.svg │ ├── dirstruct.pdf │ ├── dirstruct.png │ ├── doppler.pdf │ ├── doppler.png │ ├── doppler.svg │ ├── file.pdf │ ├── file.png │ ├── milestones.png │ ├── mixbus.pdf │ ├── mixbus.png │ ├── pianokeys.pdf │ ├── pianokeys.png │ ├── pianokeys.svg │ ├── resampler.pdf │ ├── resampler.png │ ├── resampler.svg │ ├── sfxr.pdf │ ├── sfxr.png │ ├── sfxr.svg │ ├── source_backend.pdf │ ├── source_backend.png │ ├── speaker_dot.pdf │ ├── speaker_dot.png │ ├── speaker_dot.svg │ ├── time.pdf │ ├── time.png │ ├── time.svg │ ├── virtualvoices.pdf │ ├── virtualvoices.png │ ├── voicegroups.pdf │ └── voicegroups.png ├── intro.mmd ├── legal.mmd ├── lofifilter.mmd ├── makedoc.py ├── metadata.xml ├── mixbus.graphml ├── mixbus.mmd ├── modplug.mmd ├── monotone.mmd ├── newsoundsources.mmd ├── noise.mmd ├── premake.mmd ├── python_api.mmd ├── queue.mmd ├── quickstart.mmd ├── robotizefilter.mmd ├── rpgmaker_api.mmd ├── ruby_api.mmd ├── setup.tex ├── sfxr.mmd ├── singlehtml_body.txt ├── singlehtml_head.txt ├── source_backend.graphml ├── speech.mmd ├── tedsid.mmd ├── title.txt ├── vic.mmd ├── virtualvoices.graphml ├── vizsn.mmd ├── voicegroups.graphml ├── voicegroups.mmd ├── voicemanagement.mmd ├── wav.mmd ├── waveshaperfilter.mmd └── wavstream.mmd ├── glue └── readme.txt ├── include ├── soloud.h ├── soloud_audiosource.h ├── soloud_ay.h ├── soloud_bassboostfilter.h ├── soloud_biquadresonantfilter.h ├── soloud_bus.h ├── soloud_c.h ├── soloud_dcremovalfilter.h ├── soloud_duckfilter.h ├── soloud_echofilter.h ├── soloud_eqfilter.h ├── soloud_error.h ├── soloud_fader.h ├── soloud_fft.h ├── soloud_fftfilter.h ├── soloud_file.h ├── soloud_file_hack_off.h ├── soloud_file_hack_on.h ├── soloud_filter.h ├── soloud_flangerfilter.h ├── soloud_freeverbfilter.h ├── soloud_internal.h ├── soloud_lofifilter.h ├── soloud_misc.h ├── soloud_monotone.h ├── soloud_noise.h ├── soloud_openmpt.h ├── soloud_queue.h ├── soloud_robotizefilter.h ├── soloud_sfxr.h ├── soloud_speech.h ├── soloud_tedsid.h ├── soloud_thread.h ├── soloud_vic.h ├── soloud_vizsn.h ├── soloud_wav.h ├── soloud_waveshaperfilter.h ├── soloud_wavstream.h └── zx7decompress.h ├── issue_template.md ├── scripts ├── checkapidoc.py ├── checksanity.py ├── compile_gamemaker_dll.bat ├── gen_autoit.py ├── gen_beef.py ├── gen_blitzmax.py ├── gen_consoledata.py ├── gen_cs.py ├── gen_d.py ├── gen_gamemaker.py ├── gen_python.py ├── gen_rpgmaker.py ├── gen_ruby.py ├── make_gmez.bat ├── makeglue.py ├── makerel.py └── readme.txt ├── soloud.png └── src ├── audiosource ├── ay │ ├── chipplayer.cpp │ ├── chipplayer.h │ ├── readme.txt │ ├── sndbuffer.cpp │ ├── sndbuffer.h │ ├── sndchip.cpp │ ├── sndchip.h │ ├── sndrender.cpp │ ├── sndrender.h │ └── soloud_ay.cpp ├── monotone │ └── soloud_monotone.cpp ├── noise │ └── soloud_noise.cpp ├── openmpt │ ├── soloud_openmpt.cpp │ └── soloud_openmpt_dll.c ├── sfxr │ └── soloud_sfxr.cpp ├── speech │ ├── Elements.def │ ├── darray.cpp │ ├── darray.h │ ├── klatt.cpp │ ├── klatt.h │ ├── legal_readme.txt │ ├── resonator.cpp │ ├── resonator.h │ ├── soloud_speech.cpp │ ├── tts.cpp │ └── tts.h ├── tedsid │ ├── readme.txt │ ├── sid.cpp │ ├── sid.h │ ├── soloud_tedsid.cpp │ ├── ted.cpp │ └── ted.h ├── vic │ └── soloud_vic.cpp ├── vizsn │ └── soloud_vizsn.cpp └── wav │ ├── dr_flac.h │ ├── dr_impl.cpp │ ├── dr_mp3.h │ ├── dr_wav.h │ ├── soloud_wav.cpp │ ├── soloud_wavstream.cpp │ ├── stb_vorbis.c │ └── stb_vorbis.h ├── backend ├── alsa │ └── soloud_alsa.cpp ├── coreaudio │ └── soloud_coreaudio.cpp ├── jack │ └── soloud_jack.cpp ├── miniaudio │ ├── miniaudio.h │ └── soloud_miniaudio.cpp ├── nosound │ └── soloud_nosound.cpp ├── null │ └── soloud_null.cpp ├── openal │ ├── soloud_openal.cpp │ └── soloud_openal_dll.c ├── opensles │ └── soloud_opensles.cpp ├── oss │ └── soloud_oss.cpp ├── portaudio │ ├── soloud_portaudio.cpp │ └── soloud_portaudio_dll.c ├── sdl │ ├── soloud_sdl1.cpp │ ├── soloud_sdl1_dll.c │ ├── soloud_sdl2.cpp │ └── soloud_sdl2_dll.c ├── sdl2_static │ └── soloud_sdl2_static.cpp ├── sdl_static │ └── soloud_sdl_static.cpp ├── vita_homebrew │ └── soloud_vita_homebrew.cpp ├── wasapi │ └── soloud_wasapi.cpp ├── winmm │ └── soloud_winmm.cpp └── xaudio2 │ └── soloud_xaudio2.cpp ├── c_api ├── soloud.def └── soloud_c.cpp ├── core ├── soloud.cpp ├── soloud_audiosource.cpp ├── soloud_bus.cpp ├── soloud_core_3d.cpp ├── soloud_core_basicops.cpp ├── soloud_core_faderops.cpp ├── soloud_core_filterops.cpp ├── soloud_core_getters.cpp ├── soloud_core_setters.cpp ├── soloud_core_voicegroup.cpp ├── soloud_core_voiceops.cpp ├── soloud_fader.cpp ├── soloud_fft.cpp ├── soloud_fft_lut.cpp ├── soloud_file.cpp ├── soloud_filter.cpp ├── soloud_misc.cpp ├── soloud_queue.cpp └── soloud_thread.cpp ├── filter ├── soloud_bassboostfilter.cpp ├── soloud_biquadresonantfilter.cpp ├── soloud_dcremovalfilter.cpp ├── soloud_duckfilter.cpp ├── soloud_echofilter.cpp ├── soloud_eqfilter.cpp ├── soloud_fftfilter.cpp ├── soloud_flangerfilter.cpp ├── soloud_freeverbfilter.cpp ├── soloud_lofifilter.cpp ├── soloud_robotizefilter.cpp └── soloud_waveshaperfilter.cpp └── tools ├── codegen └── main.cpp ├── lutgen └── main.cpp ├── resamplerlab ├── main.cpp ├── stb_image_write.c └── stb_image_write.h └── sanity └── sanity.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | _UpgradeReport_Files/ 3 | *.ipch 4 | *.opensdf 5 | *.sdf 6 | *.old 7 | *.filters 8 | build/ 9 | *.aux 10 | *.out 11 | *.gz 12 | *.toc 13 | *.o 14 | incoming/ 15 | experiments/ 16 | scripts/*.log 17 | lib/* 18 | rel/* 19 | doc/* 20 | bin/audio/ 21 | bin/ 22 | lib/*.ilk 23 | lib/*.lib 24 | lib/*.dll 25 | out/ 26 | *.pyc 27 | *.exp 28 | docsrc/xelatex_output.txt 29 | docsrc/kindlegen_output.txt 30 | *.idb 31 | *.pdb 32 | docsrc/20* 33 | glue/* 34 | scripts/soloud_codegen.py 35 | glue/rpgmaker_soloud.rb 36 | *.lastcodeanalysissucceeded 37 | *.bak 38 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ext/libmodplug"] 2 | path = ext/libmodplug 3 | url = https://github.com/jarikomppa/libmodplug.git 4 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | If you wish to contribute code to SoLoud, add your name to 2 | this list when sending a pull request. All code must be 3 | either public domain, CC0, wtfpl, zlib/libpng licensed, or 4 | similarly free to use (without attribution, or (l)gpl-like 5 | limitations. 6 | 7 | Jari Komppa http://iki.fi/sol/ 8 | Tom V�h�-Salo tomvahasalo@gmail.com 9 | Trygve Vea trygve.vea@gmail.com 10 | dorgonman dorgonman@hotmail.com 11 | Gabriel Teles Bastos http://mundorpgmaker.com.br 12 | r-lyeh https://github.com/r-lyeh 13 | Colden Cullen https://github.com/ColdenCullen 14 | Cosku Bas cosku.bas@gmail.com 15 | Neil Richardson https://github.com/neilogd 16 | Petri Häkkinen 17 | Omar Cornut 18 | amir ramezani http://shaberoshan.ir 19 | Luke San Antonio Bialecki lukesanantonio@gmail.com 20 | Konstantin S. Matveyev kos@eligovision.ru 21 | Eduardo Doria Lima https://github.com/eduardodoria 22 | Ilya Zhuravlev https://github.com/xyzz 23 | Jussi Sammaltupa 24 | Tam Toucn https://github.com/TamToucan 25 | lamelizard 26 | Tapio Vierros https://github.com/tapio 27 | Danny Angelo Carminati Grein https://github.com/fungos 28 | Igor Ivanov https://github.com/laptabrok 29 | Matthew O'Connell https://github.com/matthew-oconnell 30 | Boris Carvajal https://github.com/BorisCarvajal 31 | Osman Turan https://osmanturan.com 32 | Samson Close https://github.com/qwertysam 33 | Bruce A Henderson https://github.com/woollybah 34 | Philip Bennefall https://github.com/blastbay/ 35 | Sebastian Hartte https://github.com/shartte/ 36 | Jean-Luc Mackail https://github.com/fuzzyquills 37 | HumanGamer https://github.com/HumanGamer/ 38 | Ales Mlakar https://github.com/jazzbre 39 | lexander Yashin https://github.com/yashin-alexander 40 | Nils Duval https://github.com/nlsdvl 41 | JackRedstonia jackredstonia64@gmail.com 42 | David Bullock https://github.com/dwbullock 43 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | Here's some guidelines on contributing to the SoLoud project. 2 | 3 | - SoLoud is extremely liberally licensed. All submitted code 4 | must follow suit to keep it that way. 5 | (public domain, CC0, wtfpl, zlib/libpng, unlicense, or similar 6 | no-attribution and definitely no viral licenses). 7 | 8 | - When submitting the first time, add your name in AUTHORS. 9 | 10 | - Many small commits are better than few huge ones. 11 | 12 | - Try to follow the coding convention of the surrounding code. 13 | If stand alone (such as platform or output device specific), 14 | this isn't as important. 15 | 16 | - All optimized code (such as SSE or assembler) must be 17 | accompanied by plain 'c' version, because: 18 | a) optimizations come and go, porting 30 years from now 19 | can be really painful. 20 | b) plain 'c' version works as documentation of the 21 | optimized code. 22 | 23 | - When doing platform specific code or otherwise optionally 24 | compiled code, it's often better to have some duplicate 25 | code inside large ifdef block than to have tons of hard 26 | to follow small ifdef blocks. 27 | 28 | - Unless there's a really, really good reason, no templates, 29 | including funkycast. foo = (int)bar works fine. 30 | 31 | - Unless performance critical, always try to write for readability. 32 | 33 | Coding convention in brief: 34 | 35 | - On naming: 36 | aFunctionParameter 37 | mMemberVariable 38 | gGlobalVariable 39 | localVariable 40 | CONSTANT_VALUE 41 | ClassName 42 | functionName 43 | 44 | int ExampleClass::example(int aFoo) 45 | { 46 | if (aFoo) 47 | { 48 | int i; 49 | for (i = 0; i < mBarCycles; i++) 50 | { 51 | bar(); 52 | } 53 | switch (gBah) 54 | { 55 | case BOO: 56 | return HISS; 57 | } 58 | } 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | SoLoud contains various third party libraries which vary in licenses, 2 | but are all extremely liberal; no attribution in binary form is required. 3 | For more information, see SoLoud manual or http://soloud-audio.com/legal.html 4 | 5 | SoLoud proper is licensed under the zlib/libpng license: 6 | 7 | SoLoud audio engine 8 | Copyright (c) 2013-2018 Jari Komppa 9 | 10 | This software is provided 'as-is', without any express or implied 11 | warranty. In no event will the authors be held liable for any damages 12 | arising from the use of this software. 13 | 14 | Permission is granted to anyone to use this software for any purpose, 15 | including commercial applications, and to alter it and redistribute it 16 | freely, subject to the following restrictions: 17 | 18 | 1. The origin of this software must not be misrepresented; you must not 19 | claim that you wrote the original software. If you use this software 20 | in a product, an acknowledgment in the product documentation would be 21 | appreciated but is not required. 22 | 23 | 2. Altered source versions must be plainly marked as such, and must not be 24 | misrepresented as being the original software. 25 | 26 | 3. This notice may not be removed or altered from any source 27 | distribution. 28 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | > 1. Remove this template before submitting 2 | > 3 | > 2. SoLoud project requires extremely liberal licensing, i.e, no attribution is required for binary forms. 4 | > Patches should come under zlib, cc0, unlicense or wtfpl license, or if you wish to not retain any 5 | > rights, don't include a license and the rights of your patch are released to the project owner and 6 | > included under the SoLoud zlib/libpng licensing for anyone to (ab)use. 7 | > 8 | > 3. Code should generally follow the coding conventions in SoLoud, meaning formatting that's basically 9 | > the ANSI format in Artistic Style formatter (or just read some of the code and make yours look the 10 | > same). 11 | > 12 | > 4. Code should generally follow "Orthodox C++" rules, i.e, not "modern c++". This means minimal template 13 | > use and basically no "new" c++ features. 14 | > 15 | > 5. Platform-specific code (i.e, backends / sinks) are pretty much expected to break the 3. and 4. above. 16 | > 17 | > 6. To show that you understand and accept the rules above, add your name to the AUTHORS file. 18 | > 19 | > TL;DR: make code similar to what's in SoLoud, don't add new licensing requirements, sign the AUTHORS file, thanks. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SoLoud 2 | ====== 3 | 4 | SoLoud is an easy to use, free, portable c/c++ audio engine for games. 5 | 6 | ![ScreenShot](https://raw.github.com/jarikomppa/soloud/master/soloud.png) 7 | 8 | Zlib/LibPng licensed. Portable. Easy. 9 | 10 | Official site with documentation can be found at: 11 | http://soloud-audio.com 12 | -------------------------------------------------------------------------------- /build/readme.txt: -------------------------------------------------------------------------------- 1 | Use GENie (a premake4 fork) to create project files for visual studio, 2 | xcode, or whatever environment you prefer: 3 | 4 | https://github.com/bkaradzic/genie 5 | -------------------------------------------------------------------------------- /build/soloud_devel.bat: -------------------------------------------------------------------------------- 1 | genie --soloud-devel --platform=x32 vs2017 2 | -------------------------------------------------------------------------------- /contrib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.8) 2 | 3 | project (SoLoud) 4 | 5 | set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}") 6 | set (CMAKE_POSITION_INDEPENDENT_CODE ON) 7 | #INCLUDE (StandartIncludes) 8 | 9 | include_directories (../include) 10 | 11 | include (Configure.cmake) 12 | #INCLUDE (InstallIncludes.cmake) 13 | #INCLUDE (InstallStaticData.cmake) 14 | 15 | if (UNIX AND NOT WIN32 AND NOT APPLE) 16 | if (CMAKE_SIZEOF_VOID_P MATCHES "8") 17 | set (LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement") 18 | mark_as_advanced (LIB_POSTFIX) 19 | endif () 20 | endif () 21 | if (MSVC) 22 | add_definitions (-D_CRT_SECURE_NO_WARNINGS) 23 | endif() 24 | if (NOT DEFINED LIB_POSTFIX) 25 | set (LIB_POSTFIX "") 26 | endif () 27 | 28 | include (src.cmake) 29 | 30 | # Demos 31 | IF (SOLOUD_BUILD_DEMOS) 32 | include (demos.cmake) 33 | endif () 34 | 35 | IF (SOLOUD_GENERATE_GLUE) 36 | include (gen_glue.cmake) 37 | endif () 38 | 39 | include (InstallExport) 40 | -------------------------------------------------------------------------------- /contrib/Configure.cmake: -------------------------------------------------------------------------------- 1 | include (OptionDependentOnPackage) 2 | include (PrintOptionStatus) 3 | 4 | option (SOLOUD_DYNAMIC "Set to ON to build dynamic SoLoud" OFF) 5 | print_option_status (SOLOUD_DYNAMIC "Build dynamic library") 6 | 7 | option (SOLOUD_STATIC "Set to ON to build static SoLoud" ON) 8 | print_option_status (SOLOUD_STATIC "Build static library") 9 | 10 | option (SOLOUD_C_API "Set to ON to include the C API" OFF) 11 | print_option_status (SOLOUD_C_API "Build C API") 12 | 13 | # TODO: 14 | option (SOLOUD_BUILD_DEMOS "Set to ON for building demos" OFF) 15 | print_option_status (SOLOUD_BUILD_DEMOS "Build demos") 16 | 17 | option (SOLOUD_BACKEND_NULL "Set to ON for building NULL backend" ON) 18 | print_option_status (SOLOUD_BACKEND_NULL "NULL backend") 19 | 20 | option (SOLOUD_BACKEND_SDL2 "Set to ON for building SDL2 backend" ON) 21 | print_option_status (SOLOUD_BACKEND_SDL2 "SDL2 backend") 22 | 23 | option (SOLOUD_BACKEND_ALSA "Set to ON for building ALSA backend" OFF) 24 | print_option_status (SOLOUD_BACKEND_ALSA "ALSA backend") 25 | 26 | option (SOLOUD_BACKEND_COREAUDIO "Set to ON for building CoreAudio backend" OFF) 27 | print_option_status (SOLOUD_BACKEND_COREAUDIO "CoreAudio backend") 28 | 29 | option (SOLOUD_BACKEND_OPENSLES "Set to ON for building OpenSLES backend" OFF) 30 | print_option_status (SOLOUD_BACKEND_OPENSLES "OpenSLES backend") 31 | 32 | option (SOLOUD_BACKEND_XAUDIO2 "Set to ON for building XAudio2 backend" OFF) 33 | print_option_status (SOLOUD_BACKEND_XAUDIO2 "XAudio2 backend") 34 | 35 | option (SOLOUD_BACKEND_WINMM "Set to ON for building WINMM backend" OFF) 36 | print_option_status (SOLOUD_BACKEND_WINMM "WINMM backend") 37 | 38 | option (SOLOUD_BACKEND_WASAPI "Set to ON for building WASAPI backend" OFF) 39 | print_option_status (SOLOUD_BACKEND_WASAPI "WASAPI backend") 40 | 41 | option (SOLOUD_GENERATE_GLUE "Set to ON for generating the Glue APIs" OFF) 42 | print_option_status (SOLOUD_GENERATE_GLUE "Generate Glue") 43 | -------------------------------------------------------------------------------- /contrib/README.md: -------------------------------------------------------------------------------- 1 | The contrib folder contains files that may be of use to some people 2 | but are not maintained by the project itself. As such they may be 3 | out of date. Pull requests are welcome. 4 | 5 | Note that the licenses of the contrib files may also be out of line 6 | with the SoLoud proper. You have been warned. -------------------------------------------------------------------------------- /contrib/cmake/Install.cmake: -------------------------------------------------------------------------------- 1 | # Required Vars: 2 | # ${TARGET_NAME} 3 | 4 | SET (INSTALL_BINDIR bin) 5 | IF(WIN32) 6 | SET(INSTALL_LIBDIR bin) 7 | SET(INSTALL_ARCHIVEDIR lib) 8 | ELSE(WIN32) 9 | SET(INSTALL_LIBDIR lib${LIB_POSTFIX}) 10 | SET(INSTALL_ARCHIVEDIR lib${LIB_POSTFIX}) 11 | ENDIF(WIN32) 12 | 13 | SET (PROJECT_NAME_LOWERCASE) 14 | STRING (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE) 15 | INSTALL ( 16 | TARGETS ${TARGET_NAME} 17 | EXPORT ${PROJECT_NAME_LOWERCASE}-config 18 | RUNTIME DESTINATION ${INSTALL_BINDIR} 19 | BUNDLE DESTINATION ${INSTALL_BINDIR} 20 | LIBRARY DESTINATION ${INSTALL_LIBDIR} 21 | ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} 22 | ) 23 | -------------------------------------------------------------------------------- /contrib/cmake/InstallExport.cmake: -------------------------------------------------------------------------------- 1 | # Installs export targets (i.e. cmake config files) into location 2 | # specified for OS. 3 | # Installs ${PROJECT_NAME}-SetThirdParties.cmake too if such file 4 | # is found in ${PROJECT_SOURCE_DIR}. 5 | 6 | SET (EV_CMAKE_EXPORT_DIR share/${PROJECT_NAME}/cmake) 7 | 8 | IF (WIN32) 9 | SET (EV_CMAKE_EXPORT_DIR cmake) 10 | ENDIF () 11 | 12 | SET (PROJECT_NAME_LOWERCASE) 13 | STRING (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE) 14 | INSTALL ( 15 | EXPORT ${PROJECT_NAME_LOWERCASE}-config 16 | DESTINATION ${EV_CMAKE_EXPORT_DIR} 17 | ) 18 | 19 | SET (EV_STP_FILENAME ${PROJECT_SOURCE_DIR}/${PROJECT_NAME}-SetThirdParties.cmake) 20 | IF (EXISTS ${EV_STP_FILENAME}) 21 | INSTALL ( 22 | FILES ${EV_STP_FILENAME} 23 | DESTINATION ${EV_CMAKE_EXPORT_DIR} 24 | ) 25 | ENDIF () 26 | 27 | SET (EV_SETTINGS_FILENAME ${PROJECT_SOURCE_DIR}/${PROJECT_NAME}-Settings.cmake) 28 | IF (NOT EXISTS ${EV_SETTINGS_FILENAME}) 29 | # This file may be configured => it placed in binary dir 30 | SET (EV_SETTINGS_FILENAME ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-Settings.cmake) 31 | ENDIF () 32 | 33 | IF (EXISTS ${EV_SETTINGS_FILENAME}) 34 | INSTALL ( 35 | FILES ${EV_SETTINGS_FILENAME} 36 | DESTINATION ${EV_CMAKE_EXPORT_DIR} 37 | ) 38 | ENDIF () 39 | -------------------------------------------------------------------------------- /contrib/cmake/OptionDependentOnPackage.cmake: -------------------------------------------------------------------------------- 1 | # Parameters: 2 | # OPTION_VAR_NAME is variable name which will be passed to OPTION call 3 | # OPTION_DESCRIPTION is text description which will be passed to OPTION call 4 | # PACKAGE_FOUND_VAR is boolean variable indicated is requiring package found or not 5 | MACRO (OPTION_DEPENDENT_ON_PACKAGE OPTION_VAR_NAME OPTION_DESCRIPTION PACKAGE_FOUND_VAR) 6 | IF (NOT DEFINED ${OPTION_VAR_NAME}) 7 | OPTION (${OPTION_VAR_NAME} "${OPTION_DESCRIPTION}" ${${PACKAGE_FOUND_VAR}}) 8 | ELSE (NOT DEFINED ${OPTION_VAR_NAME}) 9 | IF (${OPTION_VAR_NAME} AND NOT ${PACKAGE_FOUND_VAR}) 10 | MESSAGE (FATAL_ERROR "You have set using of ${OPTION_VAR_NAME} whereas ${PACKAGE_FOUND_VAR} is NO") 11 | ENDIF (${OPTION_VAR_NAME} AND NOT ${PACKAGE_FOUND_VAR}) 12 | ENDIF (NOT DEFINED ${OPTION_VAR_NAME}) 13 | ENDMACRO (OPTION_DEPENDENT_ON_PACKAGE) 14 | 15 | # Parameters: 16 | # OPTION_VAR_NAME is variable name which will be passed to OPTION call 17 | # OPTION_DESCRIPTION is text description which will be passed to OPTION call 18 | # PACKAGE_FOUND_VAR and after parameters are boolean variables indicated is requiring package found or not 19 | MACRO (OPTION_DEPENDENT_ON_ALL_PACKAGES OPTION_VAR_NAME OPTION_DESCRIPTION PACKAGE_FOUND_VAR) 20 | SET (ALL_PACKAGES_FOUND TRUE) 21 | FOREACH (cur_package ${PACKAGE_FOUND_VAR} ${ARGN}) 22 | IF (NOT ${cur_package}) 23 | SET (ALL_PACKAGES_FOUND FALSE) 24 | SET (NOTFOUND_PACKAGES ${NOTFOUND_PACKAGES} ${cur_package}) 25 | ENDIF (NOT ${cur_package}) 26 | ENDFOREACH (cur_package) 27 | IF (NOT DEFINED ${OPTION_VAR_NAME}) 28 | OPTION (${OPTION_VAR_NAME} "${OPTION_DESCRIPTION}" ${ALL_PACKAGES_FOUND}) 29 | ELSE (NOT DEFINED ${OPTION_VAR_NAME}) 30 | IF (${OPTION_VAR_NAME} AND NOT ALL_PACKAGES_FOUND) 31 | MESSAGE (FATAL_ERROR "You have set using of ${OPTION_VAR_NAME} whereas ${NOTFOUND_PACKAGES} is NO") 32 | ENDIF (${OPTION_VAR_NAME} AND NOT ALL_PACKAGES_FOUND) 33 | ENDIF (NOT DEFINED ${OPTION_VAR_NAME}) 34 | ENDMACRO (OPTION_DEPENDENT_ON_ALL_PACKAGES) 35 | -------------------------------------------------------------------------------- /contrib/cmake/PrintOptionStatus.cmake: -------------------------------------------------------------------------------- 1 | # Parameters: 2 | # OPTION: boolean option. 3 | # TEXT - option meaning text, printed between "[+/-]" and "enabled/disabled". 4 | # PREPEND - optional parameter, count of spaces inserted before output. 5 | # Useful for indenting relative options. 6 | 7 | MACRO (PRINT_OPTION_STATUS OPTION TEXT) 8 | SET (PREPEND "") 9 | IF (${ARGC} GREATER 2) 10 | IF (${ARGV2} GREATER 0) 11 | FOREACH (A RANGE 1 ${ARGV2}) 12 | SET (PREPEND "${PREPEND} ") 13 | ENDFOREACH (A) 14 | ENDIF (${ARGV2} GREATER 0) 15 | ENDIF (${ARGC} GREATER 2) 16 | IF (${OPTION}) 17 | MESSAGE ("${PREPEND}[+] ${TEXT} enabled") 18 | ELSE (${OPTION}) 19 | MESSAGE ("${PREPEND}[-] ${TEXT} disabled") 20 | ENDIF (${OPTION}) 21 | ENDMACRO (PRINT_OPTION_STATUS) 22 | -------------------------------------------------------------------------------- /contrib/demos.cmake: -------------------------------------------------------------------------------- 1 | set (HEADER_PATH ../include) 2 | set (SOURCE_PATH ../demos) 3 | 4 | function (soloud_add_demo name sources) 5 | set (TARGET_NAME SoLoud_${name}) 6 | add_executable (${TARGET_NAME} ${sources}) 7 | target_link_libraries (${TARGET_NAME} soloud) 8 | include (Install) 9 | endfunction() 10 | 11 | include_directories (${SOURCE_PATH}/common) 12 | include_directories (${SOURCE_PATH}/common/imgui) 13 | 14 | 15 | # soloud_add_demo(c_test ${SOURCE_PATH}/c_test/main.c) 16 | soloud_add_demo(enumerate ${SOURCE_PATH}/enumerate/main.cpp) 17 | # soloud_add_demo(env ${SOURCE_PATH}/env/main.cpp) 18 | # soloud_add_demo(megademo 19 | # ${SOURCE_PATH}/megademo/3dtest.cpp 20 | # ${SOURCE_PATH}/megademo/main.cpp 21 | # ${SOURCE_PATH}/megademo/mixbusses.cpp 22 | # ${SOURCE_PATH}/megademo/monotone.cpp 23 | # ${SOURCE_PATH}/megademo/multimusic.cpp 24 | # ${SOURCE_PATH}/megademo/pewpew.cpp 25 | # ${SOURCE_PATH}/megademo/radiogaga.cpp 26 | # ${SOURCE_PATH}/megademo/space.cpp 27 | # ${SOURCE_PATH}/megademo/speechfilter.cpp 28 | # ${SOURCE_PATH}/megademo/tedsid.cpp 29 | # ${SOURCE_PATH}/megademo/virtualvoices.cpp 30 | # ) 31 | soloud_add_demo(null ${SOURCE_PATH}/null/main.cpp) 32 | # soloud_add_demo(piano 33 | # ${SOURCE_PATH}/piano/main.cpp 34 | # ${SOURCE_PATH}/piano/soloud_basicwave.cpp 35 | # ${SOURCE_PATH}/piano/soloud_padsynth.cpp 36 | # ) 37 | soloud_add_demo(simplest ${SOURCE_PATH}/simplest/main.cpp) 38 | soloud_add_demo(welcome ${SOURCE_PATH}/welcome/main.cpp) 39 | -------------------------------------------------------------------------------- /demos/android/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-10 12 | -------------------------------------------------------------------------------- /demos/android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2010 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | LOCAL_PATH := $(call my-dir) 16 | 17 | include $(CLEAR_VARS) 18 | 19 | SOLOUD_FILES := $(wildcard $(LOCAL_PATH)/../../../src/audiosource/monotone/*.cpp) 20 | SOLOUD_FILES += $(wildcard $(LOCAL_PATH)/../../../src/audiosource/speech/*.cpp) 21 | SOLOUD_FILES += $(wildcard $(LOCAL_PATH)/../../../src/audiosource/sfxr/*.cpp) 22 | SOLOUD_FILES += $(wildcard $(LOCAL_PATH)/../../../src/audiosource/wav/*.cpp) 23 | SOLOUD_FILES += $(wildcard $(LOCAL_PATH)/../../../src/audiosource/wav/*.c) 24 | SOLOUD_FILES += $(wildcard $(LOCAL_PATH)/../../../src/backend/opensles/*.cpp) 25 | SOLOUD_FILES += $(wildcard $(LOCAL_PATH)/../../../src/core/*.cpp) 26 | SOLOUD_FILES += $(wildcard $(LOCAL_PATH)/../../../src/filter/*.cpp) 27 | SOLOUD_FILES := $(SOLOUD_FILES:$(LOCAL_PATH)/%=%) 28 | 29 | LOCAL_MODULE := soloud-android 30 | LOCAL_SRC_FILES := main.cpp 31 | LOCAL_SRC_FILES += $(SOLOUD_FILES) 32 | 33 | LOCAL_CPPFLAGS += -DWITH_OPENSLES=1 34 | 35 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../include 36 | 37 | LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lOpenSLES 38 | LOCAL_STATIC_LIBRARIES := android_native_app_glue 39 | 40 | include $(BUILD_SHARED_LIBRARY) 41 | 42 | $(call import-module,android/native_app_glue) 43 | -------------------------------------------------------------------------------- /demos/android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | APP_PLATFORM := android-10 3 | -------------------------------------------------------------------------------- /demos/common/glew/GL/README.txt: -------------------------------------------------------------------------------- 1 | GLEW - The OpenGL Extension Wrangler Library 2 | 3 | http://glew.sourceforge.net/ 4 | https://github.com/nigels-com/glew 5 | 6 | See doc/index.html for more information. 7 | 8 | If you downloaded the tarball from the GLEW website, you just need to: 9 | 10 | Unix: 11 | 12 | make 13 | 14 | sudo -s 15 | 16 | make install 17 | 18 | make clean 19 | 20 | Windows: 21 | 22 | use the project file in build/vc12/ 23 | 24 | If you wish to build GLEW from scratch (update the extension data from 25 | the net or add your own extension information), you need a Unix 26 | environment (including wget, perl, and GNU make). The extension data 27 | is regenerated from the top level source directory with: 28 | 29 | make extensions 30 | 31 | An alternative to generating the GLEW sources from scratch is to 32 | download a pre-generated (unsupported) snapshot: 33 | 34 | https://sourceforge.net/projects/glew/files/glew/snapshots/ 35 | -------------------------------------------------------------------------------- /demos/common/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2018 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /demos/common/soloud_demo_framework.h: -------------------------------------------------------------------------------- 1 | /* SoLoud demo framework 2 | * version 1.0, April 2015 3 | * 4 | * Copyright (C) 2015 Jari Komppa 5 | * 6 | * This software is provided 'as-is', without any express or implied 7 | * warranty. In no event will the authors be held liable for any damages 8 | * arising from the use of this software. 9 | * 10 | * Permission is granted to anyone to use this software for any purpose, 11 | * including commercial applications, and to alter it and redistribute it 12 | * freely, subject to the following restrictions: 13 | * 14 | * 1. The origin of this software must not be misrepresented; you must not 15 | * claim that you wrote the original software. If you use this software 16 | * in a product, an acknowledgment in the product documentation would be 17 | * appreciated but is not required. 18 | * 2. Altered source versions must be plainly marked as such, and must not be 19 | * misrepresented as being the original software. 20 | * 3. This notice may not be removed or altered from any source distribution. 21 | * 22 | * Jari Komppa http://iki.fi/sol/ 23 | * 24 | ************************************* 25 | * Parts copied from ImGui examples 26 | */ 27 | 28 | #define ONCE(x) { static int oncetrigger = 1; if (oncetrigger) { x; oncetrigger = 0; }} 29 | 30 | extern int gPressed[256], gWasPressed[256]; 31 | extern int gMouseX, gMouseY; 32 | unsigned int DemoLoadTexture(const char * aFilename); 33 | void DemoInit(); 34 | void DemoUpdateStart(); 35 | void DemoUpdateEnd(); 36 | int DemoTick(); 37 | void DemoYield(); 38 | void DemoTriangle(float x0, float y0, float x1, float y1, float x2, float y2, unsigned int color); 39 | void DemoQuad(float x0, float y0, float x1, float y1, unsigned int color); 40 | void DemoTexQuad(int tex, float x0, float y0, float x1, float y1); -------------------------------------------------------------------------------- /demos/emscripten/build_monotone: -------------------------------------------------------------------------------- 1 | emcc -o monotone.html ../megademo/monotone.cpp ../common/*.cpp ../common/imgui/imgui.cpp ../common/imgui/imgui_draw.cpp ../../src/core/*.cpp ../../src/filter/*.cpp ../../src/backend/sdl2_static/*.cpp ../../src/audiosource/monotone/*.c* -I ../common -I ../common/imgui -I ../../include --preload-file "../../bin/graphics/soloud_bg.png"@"graphics/soloud_bg.png" --preload-file "../../bin/audio/Jakim - Aboriginal Derivatives.mon"@"audio/Jakim - Aboriginal Derivatives.mon" -s USE_SDL=2 -O2 -D WITH_SDL2_STATIC -s FULL_ES2=1 2 | -------------------------------------------------------------------------------- /demos/emscripten/build_piano: -------------------------------------------------------------------------------- 1 | emcc -o piano.html ../piano/*.cpp ../common/*.cpp ../common/imgui/imgui.cpp ../common/imgui/imgui_draw.cpp ../../src/core/*.cpp ../../src/filter/*.cpp ../../src/backend/sdl2_static/*.cpp ../../src/audiosource/speech/*.c* ../../src/audiosource/wav/*.c* -I ../common -I ../common/imgui -I ../../include --preload-file "../../bin/graphics/soloud_bg.png"@"graphics/soloud_bg.png" --preload-file "../../bin/audio/AKWF_c604_0024.wav"@"audio/AKWF_c604_0024.wav" -s USE_SDL=2 -O2 -D WITH_SDL2_STATIC -s FULL_ES2=1 2 | -------------------------------------------------------------------------------- /demos/glue/cs/hello.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace hello 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | 10 | SoLoud.Soloud soloud = new SoLoud.Soloud(); // SoLoud engine core 11 | SoLoud.Speech speech = new SoLoud.Speech(); // A sound source (speech, in this case) 12 | 13 | // Configure sound source 14 | speech.setText("Hello c sharp world!"); 15 | 16 | // initialize SoLoud. 17 | soloud.init(); 18 | 19 | // Play the sound source (we could do this several times if we wanted) 20 | soloud.play(speech); 21 | 22 | // Wait until sounds have finished 23 | while (soloud.getActiveVoiceCount() > 0) 24 | { 25 | // Still going, sleep for a bit 26 | Console.Write("."); 27 | } 28 | 29 | // Clean up SoLoud 30 | soloud.deinit(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /demos/glue/gamemaker/hello.txt: -------------------------------------------------------------------------------- 1 | soloud = Soloud_create(); 2 | speech = Speech_create(); 3 | flanger = FlangerFilter_create(); 4 | Soloud_init(soloud); 5 | Soloud_setGlobalVolume(soloud, 10); 6 | Speech_setText(speech, "Hello gamemaker studio world!"); 7 | Speech_setFilter(speech, 0, flanger); 8 | Soloud_play(soloud, speech); 9 | 10 | show_message("We should hear something now"); 11 | 12 | Soloud_destroy(soloud); -------------------------------------------------------------------------------- /demos/glue/python/test_gfx.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import pygame 3 | from soloud import * 4 | 5 | pygame.init() 6 | screen = pygame.display.set_mode((640,480), 0, 32) 7 | 8 | audiolib = Soloud() 9 | audiolib.init(3) 10 | audiolib.set_global_volume(0.5) 11 | speech = Speech() 12 | lofi = LofiFilter() 13 | speech.set_filter(0, lofi) 14 | 15 | t = "Wheeeeeeeeeeeeeeeeeee Python and Pygame and visualizations and stuff" 16 | speech.set_text(t) 17 | for x in range(0, 15): 18 | sph = audiolib.play(speech) 19 | audiolib.set_relative_play_speed(sph, float(x + 10) / (15-x)) 20 | 21 | while audiolib.get_active_voice_count() > 0: 22 | 23 | for event in pygame.event.get(): 24 | if event.type == pygame.QUIT: 25 | speech.close() 26 | audiolib.close() 27 | sys.exit() 28 | 29 | # Redraw the background 30 | screen.fill((0,0,0,0)) 31 | 32 | vob = audiolib.get_wave() 33 | h = 0 34 | for x in vob: 35 | screen.set_at((h*2, int(240 + 200 * x)), (255, 255, 255)) 36 | h += 1 37 | pygame.display.flip() 38 | 39 | pygame.quit() 40 | -------------------------------------------------------------------------------- /demos/glue/python/test_python.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from soloud import * 3 | 4 | with Soloud() as audiolib: 5 | audiolib.init() 6 | audiolib.set_global_volume(10) 7 | 8 | speech = Speech() 9 | 10 | flanger = FlangerFilter() 11 | speech.set_filter(0, flanger) 12 | 13 | t = "Hello Python (OOP) World!" 14 | speech.set_text(t) 15 | 16 | print(t) 17 | audiolib.play(speech) 18 | 19 | print("Enter text to speak (empty string quits)") 20 | while t != "": 21 | t = input(": ") 22 | 23 | speech.set_text(t); 24 | audiolib.play(speech); 25 | 26 | speech.close() 27 | 28 | print("Bye") 29 | -------------------------------------------------------------------------------- /demos/glue/rpgmaker/c_test.rb: -------------------------------------------------------------------------------- 1 | soloud = SoLoud::Soloud.new 2 | speech = SoLoud::Speech.new 3 | 4 | speech.setText("1 2 3 A B C Doooooo Reeeeee Miiiiii Faaaaaa Soooooo Laaaaaa Tiiiiii Doooooo!"); 5 | soloud.init( 6 | SoLoud::Soloud::CLIP_ROUNDOFF | SoLoud::Soloud::ENABLE_VISUALIZATION, 7 | SoLoud::Soloud::AUTO, 8 | SoLoud::Soloud::AUTO, 9 | SoLoud::Soloud::AUTO 10 | ); 11 | 12 | soloud.setGlobalVolume(4); 13 | soloud.play(speech); 14 | 15 | printf("Playing..\n"); 16 | 17 | sprite = Sprite.new 18 | sprite.bitmap = Bitmap.new(544, 416) 19 | halfWidth = 544 / 2.0 20 | i = 0 21 | while (soloud.getActiveVoiceCount > 0) 22 | v = soloud.calcFFT 23 | z = (v[10] * halfWidth).to_i 24 | z = 544 if z > 544 25 | 26 | sprite.bitmap.clear 27 | sprite.bitmap.fill_rect(0, 0, z, 40, Color.new(0, 255, 0)) 28 | 29 | Graphics.update 30 | end 31 | 32 | printf("\nFinished.\n"); 33 | 34 | soloud.deinit 35 | 36 | speech.destroy 37 | soloud.destroy 38 | 39 | printf("Cleanup done.\n"); 40 | -------------------------------------------------------------------------------- /demos/glue/rpgmaker/simplest.rb: -------------------------------------------------------------------------------- 1 | # Define a couple of variables 2 | soloud = SoLoud::Soloud.new # SoLoud engine core 3 | speech = SoLoud::Speech.new # A sound source (speech, in this case) 4 | 5 | # Configure sound source 6 | speech.setText("1 2 3 1 2 3 Hello world. Welcome to So-Loud."); 7 | 8 | # initialize SoLoud. 9 | soloud.init() 10 | 11 | # Play the sound source (we could do this several times if we wanted) 12 | soloud.play(speech); 13 | 14 | # Wait until sounds have finished 15 | while (soloud.getActiveVoiceCount() > 0) 16 | # Still going, sleep for a bit 17 | Graphics.wait(100) 18 | end 19 | 20 | # Clean up SoLoud 21 | soloud.deinit(); 22 | 23 | # All done. 24 | -------------------------------------------------------------------------------- /demos/glue/rpgmaker/space.rb: -------------------------------------------------------------------------------- 1 | gSoloud = SoLoud::Soloud.new 2 | gSpeech = SoLoud::Speech.new 3 | gLofi = SoLoud::LofiFilter.new 4 | gFlanger = SoLoud::FlangerFilter.new 5 | gReso = SoLoud::BiquadResonantFilter.new 6 | gSpeechBus = SoLoud::Bus.new 7 | gMusicBus = SoLoud::Bus.new 8 | 9 | gSoloud.init(); 10 | gSoloud.setVisualizationEnable(1); 11 | gSoloud.setGlobalVolume(3); 12 | gSoloud.setPostClipScaler(0.75); 13 | 14 | gSoloud.play(gSpeechBus); 15 | gSoloud.play(gMusicBus); 16 | 17 | gSpeech.setFilter(1, gFlanger); 18 | gSpeech.setFilter(0, gLofi); 19 | gSpeech.setFilter(2, gReso); 20 | gLofi.setParams(8000,4); 21 | gFlanger.setParams(0.002,100); 22 | gReso.setParams(SoLoud::BiquadResonantFilter::BANDPASS, 8000, 1000, 0.5); 23 | 24 | gSpeech.setText(<<-EOS) 25 | What the alien has to say might 26 | appear around here if this 27 | wasn't just a dummy mockup.. 28 | 29 | .......... 30 | This is a demo of getting 31 | visualization data from different 32 | parts of the audio pipeline. 33 | 34 | .......... 35 | 36 | .......... 37 | 38 | .......... 39 | EOS 40 | 41 | gSpeech.setLooping(1); 42 | 43 | speechhandle = gSpeechBus.play(gSpeech, 3, -0.25); 44 | gSoloud.setRelativePlaySpeed(speechhandle, 1.2); 45 | 46 | gSoloud.oscillateFilterParameter(speechhandle, 0, SoLoud::LofiFilter::SAMPLERATE, 2000, 8000, 4); 47 | 48 | gSpeechBus.setVisualizationEnable(1); 49 | gMusicBus.setVisualizationEnable(1); 50 | 51 | rgss_stop -------------------------------------------------------------------------------- /demos/glue/ruby/test_ruby.rb: -------------------------------------------------------------------------------- 1 | load 'soloud.rb' 2 | 3 | begin 4 | soloud=Soloud.new("") 5 | speech=Speech.new("") 6 | soloud.init() 7 | speech.set_text("Hello ruby world!") 8 | soloud.play(speech) 9 | x = 0 10 | while (soloud.get_active_voice_count() > 0) 11 | print x, "\r" 12 | x += 1 13 | end 14 | 15 | 16 | ensure 17 | soloud.deinit() 18 | speech.destroy() 19 | soloud.destroy() 20 | end -------------------------------------------------------------------------------- /demos/null/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | #include "soloud.h" 29 | #include "soloud_speech.h" 30 | 31 | // Entry point 32 | int main(int argc, char *argv[]) 33 | { 34 | // Define a couple of variables 35 | SoLoud::Soloud soloud; // SoLoud engine core 36 | SoLoud::Speech speech; // A sound source (speech, in this case) 37 | 38 | // Configure sound source 39 | speech.setText("Hello!"); 40 | 41 | // initialize SoLoud. 42 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF, SoLoud::Soloud::NULLDRIVER); 43 | 44 | soloud.setGlobalVolume(10); 45 | 46 | // Play the sound source (we could do this several times if we wanted) 47 | soloud.play(speech); 48 | 49 | // Wait until sounds have finished 50 | while (soloud.getActiveVoiceCount() > 0) 51 | { 52 | float buf[256 * 2]; 53 | soloud.mix(buf, 256); 54 | int i; 55 | for (i = 0; i < 256; i++) 56 | { 57 | int d = (int)(buf[i * 2 + 0] * 30 + 30); 58 | int j; 59 | putchar('|'); 60 | for (j = 0; j < 60; j++) 61 | if (j == d) 62 | putchar('o'); 63 | else 64 | if ((d < 30 && j < 30 && j > d) || (d >= 30 && j >= 30 && j < d)) 65 | putchar('-'); 66 | else 67 | putchar(' '); 68 | putchar('|'); 69 | putchar('\n'); 70 | } 71 | } 72 | 73 | // Clean up SoLoud 74 | soloud.deinit(); 75 | 76 | // All done. 77 | return 0; 78 | } -------------------------------------------------------------------------------- /demos/piano/soloud_adsr.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2021 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef ADSR_H 26 | #define ADSR_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class ADSR 33 | { 34 | public: 35 | float mA, mD, mS, mR; 36 | 37 | ADSR() 38 | { 39 | mA = 0.0f; 40 | mD = 0.0f; 41 | mS = 1.0f; 42 | mR = 0.0f; 43 | } 44 | 45 | ADSR(float aA, float aD, float aS, float aR) 46 | { 47 | mA = aA; 48 | mD = aD; 49 | mS = aS; 50 | mR = aR; 51 | } 52 | 53 | float val(float aT, float aRelTime) 54 | { 55 | if (aT < mA) 56 | { 57 | return aT / mA; 58 | } 59 | aT -= mA; 60 | if (aT < mD) 61 | { 62 | return 1.0f - ((aT / mD)) * (1.0f - mS); 63 | } 64 | aT -= mD; 65 | if (aT < aRelTime) 66 | return mS; 67 | aT -= aRelTime; 68 | if (aT >= mR) 69 | { 70 | return 0.0f; 71 | } 72 | return (1.0f - aT / mR) * mS; 73 | } 74 | }; 75 | }; 76 | 77 | #endif -------------------------------------------------------------------------------- /demos/piano/soloud_basicwave.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2021 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef BASICWAVE_H 26 | #define BASICWAVE_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_adsr.h" 30 | 31 | namespace SoLoud 32 | { 33 | class Basicwave; 34 | 35 | class BasicwaveInstance : public AudioSourceInstance 36 | { 37 | Basicwave *mParent; 38 | float mFreq; 39 | int mOffset; 40 | float mT; 41 | public: 42 | BasicwaveInstance(Basicwave *aParent); 43 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 44 | virtual bool hasEnded(); 45 | }; 46 | 47 | class Basicwave : public AudioSource 48 | { 49 | public: 50 | ADSR mADSR; 51 | float mFreq; 52 | float mSuperwaveScale; 53 | float mSuperwaveDetune; 54 | int mWaveform; 55 | bool mSuperwave; 56 | Basicwave(); 57 | virtual ~Basicwave(); 58 | void setSamplerate(float aSamplerate); 59 | void setWaveform(int aWaveform); 60 | void setFreq(float aFreq, bool aSupewave = false); 61 | virtual AudioSourceInstance *createInstance(); 62 | }; 63 | }; 64 | 65 | #endif -------------------------------------------------------------------------------- /demos/piano/soloud_padsynth.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2018 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef PADSYNTH_H 26 | #define PADSYNTH_H 27 | 28 | #include "soloud_wav.h" 29 | 30 | namespace SoLoud 31 | { 32 | result generatePadsynth( 33 | SoLoud::Wav &aTarget, 34 | unsigned int aHarmonicCount, 35 | float *aHarmonics, 36 | float aBandwidth = 0.25f, 37 | float aBandwidthScale = 1.0f, 38 | float aPrincipalFreq = 440.0f, 39 | float aSampleRate = 44100.0f, 40 | int aSizePow = 18); 41 | } 42 | #endif -------------------------------------------------------------------------------- /demos/simplest/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2014 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #include 26 | 27 | #include "soloud.h" 28 | #include "soloud_speech.h" 29 | #include "soloud_thread.h" 30 | 31 | // Entry point 32 | int main(int argc, char *argv[]) 33 | { 34 | // Define a couple of variables 35 | SoLoud::Soloud soloud; // SoLoud engine core 36 | SoLoud::Speech speech; // A sound source (speech, in this case) 37 | 38 | // Configure sound source 39 | speech.setText("1 2 3 1 2 3 Hello world. Welcome to So-Loud."); 40 | 41 | // initialize SoLoud. 42 | soloud.init(); 43 | 44 | // Play the sound source (we could do this several times if we wanted) 45 | soloud.play(speech); 46 | 47 | // Wait until sounds have finished 48 | while (soloud.getActiveVoiceCount() > 0) 49 | { 50 | // Still going, sleep for a bit 51 | SoLoud::Thread::sleep(100); 52 | } 53 | 54 | // Clean up SoLoud 55 | soloud.deinit(); 56 | 57 | // All done. 58 | return 0; 59 | } -------------------------------------------------------------------------------- /docsrc/SoLoud.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/SoLoud.tex -------------------------------------------------------------------------------- /docsrc/attenuator.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::AudioAttenuator 2 | 3 | 3d sound sources may have custom audio attenuators attached to them. Sometimes the default options provided by SoLoud are not 4 | enough. 5 | 6 | Custom attenuators are used by creating the object and passing it to an audio source via set3dAttenuator call: 7 | 8 | MyCustomAttenuator ca; 9 | gSound.set3dAttenuator(&ca); 10 | gSoloud.play(gSound); 11 | 12 | The attenuator pointer is copied to audio instances, so if you wish to launch several instances of a sound source with different attenuator, simply call the set3dAttenuator() before any play() calls. Disabling the attenuator can be done by giving the call a NULL pointer. 13 | 14 | ### AudioAttenuator.attenuate() 15 | 16 | To create a custom attenuator, extend the AudioAttenuator class. The class defines only one function: 17 | 18 | virtual float attenuate(float aDistance, 19 | float aMinDistance, 20 | float aMaxDistance, 21 | float aRolloffFactor) 22 | 23 | The return value is expected to be in the 0..1 range, and gives the general volume level. 24 | 25 | The custom attenuators are called while processing the 3d audio in the update3dAudio() call, before any panning is calculated. 26 | 27 | Note that calling any SoLoud functions (even to set the position of a 3d audio source) from the attenuate function will most likely cause the application - or at least the audio thread - to freeze due to mutex locks. 28 | -------------------------------------------------------------------------------- /docsrc/bassboostfilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::BassboostFilter 2 | 3 | The bassboost filter is a proof of concept FFT filter. 4 | It simply multiplies the first few bands of the FFT by 5 | the boost value. 6 | 7 | There is one parameter - how strong the boost effect is. 8 | 9 | // Set up bass boost filter 10 | gBassboost.setParams(0.1f); 11 | // Set the filter as the first filter of the bus 12 | gBus.setFilter(0, &gBassboost); 13 | 14 | ### BassboostFilter.setParams() 15 | 16 | Set the parameters of the filter. 17 | 18 | gBassboost.setParams(11); // ours goes to 11 19 | 20 | Changing the parameters via setParams() does not affect "live" sounds. Live parameters 21 | can be set, faded or oscillated: 22 | 23 | gSoloud.fadeFilterParameter( 24 | gMusicHandle, // Sound handle 25 | 0, // First filter 26 | SoLoud::BassboostFilter::BOOST, // What to adjust 27 | 0, // Target value 28 | 3); // Time in seconds 29 | 30 | 31 | ### Live Parameter Access 32 | 33 | All filters inherit the live parameter access functions. 34 | 35 | - BassboostFilter.getParamCount() 36 | - BassboostFilter.getParamName() 37 | - BassboostFilter.getParamType() 38 | - BassboostFilter.getParamMax() 39 | - BassboostFilter.getParamMin() 40 | 41 | -------------------------------------------------------------------------------- /docsrc/biquadfilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::BiquadResonantFilter 2 | 3 | The biquad resonant filter is a surprisingly cheap way to implement low 4 | and high pass filters, as well as some kind of band bass filter. 5 | 6 | The implementation in SoLoud is based on "Using the Biquad Resonant 7 | Filter", Phil Burk, Game Programming Gems 3, p. 606. 8 | 9 | The filter has three parameters - sample rate, cutoff frequency and 10 | resonance. These can also be adjusted on live streams, for instance to 11 | fade the low pass filter cutoff frequency for a outdoors/indoors 12 | transition effect. 13 | 14 | The resonance parameter adjusts the sharpness (or bandwidth) of the 15 | cutoff. 16 | 17 | // Set up low-pass filter 18 | gBQRFilter.setParams(SoLoud::BiquadResonantFilter::LOWPASS, 500, 2); 19 | // Set the filter as the second filter of the bus 20 | gBus.setFilter(1, &gBQRFilter); 21 | 22 | It's also possible to set, fade or oscillate the parameters of a "live" filter 23 | 24 | gSoloud.fadeFilterParameter( 25 | gMusicHandle, // Sound handle 26 | 0, // First filter 27 | SoLoud::BiquadResonantFilter::FREQUENCY, // What to adjust 28 | 2000, // Target value 29 | 3); // Time in seconds 30 | 31 | Currently, four parameters can be adjusted: 32 | 33 | Parameter Description 34 | ---- ------------ 35 | WET Filter's wet signal; 1.0f for fully filtered, 0.0f for original, 0.5f for half and half. 36 | FREQUENCY Filter's cutoff frequency 37 | RESONANCE Filter's resonance - higher means sharper cutoff 38 | 39 | 40 | ### BiquadResonantFilter.setParams() 41 | 42 | 43 | Set the parameters of the filter. 44 | 45 | gBQRFilter.setParams(SoLoud::BiquadResonantFilter::LOWPASS, 44100, 500, 2); 46 | 47 | Changing the parameters does not affect "live" sounds. If invalid parameters are 48 | given, the function will return error. 49 | 50 | 51 | ### Live Parameter Access 52 | 53 | All filters inherit the live parameter access functions. 54 | 55 | - BiquadResonantFilter.getParamCount() 56 | - BiquadResonantFilter.getParamName() 57 | - BiquadResonantFilter.getParamType() 58 | - BiquadResonantFilter.getParamMax() 59 | - BiquadResonantFilter.getParamMin() 60 | -------------------------------------------------------------------------------- /docsrc/bmx_api.mmd: -------------------------------------------------------------------------------- 1 | ## BlitzMax API 2 | 3 | 4 | Using the BlitzMax wrapper, SoLoud DLL can be used from BlitzMax. 5 | 6 | All of the existing interfaces can be used via the BlitzMax API, but 7 | features that require extending SoLoud are not available. 8 | 9 | ### Using the BlitzMax API 10 | 11 | The glue file soloud.bmx can be found under the "glue" directory. 12 | 13 | To use SoLoud with BlitzMax, you can use the soloud.bmx from the glue 14 | directory. Be sure to have soloud_x86.dll in your project directory. 15 | 16 | 17 | ### BlitzMax API Example 18 | 19 | The BlitzMax API mirrors the c++ API. 20 | 21 | If the c++ API functions have default parameters, two functions 22 | are generated: one without the default parameters, and one with. 23 | The one where you can change the default parameters is post-fixed Ex, 24 | such as Soloud_init and Soloud_initEx. 25 | 26 | \pagebreak 27 | 28 | As an example, here's a simple example in the C++ api: 29 | 30 | SoLoud::Soloud soloud; 31 | SoLoud::Speech speech; 32 | 33 | speech.setText("Hello c++ api"); 34 | 35 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 36 | SoLoud::Soloud::ENABLE_VISUALIZATION) 37 | 38 | soloud.setGlobalVolume(4); 39 | soloud.play(speech); 40 | 41 | // ... 42 | 43 | soloud.deinit(); 44 | 45 | Converted to the BlitzMax API, this becomes: 46 | 47 | SuperStrict 48 | 49 | Import "soloud.bmx" 50 | 51 | Local soloud:Byte Ptr = Soloud_create () 52 | Local speech:Byte Ptr = Speech_create () 53 | 54 | Speech_setText speech, "hello from blits max".ToCString () 55 | 56 | Soloud_initEx soloud, SOLOUD_CLIP_ROUNDOFF | SOLOUD_ENABLE_VISUALIZATION, 57 | SOLOUD_AUTO, SOLOUD_AUTO, SOLOUD_AUTO 58 | 59 | Soloud_setGlobalVolume soloud, 4 60 | Soloud_play soloud, speech 61 | 62 | ' ... 63 | 64 | Soloud_deinit soloud 65 | 66 | Speech_destroy speech 67 | Soloud_destroy soloud 68 | -------------------------------------------------------------------------------- /docsrc/c_api.mmd: -------------------------------------------------------------------------------- 1 | ## "C" API / DLL 2 | 3 | 4 | In order to support non-c++ environments, SoLoud also has a "C" API. 5 | 6 | All of the existing interfaces can be used via the "C" API, but 7 | features that require extending SoLoud are not available. 8 | 9 | ### Using the "C" API 10 | 11 | The glue file soloud_c.cpp can be found under the "src/c_api" directory. 12 | 13 | You can either link to the generated DLL, which exposes the "C" API, 14 | or you can include SoLoud C++ sources (or static library) to your 15 | project along with the soloud_c.cpp file. 16 | 17 | In your C sources, include soloud_c.h header file. 18 | 19 | ### "C" API Example 20 | 21 | The "C" API mirrors the c++ API. 22 | 23 | If the c++ API functions have default parameters, two functions 24 | are generated: one without the default parameters, and one with. 25 | The one where you can change the default parameters is post-fixed Ex, 26 | such as Soloud_init and Soloud_initEx. 27 | 28 | \pagebreak 29 | 30 | As an example, here's a simple example in the C++ api: 31 | 32 | SoLoud::Soloud soloud; 33 | SoLoud::Speech speech; 34 | 35 | speech.setText("Hello c++ api"); 36 | 37 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 38 | SoLoud::Soloud::ENABLE_VISUALIZATION) 39 | 40 | soloud.setGlobalVolume(4); 41 | soloud.play(speech); 42 | 43 | // ... 44 | 45 | soloud.deinit(); 46 | 47 | Converted to the "C" API, this becomes: 48 | 49 | Soloud *soloud = Soloud_create(); 50 | Speech *speech = Speech_create(); 51 | 52 | Speech_setText(speech, "Hello c-api"); 53 | 54 | Soloud_initEx(soloud, SOLOUD_CLIP_ROUNDOFF | SOLOUD_ENABLE_VISUALIZATION, 55 | SOLOUD_AUTO, SOLOUD_AUTO, SOLOUD_AUTO); 56 | 57 | Soloud_setGlobalVolume(soloud, 4); 58 | Soloud_play(soloud, speech); 59 | 60 | // ... 61 | 62 | Soloud_deinit(soloud); 63 | 64 | Speech_destroy(speech); 65 | Soloud_destroy(soloud); 66 | 67 | For a slightly longer example, check out the "c_test" demo. 68 | -------------------------------------------------------------------------------- /docsrc/codegen.mmd: -------------------------------------------------------------------------------- 1 | ## Codegen 2 | 3 | In order for SoLoud to be usable from other languages than C++, 4 | glue code needs to be written. Most environments are able to 5 | use "C" DLL:s, and this is one of the things SoLoud has. 6 | 7 | For most cases, you won't need to care about the codegen. Here's 8 | some information, however, if should you be curious. 9 | 10 | Writing and maintaining glue code by hand is, however, tedious and prone 11 | to errors, so all of the glue code for SoLoud is generated with scripts. 12 | 13 | The "C" API is automatically generated from the c++ sources via the 14 | codegen tool that is part of the SoLoud sources. In most cases you 15 | won't need to use the codegen yourself. 16 | 17 | ![Code generation path](images/codegen)\ 18 | 19 | The codegen tool parses the SoLoud headers and generates the needed 20 | headers and wrapper cpp code, as well as the DLL .def file, and a 21 | Python file which can be used to generate glue libraries for other 22 | environments (such as Python itself). 23 | 24 | The generated Python file has also turned out to be useful in writing 25 | of this documentation, as it was pretty easy to write a script that 26 | checks whether a function has been documented or not. 27 | 28 | -------------------------------------------------------------------------------- /docsrc/collider.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::AudioCollider 2 | 3 | 3d sound sources may have custom audio colliders attached to them. By default, audio sources are only defined by their position and maximum range, which makes the sound sources "point sources" and omnidirectional. 4 | 5 | With custom colliders, audio sources may be made to be bound to some area, as well as be directional. 6 | 7 | Custom colliders are used by creating the object and passing it to an audio source via set3dCollider call: 8 | 9 | MyCustomCollider cc; 10 | gSound.set3dCollider(&cc); 11 | gSoloud.play(gSound); 12 | 13 | The set3dCollider call also takes an optional aUserData parameter. The user data as well as the collider pointer are copied to audio instances, so if you wish to launch several instances of a sound source with different collider (or just different user data), simply call the set3dCollider() before any play() calls. Disabling the collider can be done by giving the call a NULL pointer. 14 | 15 | ### AudioCollider.collide() 16 | 17 | To create a custom collider, extend the AudioCollider class. The class defines only one function: 18 | 19 | virtual float collide(Soloud *aSoloud, 20 | AudioSourceInstance *aAudioInstance, 21 | int aUserData) 22 | 23 | The return value is expected to be in the 0..1 range, and gives the general volume level. Soloud object and current audio instance pointers are given for convenience. Additionally, when setting the collider, the application may also set a user data integer value which is also provided to the custom collider through this call. 24 | 25 | The custom colliders are called while processing the 3d audio in the update3dAudio() call, before any panning or attenuation is calculated. Thus, if the collide() function adjusts the audio instance's 3d position, the changes will take effect. 26 | 27 | For example, if a "river" collider was to be created, the collider would check the player's distance to the river, and adjust the sound source's 3d position to the point closest to the player so that if the player runs along the river, the sound would be heard from the direction of the river (instead of, for instance, from just the middle of the river). 28 | 29 | Note that calling any SoLoud functions (even to set the position of a 3d audio source) from the collide function will most likely cause the application - or at least the audio thread - to freeze due to mutex locks. 30 | -------------------------------------------------------------------------------- /docsrc/cs_api.mmd: -------------------------------------------------------------------------------- 1 | ## C sharp (C#) API 2 | 3 | One of the generated glue interfaces for SoLoud is the C sharp API (C#). 4 | 5 | All of the existing interfaces can be used via the C sharp API, but 6 | features that require extending SoLoud are not available. 7 | 8 | ### Using the C sharp API 9 | 10 | The glue file soloud.cs can be found under the "glue" directory. 11 | 12 | Include the soloud.cs from the glue directory in your project, and 13 | make sure the SoLoud DLL is in the same directory as your 14 | executable files. 15 | 16 | ### C sharp API Example 17 | 18 | The C sharp API mirrors the c++ API. 19 | 20 | If the c++ API functions have default parameters, the same function 21 | in the C sharp API will also have default parameters. 22 | 23 | \pagebreak 24 | 25 | As an example, here's a simple example in the C++ api: 26 | 27 | SoLoud::Soloud soloud; 28 | SoLoud::Speech speech; 29 | 30 | speech.setText("Hello c++ api"); 31 | 32 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 33 | SoLoud::Soloud::ENABLE_VISUALIZATION); 34 | 35 | soloud.setGlobalVolume(4); 36 | soloud.play(speech); 37 | 38 | // ... 39 | 40 | soloud.deinit(); 41 | 42 | Converted to the C sharp API, this becomes: 43 | 44 | SoLoud.Soloud soloud = new SoLoud.Soloud(); 45 | SoLoud.Speech speech = new SoLoud.Speech(); 46 | 47 | speech.setText("Hello c sharp api"); 48 | 49 | soloud.init(SoLoud.Soloud.CLIP_ROUNDOFF | 50 | SoLoud.Soloud.ENABLE_VISUALIZATION); 51 | 52 | soloud.setGlobalVolume(4); 53 | soloud.play(speech); 54 | 55 | // ... 56 | 57 | soloud.deinit(); 58 | -------------------------------------------------------------------------------- /docsrc/css/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/css/logo.png -------------------------------------------------------------------------------- /docsrc/css/soloud.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; 3 | color:#000000; 4 | } 5 | 6 | body { 7 | background-image: url(logo.png); 8 | background-repeat: no-repeat; 9 | background-color: #ffffff; 10 | } 11 | 12 | .logo { 13 | position:absolute; 14 | left:0px; 15 | top:0px; 16 | width:190px; 17 | height:130px; 18 | } 19 | 20 | .divider { 21 | position:absolute; 22 | top:130px; 23 | left:0px; 24 | width:100%; 25 | overflow:hidden; 26 | background:#c57917; 27 | height:1px; 28 | } 29 | 30 | .content { 31 | position:absolute; 32 | top:140px; 33 | left:200px; 34 | width:600px; 35 | } 36 | 37 | .menu { 38 | position:absolute; 39 | top:140px; 40 | left:8px; 41 | width:170px; 42 | } 43 | 44 | h1, h2 45 | { 46 | font-size: 32px; 47 | line-height: 46px; 48 | font-weight: normal; 49 | padding: 0; 50 | margin: 0; 51 | margin-top: 10px; 52 | word-wrap: break-word; 53 | } 54 | 55 | a 56 | { 57 | text-decoration:none; 58 | color:#c57917; 59 | } 60 | 61 | a:hover 62 | { 63 | text-decoration:underline; 64 | } 65 | 66 | .code 67 | { 68 | font-family: Consolas, "Lucida Console", "Bitstream Vera Sans Mono", Monaco, monospace; 69 | font-size: 12px; 70 | color: black; 71 | background-color: #e4f5fd; 72 | padding: 8px 8px 8px 8px; 73 | border-style: none; 74 | clear: both; 75 | } 76 | 77 | .img_mid 78 | { 79 | display: block; 80 | margin-left: auto; 81 | margin-right: auto; 82 | } 83 | 84 | 85 | 86 | table { border-collapse: collapse; border-top: 1px solid #c57917; border-bottom: 1px solid #c57917; } 87 | table th { border-bottom: 1px solid #c57917; } 88 | table th, table td { padding: 1px 6px; } 89 | 90 | .content h1:first-child, .content h2:first-child { 91 | font-size: 60px; 92 | position: absolute; 93 | left:-10px; 94 | top:-114px; 95 | width:610px; 96 | text-align:right; 97 | } 98 | -------------------------------------------------------------------------------- /docsrc/css/vs.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Visual Studio-like style based on original C# coloring by Jason Diamond 4 | 5 | */ 6 | pre .comment, 7 | pre .annotation, 8 | pre .template_comment, 9 | pre .diff .header, 10 | pre .chunk, 11 | pre .apache .cbracket { 12 | color: #c57917; 13 | } 14 | 15 | pre .keyword, 16 | pre .id, 17 | pre .title, 18 | pre .built_in, 19 | pre .aggregate, 20 | pre .smalltalk .class, 21 | pre .winutils, 22 | pre .bash .variable { 23 | color: rgb(0, 0, 0); 24 | } 25 | 26 | pre .string, 27 | pre .title, 28 | pre .parent, 29 | pre .tag .attribute .value, 30 | pre .rules .value, 31 | pre .rules .value .number, 32 | pre .ruby .symbol, 33 | pre .instancevar, 34 | pre .aggregate, 35 | pre .template_tag, 36 | pre .django .variable, 37 | pre .addition, 38 | pre .flow, 39 | pre .stream, 40 | pre .apache .tag, 41 | pre .date { 42 | color: rgb(0, 0, 0); 43 | } 44 | 45 | pre .ruby .string, 46 | pre .decorator, 47 | pre .filter .argument, 48 | pre .localvars, 49 | pre .array, 50 | pre .attr_selector, 51 | pre .pseudo, 52 | pre .pi, 53 | pre .doctype, 54 | pre .deletion, 55 | pre .envvar, 56 | pre .shebang, 57 | pre .preprocessor, 58 | pre .userType, 59 | pre .apache .sqbracket { 60 | color: rgb(0, 0, 0); 61 | } 62 | 63 | pre .phpdoc, 64 | pre .javadoc, 65 | pre .xmlDocTag { 66 | color: rgb(0, 0, 0); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /docsrc/d_api.mmd: -------------------------------------------------------------------------------- 1 | ## D API 2 | 3 | One of the generated glue interfaces for SoLoud is the D API. 4 | 5 | All of the existing interfaces can be used via the D API, but 6 | features that require extending SoLoud are not available. 7 | 8 | ### Using the D API 9 | 10 | The glue file soloud.d can be found under the "glue" directory. 11 | 12 | Include the soloud.d from the glue directory in your project, and 13 | make sure the SoLoud DLL is in the same directory as your 14 | executable files. You'll also want to link your executable against the 15 | generated soloud_dll_x86.lib. 16 | 17 | ### D API Example 18 | 19 | The D API mirrors the c++ API. 20 | 21 | If the c++ API functions have default parameters, the same function 22 | in the D API will also have default parameters. 23 | 24 | \pagebreak 25 | 26 | As an example, here's a simple example in the C++ api: 27 | 28 | SoLoud::Soloud soloud; 29 | SoLoud::Speech speech; 30 | 31 | speech.setText("Hello c++ api"); 32 | 33 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 34 | SoLoud::Soloud::ENABLE_VISUALIZATION); 35 | 36 | soloud.setGlobalVolume(4); 37 | soloud.play(speech); 38 | 39 | // ... 40 | 41 | soloud.deinit(); 42 | 43 | Converted to the D API, this becomes: 44 | 45 | Soloud soloud = Soloud.create(); 46 | Speech speech = Speech.create(); 47 | 48 | speech.setText("Hello D api"); 49 | 50 | soloud.init(Soloud.CLIP_ROUNDOFF | 51 | Soloud.ENABLE_VISUALIZATION); 52 | 53 | soloud.setGlobalVolume(4); 54 | soloud.play(speech); 55 | 56 | // ... 57 | 58 | soloud.deinit(); 59 | -------------------------------------------------------------------------------- /docsrc/dcremovalfilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::DCRemovalFilter 2 | 3 | This filter tries to remove DC signal from the audio. In other words, 4 | it tries to center the waveform around 0. This can be useful if some 5 | of the input waveforms gets stuck on non-zero values for a long time. 6 | 7 | The filter does not support changing of parameters on the fly, nor does 8 | it take changing of relative play speed into account. 9 | 10 | The DC removal is performed by calculating the average sample value over 11 | a relatively long period of time, and subtracting this from the output. 12 | 13 | There is one parameter - how long the averaging buffer should be. The 14 | time is in seconds. 15 | 16 | // Set up DC removal filter 17 | gDCRemovalFilter.setParams(0.1f); 18 | // Set the filter as the first filter of the bus 19 | gBus.setFilter(0, &gDCRemovalFilter); 20 | 21 | ### DCRemovalFilter.setParams() 22 | 23 | Set the parameters of the filter. 24 | 25 | gDCRemovalFilter.setParams(0.1f); 26 | 27 | Changing the parameters does not affect "live" sounds. If invalid parameters are 28 | given, the function will return error. 29 | 30 | 31 | ### Live Parameter Access 32 | 33 | All filters inherit the live parameter access functions. 34 | 35 | - DCRemovalFilter.getParamCount() 36 | - DCRemovalFilter.getParamName() 37 | - DCRemovalFilter.getParamType() 38 | - DCRemovalFilter.getParamMax() 39 | - DCRemovalFilter.getParamMin() 40 | -------------------------------------------------------------------------------- /docsrc/echofilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::EchoFilter 2 | 3 | The echo filter in SoLoud is a very simple one. When the sound starts to 4 | play, the echo filter allocates a buffer to contain the echo samples, 5 | and loops through this until the sound ends. 6 | 7 | The filter does not support changing of parameters on the fly, nor does 8 | it take changing of relative play speed into account. 9 | 10 | There are two parameters - delay and decay. Delay is the time in seconds 11 | until the echo, and decay is multiplier for the echo. If the multiplier 12 | is outside the [0..1[ range, the results are unpredictable. 13 | 14 | // Set up echo filter 15 | gEchoFilter.setParams(0.5f, 0.5f); 16 | // Set the filter as the first filter of the bus 17 | gBus.setFilter(0, &gEchoFilter); 18 | 19 | ### EchoFilter.setParams() 20 | 21 | Set the parameters of the filter. 22 | 23 | gEchoFilter.setParams(0.5f, 0.5f); 24 | 25 | Changing the parameters does not affect "live" sounds. If invalid parameters are 26 | given, the function will return error. 27 | 28 | 29 | ### Live Parameter Access 30 | 31 | All filters inherit the live parameter access functions. 32 | 33 | - EchoFilter.getParamCount() 34 | - EchoFilter.getParamName() 35 | - EchoFilter.getParamType() 36 | - EchoFilter.getParamMax() 37 | - EchoFilter.getParamMin() 38 | -------------------------------------------------------------------------------- /docsrc/epub.css: -------------------------------------------------------------------------------- 1 | /* This defines styles and classes used in the book */ 2 | body { margin: 5%; text-align: justify; font-size: medium; } 3 | h1 { text-align: left; } 4 | h2 { text-align: left; } 5 | h3 { text-align: left; } 6 | h4 { text-align: left; } 7 | h5 { text-align: left; } 8 | h6 { text-align: left; } 9 | h1.title { text-align: right; } 10 | h2.author { text-align: right; } 11 | h3.date { text-align: right; } 12 | .caption { text-align: center; font-style: italic; } 13 | ol.toc { padding: 0; margin-left: 1em; } 14 | ol.toc li { list-style-type: none; margin: 0; padding: 0; } 15 | pre 16 | { 17 | font-family: monospace; 18 | font-size: 12px; 19 | color: black; 20 | background-color: #e4f5fd; 21 | padding: 8px 8px 8px 8px; 22 | border-style: none; 23 | clear: both; 24 | } 25 | table { border-collapse: collapse; border-top: 1px solid #c57917; border-bottom: 1px solid #c57917; } 26 | table th { border-bottom: 1px solid #c57917; } 27 | table th, table td { padding: 1px 6px; } 28 | -------------------------------------------------------------------------------- /docsrc/fftfilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::FFTFilter 2 | 3 | The FFT filter is a short-time Fourier transform filter which can 4 | be used as basis for FFT-based effects. The base implementation 5 | does a simple tone downshifting. 6 | 7 | The filter exists mainly to adjust the speech synthesizer's voice in 8 | strange ways. It can also be used as basis for other FFT-based filters. 9 | 10 | 11 | ### Live Parameter Access 12 | 13 | All filters inherit the live parameter access functions. 14 | 15 | - FFTFilter.getParamCount() 16 | - FFTFilter.getParamName() 17 | - FFTFilter.getParamType() 18 | - FFTFilter.getParamMax() 19 | - FFTFilter.getParamMin() 20 | -------------------------------------------------------------------------------- /docsrc/flangerfilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::FlangerFilter 2 | 3 | The flanger filter can be used to create a "flanger" effect on the 4 | signal. Applying this on a human voice may sound more "robotic", for instance. 5 | 6 | // Set up flanger filter 7 | gFlangerFilter.setParams(0.005f, 10); 8 | // Set the filter as the first filter of the bus 9 | gBus.setFilter(0, &gFlangerFilter); 10 | 11 | It's also possible to set, fade or oscillate the parameters of a "live" filter 12 | 13 | gSoloud.fadeFilterParameter( 14 | gMusicHandle, // Sound handle 15 | 0, // First filter 16 | SoLoud::LofiFilter::WET, // What to adjust 17 | 0, // Target value 18 | 3); // Time in seconds 19 | 20 | Currently, four parameters can be adjusted: 21 | 22 | Parameter Description 23 | ---- ------------ 24 | WET Filter's wet signal; 1.0f for fully filtered, 0.0f for original, 0.5f for half and half. 25 | FREQ Filter's frequency 26 | DELAY Filter's delay 27 | 28 | ### FlangerFilter.setParams() 29 | 30 | Set the parameters of the filter. 31 | 32 | gFlangerFilter.setParams(0.005f, 10); 33 | 34 | Changing the parameters does not affect "live" sounds. If invalid parameters are 35 | given, the function will return error. 36 | 37 | \pagebreak 38 | ### Live Parameter Access 39 | 40 | All filters inherit the live parameter access functions. 41 | 42 | - FlangerFilter.getParamCount() 43 | - FlangerFilter.getParamName() 44 | - FlangerFilter.getParamType() 45 | - FlangerFilter.getParamMax() 46 | - FlangerFilter.getParamMin() 47 | -------------------------------------------------------------------------------- /docsrc/foreign_interface.mmd: -------------------------------------------------------------------------------- 1 | # Foreign Interfaces 2 | 3 | SoLoud can be used from various environments through a "C" API DLL. 4 | 5 | In order to use SoLoud from a different environment, such as Python or BlitzMax, 6 | you need the SoLoud DLL and a wrapper. The wrappers for SoLoud are not made 7 | by hand, but instead generated through Python scripts. This minimizes hassle 8 | when SoLoud gets new features, as the new wrappers can simply be generated via 9 | the scripts. 10 | 11 | Some foreign interfaces may be more complex, such as the GameMaker:Studio, which 12 | only supports variable types double and char*. For such, we generate a glue DLL 13 | to act as translator between GameMaker:Studio and the SoLoud "C" API DLL. 14 | 15 | All of the glue libraries, and scripts to generate them, can be found under the 16 | "glue" directory. The only exception to this rule is the C api, which is located 17 | under "src/c_api". 18 | -------------------------------------------------------------------------------- /docsrc/freeverbfilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::FreeverbFilter 2 | 3 | Freeverb is a reverb filter based on the code written by Jezar at Dreampoint, 4 | June 2000 http://www.dreampoint.co.uk, and placed under public domain. There 5 | are other versions of Freeverb out there with different licenses. 6 | 7 | While it sounds great, the filter is relatively heavy, and should be used sparingly. 8 | 9 | ### FreeverbFilter.setParams() 10 | 11 | Set parameters of the filter. Does not affect "live" filters. 12 | 13 | verb.setParams(0, 0.5f, 0.5f, 1); 14 | 15 | The mode parameter freezes the audio currently flowing through the 16 | filter; setting it to 1 before playing audio will cause the filter 17 | to just replicate silence. 18 | 19 | ### Live Parameter Access 20 | 21 | All filters inherit the live parameter access functions. 22 | 23 | - FreeverbFilter.getParamCount() 24 | - FreeverbFilter.getParamName() 25 | - FreeverbFilter.getParamType() 26 | - FreeverbFilter.getParamMax() 27 | - FreeverbFilter.getParamMin() 28 | -------------------------------------------------------------------------------- /docsrc/gamemaker_api.mmd: -------------------------------------------------------------------------------- 1 | ## GameMaker: Studio API 2 | 3 | 4 | Using the GameMaker: Studio extension, SoLoud can be used from GameMaker: Studio. 5 | 6 | Most of the existing interfaces can be used via the GameMaker: Studio API. 7 | Features that require extending SoLoud are not available. Additionally, the 8 | GameMaker: Studio limits extensions to only two variable types: doubles and 9 | strings. This means that anything more complex, such as wave and FFT data, 10 | cannot be used. 11 | 12 | 13 | 14 | ### Using the GameMaker: Studio API 15 | 16 | The extension soloud.gmez can be found under the "glue" directory. 17 | 18 | To use SoLoud with GameMaker: Studio, you can import the soloud.gmez extension 19 | to your project. As of this writing, only windows target is supported. 20 | 21 | 22 | ### GameMaker: Studio API Example 23 | 24 | The GameMaker: Studio API mirrors the c++ API. 25 | 26 | If the c++ API functions have default parameters, two functions 27 | are generated: one without the default parameters, and one with. 28 | The one where you can change the default parameters is post-fixed Ex, 29 | such as Soloud_init and Soloud_initEx. 30 | 31 | \pagebreak 32 | 33 | As an example, here's a simple example in the C++ api: 34 | 35 | SoLoud::Soloud soloud; 36 | SoLoud::Speech speech; 37 | 38 | speech.setText("Hello c++ api"); 39 | 40 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 41 | SoLoud::Soloud::ENABLE_VISUALIZATION) 42 | 43 | soloud.setGlobalVolume(4); 44 | soloud.play(speech); 45 | 46 | // ... 47 | 48 | soloud.deinit(); 49 | 50 | Converted to the GameMaker: Studio API, this becomes: 51 | 52 | soloud = Soloud_create(); 53 | speech = Speech_create(); 54 | 55 | Speech_setText(speech, "Hello from GameMaker: Studio"); 56 | 57 | Soloud_initEx(soloud, SOLOUD_CLIP_ROUNDOFF + SOLOUD_ENABLE_VISUALIZATION, 58 | SOLOUD_AUTO, SOLOUD_AUTO, SOLOUD_AUTO); 59 | 60 | Soloud_setGlobalVolume(soloud, 4); 61 | Soloud_play(soloud, speech); 62 | 63 | // ... 64 | 65 | Soloud_deinit(soloud); 66 | 67 | Speech_destroy(speech); 68 | Soloud_destroy(soloud); 69 | -------------------------------------------------------------------------------- /docsrc/html.pandoc: -------------------------------------------------------------------------------- 1 | $for(include-before)$ 2 | $include-before$ 3 | $endfor$ 4 | $body$ 5 | $for(include-after)$ 6 | $include-after$ 7 | $endfor$ 8 | -------------------------------------------------------------------------------- /docsrc/htmlpost.txt: -------------------------------------------------------------------------------- 1 |

Copyright©2013-2020 Jari Komppa

2 | 3 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docsrc/images/SoLoudLogo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/SoLoudLogo.pdf -------------------------------------------------------------------------------- /docsrc/images/att_exp_max.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_exp_max.pdf -------------------------------------------------------------------------------- /docsrc/images/att_exp_max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_exp_max.png -------------------------------------------------------------------------------- /docsrc/images/att_exp_min.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_exp_min.pdf -------------------------------------------------------------------------------- /docsrc/images/att_exp_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_exp_min.png -------------------------------------------------------------------------------- /docsrc/images/att_exp_rolloff.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_exp_rolloff.pdf -------------------------------------------------------------------------------- /docsrc/images/att_exp_rolloff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_exp_rolloff.png -------------------------------------------------------------------------------- /docsrc/images/att_inv_max.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_inv_max.pdf -------------------------------------------------------------------------------- /docsrc/images/att_inv_max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_inv_max.png -------------------------------------------------------------------------------- /docsrc/images/att_inv_min.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_inv_min.pdf -------------------------------------------------------------------------------- /docsrc/images/att_inv_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_inv_min.png -------------------------------------------------------------------------------- /docsrc/images/att_inv_rolloff.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_inv_rolloff.pdf -------------------------------------------------------------------------------- /docsrc/images/att_inv_rolloff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_inv_rolloff.png -------------------------------------------------------------------------------- /docsrc/images/att_lin_max.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_lin_max.pdf -------------------------------------------------------------------------------- /docsrc/images/att_lin_max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_lin_max.png -------------------------------------------------------------------------------- /docsrc/images/att_lin_min.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_lin_min.pdf -------------------------------------------------------------------------------- /docsrc/images/att_lin_min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_lin_min.png -------------------------------------------------------------------------------- /docsrc/images/att_lin_rolloff.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_lin_rolloff.pdf -------------------------------------------------------------------------------- /docsrc/images/att_lin_rolloff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/att_lin_rolloff.png -------------------------------------------------------------------------------- /docsrc/images/clipping.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clipping.pdf -------------------------------------------------------------------------------- /docsrc/images/clipping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clipping.png -------------------------------------------------------------------------------- /docsrc/images/clocked_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clocked_1.pdf -------------------------------------------------------------------------------- /docsrc/images/clocked_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clocked_1.png -------------------------------------------------------------------------------- /docsrc/images/clocked_1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/clocked_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clocked_2.pdf -------------------------------------------------------------------------------- /docsrc/images/clocked_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clocked_2.png -------------------------------------------------------------------------------- /docsrc/images/clocked_2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/clocked_3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clocked_3.pdf -------------------------------------------------------------------------------- /docsrc/images/clocked_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/clocked_3.png -------------------------------------------------------------------------------- /docsrc/images/clocked_3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/codegen.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/codegen.pdf -------------------------------------------------------------------------------- /docsrc/images/codegen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/codegen.png -------------------------------------------------------------------------------- /docsrc/images/concepts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/concepts.pdf -------------------------------------------------------------------------------- /docsrc/images/concepts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/concepts.png -------------------------------------------------------------------------------- /docsrc/images/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/cover.png -------------------------------------------------------------------------------- /docsrc/images/demo_3dtest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_3dtest.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_3dtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_3dtest.png -------------------------------------------------------------------------------- /docsrc/images/demo_3dtest.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_env.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_env.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_env.png -------------------------------------------------------------------------------- /docsrc/images/demo_env.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_mixbusses.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_mixbusses.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_mixbusses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_mixbusses.png -------------------------------------------------------------------------------- /docsrc/images/demo_mixbusses.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_monotone.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_monotone.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_monotone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_monotone.png -------------------------------------------------------------------------------- /docsrc/images/demo_monotone.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_multimusic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_multimusic.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_multimusic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_multimusic.png -------------------------------------------------------------------------------- /docsrc/images/demo_multimusic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_pewpew.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_pewpew.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_pewpew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_pewpew.png -------------------------------------------------------------------------------- /docsrc/images/demo_pewpew.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_piano.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_piano.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_piano.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_piano.png -------------------------------------------------------------------------------- /docsrc/images/demo_piano.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_simplest.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_simplest.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_simplest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_simplest.png -------------------------------------------------------------------------------- /docsrc/images/demo_simplest.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_space.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_space.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_space.png -------------------------------------------------------------------------------- /docsrc/images/demo_space.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_tedsid.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_tedsid.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_tedsid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_tedsid.png -------------------------------------------------------------------------------- /docsrc/images/demo_tedsid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_virtualvoices.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_virtualvoices.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_virtualvoices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_virtualvoices.png -------------------------------------------------------------------------------- /docsrc/images/demo_virtualvoices.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/demo_welcome.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_welcome.pdf -------------------------------------------------------------------------------- /docsrc/images/demo_welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/demo_welcome.png -------------------------------------------------------------------------------- /docsrc/images/demo_welcome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 56 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docsrc/images/dirstruct.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/dirstruct.pdf -------------------------------------------------------------------------------- /docsrc/images/dirstruct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/dirstruct.png -------------------------------------------------------------------------------- /docsrc/images/doppler.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/doppler.pdf -------------------------------------------------------------------------------- /docsrc/images/doppler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/doppler.png -------------------------------------------------------------------------------- /docsrc/images/file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/file.pdf -------------------------------------------------------------------------------- /docsrc/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/file.png -------------------------------------------------------------------------------- /docsrc/images/milestones.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/milestones.png -------------------------------------------------------------------------------- /docsrc/images/mixbus.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/mixbus.pdf -------------------------------------------------------------------------------- /docsrc/images/mixbus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/mixbus.png -------------------------------------------------------------------------------- /docsrc/images/pianokeys.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/pianokeys.pdf -------------------------------------------------------------------------------- /docsrc/images/pianokeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/pianokeys.png -------------------------------------------------------------------------------- /docsrc/images/resampler.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/resampler.pdf -------------------------------------------------------------------------------- /docsrc/images/resampler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/resampler.png -------------------------------------------------------------------------------- /docsrc/images/resampler.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 39 | 41 | 42 | 44 | image/svg+xml 45 | 47 | 48 | 49 | 50 | 51 | 55 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /docsrc/images/sfxr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/sfxr.pdf -------------------------------------------------------------------------------- /docsrc/images/sfxr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/sfxr.png -------------------------------------------------------------------------------- /docsrc/images/source_backend.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/source_backend.pdf -------------------------------------------------------------------------------- /docsrc/images/source_backend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/source_backend.png -------------------------------------------------------------------------------- /docsrc/images/speaker_dot.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/speaker_dot.pdf -------------------------------------------------------------------------------- /docsrc/images/speaker_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/speaker_dot.png -------------------------------------------------------------------------------- /docsrc/images/time.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/time.pdf -------------------------------------------------------------------------------- /docsrc/images/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/time.png -------------------------------------------------------------------------------- /docsrc/images/virtualvoices.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/virtualvoices.pdf -------------------------------------------------------------------------------- /docsrc/images/virtualvoices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/virtualvoices.png -------------------------------------------------------------------------------- /docsrc/images/voicegroups.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/voicegroups.pdf -------------------------------------------------------------------------------- /docsrc/images/voicegroups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/docsrc/images/voicegroups.png -------------------------------------------------------------------------------- /docsrc/lofifilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::LofiFilter 2 | 3 | The lofi filter is a signal degrading filter. You can adjust both 4 | the bit depth and the sample rate of the output, and these parameters 5 | can also be adjusted (and even faded) on the fly. 6 | 7 | // Set up low-pass filter 8 | gLofiFilter.setParams(8000, 5); 9 | // Set the filter as the first filter of the bus 10 | gBus.setFilter(0, &gLofiFilter); 11 | 12 | It's also possible to set, fade or oscillate the parameters of a "live" filter 13 | 14 | gSoloud.fadeFilterParameter( 15 | gMusicHandle, // Sound handle 16 | 0, // First filter 17 | SoLoud::LofiFilter::BITDEPTH, // What to adjust 18 | 2, // Target value 19 | 3); // Time in seconds 20 | 21 | Currently, four parameters can be adjusted: 22 | 23 | Parameter Description 24 | ---- ------------ 25 | WET Filter's wet signal; 1.0f for fully filtered, 0.0f for original, 0.5f for half and half. 26 | SAMPLERATE Filter's samplerate parameter 27 | BITDEPTH Filter's bit-depth parameter 28 | 29 | Note that the bit depth does not need to be an integer value. 30 | 31 | ### LofiFilter.setParams() 32 | 33 | Set the parameters of the filter. 34 | 35 | gLofiFilter.setParams(8000, 5); 36 | 37 | Changing the parameters does not affect "live" sounds. If invalid parameters are 38 | given, the function will return error. 39 | 40 | \pagebreak 41 | ### Live Parameter Access 42 | 43 | All filters inherit the live parameter access functions. 44 | 45 | - LofiFilter.getParamCount() 46 | - LofiFilter.getParamName() 47 | - LofiFilter.getParamType() 48 | - LofiFilter.getParamMax() 49 | - LofiFilter.getParamMin() 50 | -------------------------------------------------------------------------------- /docsrc/metadata.xml: -------------------------------------------------------------------------------- 1 | Creative Commons Non-Commercial Share Alike 3.0 2 | en-US 3 | -------------------------------------------------------------------------------- /docsrc/robotizefilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::RobotizeFilter 2 | 3 | The robotize filter modulates the signal with a waveform. By default this is a square wave 4 | adjusted to have half of its period at zero, resulting at a choppy sound. Various waveforms 5 | can be selected for different effects. 6 | 7 | ### RobotizeFilter.setParams() 8 | 9 | Set the parameters for the filter. Does not affect "live" sounds. 10 | 11 | robo.setParams(30, 0); 12 | 13 | Supported waveforms include: 14 | 15 | | Waveform | Description | 16 | |:---------|:-----------------------| 17 | |WAVE_SQUARE|Raw, harsh square wave| 18 | |WAVE_SAW|Raw, harsh saw wave| 19 | |WAVE_SIN|Sine wave| 20 | |WAVE_TRIANGLE|Triangle wave| 21 | |WAVE_BOUNCE|Bounce, i.e, abs(sin())| 22 | |WAVE_JAWS|Quater sine wave, rest of period quiet| 23 | |WAVE_HUMPS|Half sine wave, rest of period quiet| 24 | |WAVE_FSQUARE|"Fourier" square wave; less noisy| 25 | |WAVE_FSAW|"Fourier" saw wave; less noisy| 26 | 27 | ### Live Parameter Access 28 | 29 | All filters inherit the live parameter access functions. 30 | 31 | - RobotizeFilter.getParamCount() 32 | - RobotizeFilter.getParamName() 33 | - RobotizeFilter.getParamType() 34 | - RobotizeFilter.getParamMax() 35 | - RobotizeFilter.getParamMin() 36 | -------------------------------------------------------------------------------- /docsrc/rpgmaker_api.mmd: -------------------------------------------------------------------------------- 1 | ## RPG Maker API 2 | 3 | 4 | One of the generated glue interfaces for SoLoud is the RPG Maker API. 5 | Since RPG Maker uses Ruby, this API is equal to the Ruby API. 6 | 7 | All of the existing interfaces can be used via the Ruby API, but 8 | features that require extending SoLoud are not available. 9 | 10 | ### Using the RPG Maker API 11 | 12 | The glue file rpgmaker_soloud.rb can be found under the "glue" directory. 13 | 14 | Copy the contents of rpgmaker_soloud.rb into one RPG Maker script 15 | tab, drop the "soloud_x86.dll" in your project's System folder and 16 | just use it. 17 | 18 | ### RPG Maker API Example 19 | 20 | The RPG Maker Ruby API mirrors the c++ API. 21 | 22 | If the c++ API functions have default parameters, the same function 23 | in the ruby API will also have default parameters. 24 | 25 | \pagebreak 26 | 27 | As an example, here's a simple example in the C++ api: 28 | 29 | SoLoud::Soloud soloud; 30 | SoLoud::Speech speech; 31 | 32 | speech.setText("Hello c++ api"); 33 | 34 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 35 | SoLoud::Soloud::ENABLE_VISUALIZATION) 36 | 37 | soloud.setGlobalVolume(4); 38 | soloud.play(speech); 39 | 40 | // ... 41 | 42 | soloud.deinit(); 43 | 44 | Converted to the RPG Maker API, this becomes: 45 | 46 | soloud=SoLoud::Soloud.new 47 | speech=SoLoud::Speech.new 48 | 49 | speech.set_text("Hello Ruby api") 50 | 51 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 52 | SoLoud::Soloud::ENABLE_VISUALIZATION) 53 | 54 | soloud.set_global_volume(4) 55 | soloud.play(speech) 56 | 57 | # ... 58 | 59 | soloud.deinit() 60 | speech.destroy() 61 | soloud.destroy() 62 | -------------------------------------------------------------------------------- /docsrc/ruby_api.mmd: -------------------------------------------------------------------------------- 1 | ## Ruby API 2 | 3 | One of the generated glue interfaces for SoLoud is the Ruby API. 4 | 5 | All of the existing interfaces can be used via the Ruby API, but 6 | features that require extending SoLoud are not available. 7 | 8 | ### Using the Ruby API 9 | 10 | The glue file soloud.rb can be found under the "glue" directory. 11 | 12 | Include the SoLoud DLL and soloud.rb in the same directory as your 13 | ruby files, and use 14 | 15 | load 'soloud.rb' 16 | 17 | to include SoLoud to your project. 18 | 19 | ### Ruby API Example 20 | 21 | 22 | The Ruby API mirrors the c++ API. 23 | 24 | If the c++ API functions have default parameters, the same function 25 | in the ruby API will also have default parameters. 26 | 27 | \pagebreak 28 | 29 | As an example, here's a simple example in the C++ api: 30 | 31 | SoLoud::Soloud soloud; 32 | SoLoud::Speech speech; 33 | 34 | speech.setText("Hello c++ api"); 35 | 36 | soloud.init(SoLoud::Soloud::CLIP_ROUNDOFF | 37 | SoLoud::Soloud::ENABLE_VISUALIZATION) 38 | 39 | soloud.setGlobalVolume(4); 40 | soloud.play(speech); 41 | 42 | // ... 43 | 44 | soloud.deinit(); 45 | 46 | Converted to the Ruby API, this becomes: 47 | 48 | load 'soloud.rb' 49 | 50 | soloud=Soloud.new("") 51 | speech=Speech.new("") 52 | 53 | speech.set_text("Hello Ruby api") 54 | 55 | soloud.init(soloud::CLIP_ROUNDOFF | 56 | soloud::ENABLE_VISUALIZATION) 57 | 58 | soloud.set_global_volume(4) 59 | soloud.play(speech) 60 | 61 | # ... 62 | 63 | soloud.deinit() 64 | speech.destroy() 65 | soloud.destroy() 66 | -------------------------------------------------------------------------------- /docsrc/singlehtml_body.txt: -------------------------------------------------------------------------------- 1 |

SoLoud Audio Engine

2 |

Copyright © Jari Komppa

3 |

http://soloud.audio.com

4 |

Table of Contents

5 | -------------------------------------------------------------------------------- /docsrc/singlehtml_head.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docsrc/title.txt: -------------------------------------------------------------------------------- 1 | % SoLoud Audio Engine 2 | % Jari Komppa 3 | -------------------------------------------------------------------------------- /docsrc/vic.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::Vic 2 | 3 | 4 | The SoLoud::Vic is a vic-20 audio emulator. It is used by adjusting registers directly, like 5 | on the actual device. 6 | 7 | This audio source is a bit of a work in progress. All instances of a single Vic object will play 8 | exactly the same audio, and registers are set at the object level. 9 | 10 | ### Vic.setModel(), Vic.getModel() 11 | 12 | The model of machine, between PAL and NTSC, can be set and queried. PAL is the default. 13 | 14 | // Set model to NTSC 15 | gMyVic.setModel(SoLoud::Vic::NTSC); 16 | 17 | ### Vic.setRegister(), Vic.getRegister() 18 | 19 | Registers can be set and read. All of the four registers are 8 bits wide. 20 | 21 | // Increment register 2 22 | unsigned char v = gMyVic.getRegister(2); 23 | gMyVic.setRegister(2, v + 1); 24 | 25 | ### Vic.setLooping(), Vic.setLoopPoint(), Vic.getLoopPoint() 26 | 27 | 28 | Adjusting the looping of a vic sound does not have any effect. 29 | 30 | ### Vic.setFilter() 31 | 32 | 33 | As with any other audio source, you can attach filters to 34 | monotone audio sources. 35 | 36 | gMusic.setFilter(0, &gLofi); 37 | 38 | \pagebreak 39 | 40 | 41 | ### Vic.stop() 42 | 43 | 44 | You can stop all instances of a vic sound source with 45 | stop(). This is equivalent of calling soloud.stopAudioSource() 46 | with the sound source. 47 | 48 | gMusic.stop(); 49 | 50 | ### Vic.setInaudibleBehavior() 51 | 52 | Set the inaudible behavior of the sound. By default, if a sound is 53 | inaudible, it's paused, and will resume when it becomes audible again. 54 | With this function you can tell SoLoud to either kill the sound if 55 | it becomes inaudible, or to keep ticking the sound even if it's 56 | inaudible. 57 | 58 | // Keep on talking even if I'm not around 59 | gSpeech.setInaudibleBehavior(true, false); 60 | 61 | ### Vic.setVolume() 62 | 63 | Set the default volume of the instances created from this audio source. 64 | 65 | gTinyVoice.setVolume(0.1); 66 | 67 | 68 | ### Inherited 3d audio interfaces 69 | 70 | Like all other audio sources, monotone inherits the 3d audio interfaces. Please refer to the 3d audio chapter for details on: 71 | 72 | - Vic.set3dMinMaxDistance() 73 | - Vic.set3dAttenuation() 74 | - Vic.set3dDopplerFactor() 75 | - Vic.set3dProcessing() 76 | - Vic.set3dListenerRelative() 77 | - Vic.set3dDistanceDelay() 78 | - Vic.set3dCollider() 79 | - Vic.set3dAttenuator() 80 | -------------------------------------------------------------------------------- /docsrc/vizsn.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::Vizsn 2 | 3 | Vizsn is another free, but primitive speech synthesizer. 4 | 5 | This audio source is a bit of a work in progress. 6 | 7 | ### Vizsn.setText() 8 | 9 | The words to be spoken are set with setText(). Calling this while the audio source is in use 10 | may cause undefined behavior. 11 | 12 | // Speak the truth 13 | gTalk.setText("You probably won't understand what I'm saying"); 14 | 15 | ### Vizsn.setLooping() 16 | 17 | 18 | Adjusting the looping of a monotone sound does not currently 19 | have any effect. All music is set to loop by default. 20 | 21 | ### Vizsn.setFilter() 22 | 23 | 24 | As with any other audio source, you can attach filters to 25 | monotone audio sources. 26 | 27 | gTalk.setFilter(0, &gLofi); 28 | 29 | ### Vizsn.stop() 30 | 31 | 32 | You can stop all instances of a monotone sound source with 33 | stop(). This is equivalent of calling soloud.stopAudioSource() 34 | with the sound source. 35 | 36 | // Shut up. 37 | gTalk.stop(); 38 | 39 | \pagebreak 40 | 41 | 42 | ### Vizsn.setInaudibleBehavior() 43 | 44 | Set the inaudible behavior of the sound. By default, if a sound is 45 | inaudible, it's paused, and will resume when it becomes audible again. 46 | With this function you can tell SoLoud to either kill the sound if 47 | it becomes inaudible, or to keep ticking the sound even if it's 48 | inaudible. 49 | 50 | // Keep on talking even if I'm not around 51 | gTalk.setInaudibleBehavior(true, false); 52 | 53 | ### Vizsn.setVolume() 54 | 55 | Set the default volume of the instances created from this audio source. 56 | 57 | gTinyVoice.setVolume(0.1); 58 | 59 | ### Vizsn.setLoopPoint(), Vizsn.getLoopPoint() 60 | 61 | If looping is enabled, the loop point is, by default, the start of the 62 | stream. The loop point can be changed, and current loop point can be 63 | queried with these functions. 64 | 65 | double t = snd.getLoopPoint(); 66 | snd.setLoopPoint(t + 1); // skip 1 second more when looping 67 | ... 68 | snd.setLoopPoint(0); // loop from start 69 | 70 | ### Inherited 3d audio interfaces 71 | 72 | Like all other audio sources, monotone inherits the 3d audio interfaces. Please refer to the 3d audio chapter for details on: 73 | 74 | - Vizsn.set3dMinMaxDistance() 75 | - Vizsn.set3dAttenuation() 76 | - Vizsn.set3dDopplerFactor() 77 | - Vizsn.set3dProcessing() 78 | - Vizsn.set3dListenerRelative() 79 | - Vizsn.set3dDistanceDelay() 80 | - Vizsn.set3dCollider() 81 | - Vizsn.set3dAttenuator() 82 | -------------------------------------------------------------------------------- /docsrc/waveshaperfilter.mmd: -------------------------------------------------------------------------------- 1 | ## SoLoud::WaveShaperFilter 2 | 3 | The waveshaper filter is an experimental filter that 4 | shapes the input wave by a simple function. It is mostly 5 | meant as a voice distortion filter. 6 | 7 | There is one parameter to adjust the severity of the effect. 8 | 9 | // Set up wave shaper 10 | gWaveshaper.setParams(0.1f, 1); 11 | // Set the filter as the first filter of the bus 12 | gBus.setFilter(0, &gWaveshaper); 13 | 14 | ### WaveShaperFilter.setParams() 15 | 16 | Set the parameters of the filter. 17 | 18 | gWaveshaper.setParams(0.3f, 1); 19 | 20 | Changing the parameters via setParams() does not affect "live" sounds. Live parameters 21 | can be set, faded or oscillated: 22 | 23 | gSoloud.fadeFilterParameter( 24 | gMusicHandle, // Sound handle 25 | 0, // First filter 26 | 1, // What to adjust 27 | 0, // Target value 28 | 3); // Time in seconds 29 | 30 | ### Live Parameter Access 31 | 32 | All filters inherit the live parameter access functions. 33 | 34 | - WaveShaperFilter.getParamCount() 35 | - WaveShaperFilter.getParamName() 36 | - WaveShaperFilter.getParamType() 37 | - WaveShaperFilter.getParamMax() 38 | - WaveShaperFilter.getParamMin() 39 | -------------------------------------------------------------------------------- /glue/readme.txt: -------------------------------------------------------------------------------- 1 | In this directory you can find generated glue files 2 | for various environments (python, ruby, cs, d...) 3 | -------------------------------------------------------------------------------- /include/soloud_ay.h: -------------------------------------------------------------------------------- 1 | /* 2 | AY module for SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef AY_H 26 | #define AY_H 27 | 28 | #include "soloud.h" 29 | 30 | class ChipPlayer; 31 | 32 | namespace SoLoud 33 | { 34 | class Ay; 35 | class File; 36 | class AyInstance : public AudioSourceInstance 37 | { 38 | public: 39 | Ay *mParent; 40 | ChipPlayer *mChip; 41 | int mPos; 42 | 43 | AyInstance(Ay *aParent); 44 | ~AyInstance(); 45 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 46 | virtual bool hasEnded(); 47 | virtual result rewind(); 48 | virtual float getInfo(unsigned int aInfoKey); 49 | }; 50 | 51 | class Ay : public AudioSource 52 | { 53 | public: 54 | bool mYm; 55 | int mChipspeed; 56 | int mCpuspeed; 57 | int mLooppos; 58 | int mLength; 59 | unsigned short* mOps; 60 | public: 61 | Ay(); 62 | ~Ay(); 63 | result load(const char *aFilename); 64 | result loadFile(File *aFile); 65 | result loadMem(const unsigned char* aMem, unsigned int aLength, bool aCopy, bool aTakeOwnership); 66 | virtual AudioSourceInstance *createInstance(); 67 | }; 68 | }; 69 | 70 | #endif -------------------------------------------------------------------------------- /include/soloud_bassboostfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_BASSBOOSTFILTER_H 26 | #define SOLOUD_BASSBOOSTFILTER_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_fftfilter.h" 30 | 31 | namespace SoLoud 32 | { 33 | class BassboostFilter; 34 | 35 | class BassboostFilterInstance : public FFTFilterInstance 36 | { 37 | enum FILTERATTRIBUTE 38 | { 39 | WET = 0, 40 | BOOST = 1 41 | }; 42 | BassboostFilter *mParent; 43 | public: 44 | virtual void fftFilterChannel(float *aFFTBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 45 | BassboostFilterInstance(BassboostFilter *aParent); 46 | }; 47 | 48 | class BassboostFilter : public FFTFilter 49 | { 50 | public: 51 | enum FILTERATTRIBUTE 52 | { 53 | WET = 0, 54 | BOOST = 1 55 | }; 56 | virtual int getParamCount(); 57 | virtual const char* getParamName(unsigned int aParamIndex); 58 | virtual unsigned int getParamType(unsigned int aParamIndex); 59 | virtual float getParamMax(unsigned int aParamIndex); 60 | virtual float getParamMin(unsigned int aParamIndex); 61 | float mBoost; 62 | result setParams(float aBoost); 63 | virtual FilterInstance *createInstance(); 64 | BassboostFilter(); 65 | }; 66 | } 67 | 68 | #endif -------------------------------------------------------------------------------- /include/soloud_dcremovalfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_DCREMOVAL_H 26 | #define SOLOUD_DCREMOVAL_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class DCRemovalFilter; 33 | 34 | class DCRemovalFilterInstance : public FilterInstance 35 | { 36 | float *mBuffer; 37 | float *mTotals; 38 | int mBufferLength; 39 | DCRemovalFilter *mParent; 40 | int mOffset; 41 | 42 | public: 43 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 44 | virtual ~DCRemovalFilterInstance(); 45 | DCRemovalFilterInstance(DCRemovalFilter *aParent); 46 | }; 47 | 48 | class DCRemovalFilter : public Filter 49 | { 50 | public: 51 | float mLength; 52 | virtual FilterInstance *createInstance(); 53 | DCRemovalFilter(); 54 | result setParams(float aLength = 0.1f); 55 | }; 56 | } 57 | 58 | #endif -------------------------------------------------------------------------------- /include/soloud_duckfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2021 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_DUCKFILTER_H 26 | #define SOLOUD_DUCKFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class DuckFilter; 33 | 34 | class DuckFilterInstance : public FilterInstance 35 | { 36 | handle mListenTo; 37 | Soloud* mSoloud; 38 | float mCurrentLevel; 39 | public: 40 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 41 | virtual ~DuckFilterInstance(); 42 | DuckFilterInstance(DuckFilter *aParent); 43 | }; 44 | 45 | class DuckFilter : public Filter 46 | { 47 | public: 48 | enum FILTERATTRIBUTE 49 | { 50 | WET = 0, 51 | ONRAMP, 52 | OFFRAMP, 53 | LEVEL 54 | }; 55 | Soloud* mSoloud; 56 | float mOnRamp; 57 | float mOffRamp; 58 | float mLevel; 59 | handle mListenTo; 60 | virtual int getParamCount(); 61 | virtual const char* getParamName(unsigned int aParamIndex); 62 | virtual unsigned int getParamType(unsigned int aParamIndex); 63 | virtual float getParamMax(unsigned int aParamIndex); 64 | virtual float getParamMin(unsigned int aParamIndex); 65 | virtual FilterInstance *createInstance(); 66 | DuckFilter(); 67 | result setParams(Soloud* aSoloud, handle aListenTo, float aOnRamp = 0.1f, float aOffRamp = 0.5f, float aLevel = 0.1f); 68 | }; 69 | } 70 | 71 | #endif -------------------------------------------------------------------------------- /include/soloud_echofilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_ECHOFILTER_H 26 | #define SOLOUD_ECHOFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class EchoFilter; 33 | 34 | class EchoFilterInstance : public FilterInstance 35 | { 36 | float *mBuffer; 37 | int mBufferLength; 38 | int mBufferMaxLength; 39 | int mOffset; 40 | 41 | public: 42 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 43 | virtual ~EchoFilterInstance(); 44 | EchoFilterInstance(EchoFilter *aParent); 45 | }; 46 | 47 | class EchoFilter : public Filter 48 | { 49 | public: 50 | enum FILTERATTRIBUTE 51 | { 52 | WET = 0, 53 | DELAY, 54 | DECAY, 55 | FILTER 56 | }; 57 | float mDelay; 58 | float mDecay; 59 | float mFilter; 60 | virtual int getParamCount(); 61 | virtual const char* getParamName(unsigned int aParamIndex); 62 | virtual unsigned int getParamType(unsigned int aParamIndex); 63 | virtual float getParamMax(unsigned int aParamIndex); 64 | virtual float getParamMin(unsigned int aParamIndex); 65 | virtual FilterInstance *createInstance(); 66 | EchoFilter(); 67 | result setParams(float aDelay, float aDecay = 0.7f, float aFilter = 0.0f); 68 | }; 69 | } 70 | 71 | #endif -------------------------------------------------------------------------------- /include/soloud_eqfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_EQFILTER_H 26 | #define SOLOUD_EQFILTER_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_fftfilter.h" 30 | 31 | namespace SoLoud 32 | { 33 | class EqFilter; 34 | 35 | class EqFilterInstance : public FFTFilterInstance 36 | { 37 | enum FILTERATTRIBUTE 38 | { 39 | WET = 0, 40 | BAND1 = 1, 41 | BAND2 = 2, 42 | BAND3 = 3, 43 | BAND4 = 4, 44 | BAND5 = 5, 45 | BAND6 = 6, 46 | BAND7 = 7, 47 | BAND8 = 8 48 | }; 49 | EqFilter *mParent; 50 | public: 51 | virtual void fftFilterChannel(float *aFFTBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 52 | EqFilterInstance(EqFilter *aParent); 53 | }; 54 | 55 | class EqFilter : public FFTFilter 56 | { 57 | public: 58 | enum FILTERATTRIBUTE 59 | { 60 | WET = 0, 61 | BAND1 = 1, 62 | BAND2 = 2, 63 | BAND3 = 3, 64 | BAND4 = 4, 65 | BAND5 = 5, 66 | BAND6 = 6, 67 | BAND7 = 7, 68 | BAND8 = 8 69 | }; 70 | virtual int getParamCount(); 71 | virtual const char* getParamName(unsigned int aParamIndex); 72 | virtual unsigned int getParamType(unsigned int aParamIndex); 73 | virtual float getParamMax(unsigned int aParamIndex); 74 | virtual float getParamMin(unsigned int aParamIndex); 75 | float mVolume[8]; 76 | result setParam(unsigned int aBand, float aVolume); 77 | virtual FilterInstance *createInstance(); 78 | EqFilter(); 79 | }; 80 | } 81 | 82 | #endif -------------------------------------------------------------------------------- /include/soloud_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2014 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | #ifndef SOLOUD_ERROR_H 25 | #define SOLOUD_ERROR_H 26 | 27 | namespace SoLoud 28 | { 29 | enum SOLOUD_ERRORS 30 | { 31 | SO_NO_ERROR = 0, // No error 32 | INVALID_PARAMETER = 1, // Some parameter is invalid 33 | FILE_NOT_FOUND = 2, // File not found 34 | FILE_LOAD_FAILED = 3, // File found, but could not be loaded 35 | DLL_NOT_FOUND = 4, // DLL not found, or wrong DLL 36 | OUT_OF_MEMORY = 5, // Out of memory 37 | NOT_IMPLEMENTED = 6, // Feature not implemented 38 | UNKNOWN_ERROR = 7 // Other error 39 | }; 40 | }; 41 | #endif -------------------------------------------------------------------------------- /include/soloud_fader.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2014 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FADER_H 26 | #define SOLOUD_FADER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | // Helper class to process faders 33 | class Fader 34 | { 35 | public: 36 | // Value to fade from 37 | float mFrom; 38 | // Value to fade to 39 | float mTo; 40 | // Delta between from and to 41 | float mDelta; 42 | // Total time to fade 43 | time mTime; 44 | // Time fading started 45 | time mStartTime; 46 | // Time fading will end 47 | time mEndTime; 48 | // Current value. Used in case time rolls over. 49 | float mCurrent; 50 | // Active flag; 0 means disabled, 1 is active, 2 is LFO, -1 means was active, but stopped 51 | int mActive; 52 | // Ctor 53 | Fader(); 54 | // Set up LFO 55 | void setLFO(float aFrom, float aTo, time aTime, time aStartTime); 56 | // Set up fader 57 | void set(float aFrom, float aTo, time aTime, time aStartTime); 58 | // Get the current fading value 59 | float get(time aCurrentTime); 60 | }; 61 | }; 62 | 63 | #endif -------------------------------------------------------------------------------- /include/soloud_fft.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FFT_H 26 | #define SOLOUD_FFT_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | namespace FFT 33 | { 34 | // Perform 1024 unit FFT. Buffer must have 1024 floats, and will be overwritten 35 | void fft1024(float *aBuffer); 36 | 37 | // Perform 256 unit FFT. Buffer must have 256 floats, and will be overwritten 38 | void fft256(float *aBuffer); 39 | 40 | // Perform 256 unit IFFT. Buffer must have 256 floats, and will be overwritten 41 | void ifft256(float *aBuffer); 42 | 43 | // Generic (slower) power of two FFT. Buffer is overwritten. 44 | void fft(float *aBuffer, unsigned int aBufferLength); 45 | 46 | // Generic (slower) power of two IFFT. Buffer is overwritten. 47 | void ifft(float *aBuffer, unsigned int aBufferLength); 48 | }; 49 | }; 50 | 51 | #endif -------------------------------------------------------------------------------- /include/soloud_fftfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FFTFILTER_H 26 | #define SOLOUD_FFTFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class FFTFilter; 33 | 34 | class FFTFilterInstance : public FilterInstance 35 | { 36 | float *mTemp; 37 | float *mInputBuffer; 38 | float *mMixBuffer; 39 | float *mLastPhase; 40 | float *mSumPhase; 41 | unsigned int mInputOffset[MAX_CHANNELS]; 42 | unsigned int mMixOffset[MAX_CHANNELS]; 43 | unsigned int mReadOffset[MAX_CHANNELS]; 44 | FFTFilter *mParent; 45 | public: 46 | virtual void fftFilterChannel(float *aFFTBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 47 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 48 | virtual ~FFTFilterInstance(); 49 | FFTFilterInstance(FFTFilter *aParent); 50 | FFTFilterInstance(); 51 | void comp2MagPhase(float* aFFTBuffer, unsigned int aSamples); 52 | void magPhase2MagFreq(float* aFFTBuffer, unsigned int aSamples, float aSamplerate, unsigned int aChannel); 53 | void magFreq2MagPhase(float* aFFTBuffer, unsigned int aSamples, float aSamplerate, unsigned int aChannel); 54 | void magPhase2Comp(float* aFFTBuffer, unsigned int aSamples); 55 | void init(); 56 | }; 57 | 58 | class FFTFilter : public Filter 59 | { 60 | public: 61 | virtual FilterInstance *createInstance(); 62 | FFTFilter(); 63 | }; 64 | } 65 | 66 | #endif -------------------------------------------------------------------------------- /include/soloud_file_hack_off.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | /* 26 | See soloud_file_hack_on.h 27 | */ 28 | 29 | #undef FILE 30 | #undef fgetc 31 | #undef fread 32 | #undef fseek 33 | #undef ftell 34 | #undef fclose 35 | #undef fopen 36 | #undef fopen_s 37 | -------------------------------------------------------------------------------- /include/soloud_file_hack_on.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | /* 26 | This is a "hack" header to fool third party code to use our File stuff instead 27 | of stdio FILE* stuff. 28 | You can use soloud_file_hack_off.h to undef the stuff defined here. 29 | */ 30 | 31 | #ifndef SEEK_SET 32 | #error soloud_file_hack_on must be included after stdio, otherwise the #define hacks will break stdio. 33 | #endif 34 | 35 | typedef void* Soloud_Filehack; 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | extern int Soloud_Filehack_fgetc(Soloud_Filehack *f); 42 | extern int Soloud_Filehack_fread(void *dst, int s, int c, Soloud_Filehack *f); 43 | extern int Soloud_Filehack_fseek(Soloud_Filehack *f, int idx, int base); 44 | extern int Soloud_Filehack_ftell(Soloud_Filehack *f); 45 | extern int Soloud_Filehack_fclose(Soloud_Filehack *f); 46 | extern Soloud_Filehack * Soloud_Filehack_fopen(const char *aFilename, char *aMode); 47 | extern int Soloud_Filehack_fopen_s(Soloud_Filehack **f, const char* aFilename, char* aMode); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #define FILE Soloud_Filehack 54 | #define fgetc Soloud_Filehack_fgetc 55 | #define fread Soloud_Filehack_fread 56 | #define fseek Soloud_Filehack_fseek 57 | #define ftell Soloud_Filehack_ftell 58 | #define fclose Soloud_Filehack_fclose 59 | #define fopen Soloud_Filehack_fopen 60 | #define fopen_s Soloud_Filehack_fopen_s 61 | -------------------------------------------------------------------------------- /include/soloud_flangerfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_FLANGERFILTER_H 26 | #define SOLOUD_FLANGERFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class FlangerFilter; 33 | 34 | class FlangerFilterInstance : public FilterInstance 35 | { 36 | float *mBuffer; 37 | unsigned int mBufferLength; 38 | FlangerFilter *mParent; 39 | unsigned int mOffset; 40 | double mIndex; 41 | 42 | public: 43 | virtual void filter(float *aBuffer, unsigned int aSamples, unsigned int aBufferSize, unsigned int aChannels, float aSamplerate, time aTime); 44 | virtual ~FlangerFilterInstance(); 45 | FlangerFilterInstance(FlangerFilter *aParent); 46 | }; 47 | 48 | class FlangerFilter : public Filter 49 | { 50 | public: 51 | enum FILTERPARAMS 52 | { 53 | WET, 54 | DELAY, 55 | FREQ 56 | }; 57 | float mDelay; 58 | float mFreq; 59 | virtual int getParamCount(); 60 | virtual const char* getParamName(unsigned int aParamIndex); 61 | virtual unsigned int getParamType(unsigned int aParamIndex); 62 | virtual float getParamMax(unsigned int aParamIndex); 63 | virtual float getParamMin(unsigned int aParamIndex); 64 | virtual FilterInstance *createInstance(); 65 | FlangerFilter(); 66 | result setParams(float aDelay, float aFreq); 67 | }; 68 | } 69 | 70 | #endif -------------------------------------------------------------------------------- /include/soloud_lofifilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_LOFIFILTER_H 26 | #define SOLOUD_LOFIFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class LofiFilter; 33 | 34 | struct LofiChannelData 35 | { 36 | float mSample; 37 | float mSamplesToSkip; 38 | }; 39 | 40 | class LofiFilterInstance : public FilterInstance 41 | { 42 | enum FILTERPARAMS 43 | { 44 | WET, 45 | SAMPLERATE, 46 | BITDEPTH 47 | }; 48 | LofiChannelData mChannelData[2]; 49 | 50 | LofiFilter *mParent; 51 | public: 52 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 53 | virtual ~LofiFilterInstance(); 54 | LofiFilterInstance(LofiFilter *aParent); 55 | }; 56 | 57 | class LofiFilter : public Filter 58 | { 59 | public: 60 | enum FILTERPARAMS 61 | { 62 | WET, 63 | SAMPLERATE, 64 | BITDEPTH 65 | }; 66 | float mSampleRate; 67 | float mBitdepth; 68 | virtual LofiFilterInstance *createInstance(); 69 | virtual int getParamCount(); 70 | virtual const char* getParamName(unsigned int aParamIndex); 71 | virtual unsigned int getParamType(unsigned int aParamIndex); 72 | virtual float getParamMax(unsigned int aParamIndex); 73 | virtual float getParamMin(unsigned int aParamIndex); 74 | LofiFilter(); 75 | result setParams(float aSampleRate, float aBitdepth); 76 | virtual ~LofiFilter(); 77 | }; 78 | } 79 | 80 | #endif -------------------------------------------------------------------------------- /include/soloud_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_MISC_H 26 | #define SOLOUD_MISC_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | namespace Misc 33 | { 34 | // Generate a waveform. 35 | float generateWaveform(int aWaveform, float p); 36 | 37 | // WELL512 random 38 | class Prg 39 | { 40 | public: 41 | // random generator 42 | Prg(); 43 | unsigned int mState[16]; 44 | unsigned int mIndex; 45 | unsigned int rand(); 46 | float rand_float(); 47 | void srand(int aSeed); 48 | }; 49 | 50 | }; 51 | }; 52 | 53 | #endif -------------------------------------------------------------------------------- /include/soloud_noise.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_NOISE_H 26 | #define SOLOUD_NOISE_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_misc.h" 30 | 31 | namespace SoLoud 32 | { 33 | class Noise; 34 | 35 | class NoiseInstance : public AudioSourceInstance 36 | { 37 | public: 38 | NoiseInstance(Noise *aParent); 39 | ~NoiseInstance(); 40 | 41 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 42 | virtual bool hasEnded(); 43 | 44 | public: 45 | float mOctaveScale[10]; 46 | Misc::Prg mPrg; 47 | }; 48 | 49 | class Noise : public AudioSource 50 | { 51 | public: 52 | 53 | enum NOISETYPES 54 | { 55 | WHITE = 0, 56 | PINK, 57 | BROWNISH, 58 | BLUEISH 59 | }; 60 | 61 | Noise(); 62 | 63 | void setOctaveScale(float aOct0, float aOct1, float aOct2, float aOct3, float aOct4, float aOct5, float aOct6, float aOct7, float aOct8, float aOct9); 64 | void setType(int aType); 65 | 66 | virtual ~Noise(); 67 | 68 | public: 69 | virtual AudioSourceInstance *createInstance(); 70 | float mOctaveScale[10]; 71 | }; 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /include/soloud_openmpt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Openmpt module for SoLoud audio engine 3 | Copyright (c) 2016 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef OPENMPT_H 26 | #define OPENMPT_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class Openmpt; 33 | class File; 34 | 35 | class OpenmptInstance : public AudioSourceInstance 36 | { 37 | Openmpt *mParent; 38 | void *mModfile; 39 | int mPlaying; 40 | 41 | public: 42 | OpenmptInstance(Openmpt *aParent); 43 | virtual ~OpenmptInstance(); 44 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 45 | virtual bool hasEnded(); 46 | }; 47 | 48 | class Openmpt : public AudioSource 49 | { 50 | public: 51 | char *mData; 52 | unsigned int mDataLen; 53 | Openmpt(); 54 | virtual ~Openmpt(); 55 | result load(const char* aFilename); 56 | result loadMem(const unsigned char *aMem, unsigned int aLength, bool aCopy = false, bool aTakeOwnership = true); 57 | result loadFile(File *aFile); 58 | virtual AudioSourceInstance *createInstance(); 59 | }; 60 | }; 61 | 62 | #endif -------------------------------------------------------------------------------- /include/soloud_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2018 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_QUEUE_H 26 | #define SOLOUD_QUEUE_H 27 | 28 | #include "soloud.h" 29 | 30 | #define SOLOUD_QUEUE_MAX 32 31 | 32 | namespace SoLoud 33 | { 34 | class Queue; 35 | 36 | class QueueInstance : public AudioSourceInstance 37 | { 38 | Queue *mParent; 39 | public: 40 | QueueInstance(Queue *aParent); 41 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 42 | virtual bool hasEnded(); 43 | virtual ~QueueInstance(); 44 | }; 45 | 46 | class Queue : public AudioSource 47 | { 48 | public: 49 | Queue(); 50 | virtual QueueInstance *createInstance(); 51 | // Play sound through the queue 52 | result play(AudioSource &aSound); 53 | // Number of audio sources queued for replay 54 | unsigned int getQueueCount(); 55 | // Is this audio source currently playing? 56 | bool isCurrentlyPlaying(AudioSource &aSound); 57 | // Set params by reading them from an audio source 58 | result setParamsFromAudioSource(AudioSource &aSound); 59 | // Set params manually 60 | result setParams(float aSamplerate, unsigned int aChannels = 2); 61 | 62 | public: 63 | unsigned int mReadIndex, mWriteIndex, mCount; 64 | AudioSourceInstance *mSource[SOLOUD_QUEUE_MAX]; 65 | QueueInstance *mInstance; 66 | handle mQueueHandle; 67 | void findQueueHandle(); 68 | 69 | }; 70 | }; 71 | 72 | #endif -------------------------------------------------------------------------------- /include/soloud_robotizefilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2020 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_ROBOTIZEFILTER_H 26 | #define SOLOUD_ROBOTIZEFILTER_H 27 | 28 | #include "soloud.h" 29 | #include "soloud_filter.h" 30 | #include "soloud_misc.h" 31 | 32 | namespace SoLoud 33 | { 34 | class RobotizeFilter; 35 | 36 | class RobotizeFilterInstance : public FilterInstance 37 | { 38 | enum FILTERATTRIBUTE 39 | { 40 | WET = 0, 41 | FREQ, 42 | WAVE 43 | }; 44 | RobotizeFilter *mParent; 45 | public: 46 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 47 | RobotizeFilterInstance(RobotizeFilter *aParent); 48 | }; 49 | 50 | class RobotizeFilter : public Filter 51 | { 52 | public: 53 | enum FILTERATTRIBUTE 54 | { 55 | WET = 0, 56 | FREQ, 57 | WAVE 58 | }; 59 | float mFreq; 60 | int mWave; 61 | virtual int getParamCount(); 62 | virtual const char* getParamName(unsigned int aParamIndex); 63 | virtual unsigned int getParamType(unsigned int aParamIndex); 64 | virtual float getParamMax(unsigned int aParamIndex); 65 | virtual float getParamMin(unsigned int aParamIndex); 66 | void setParams(float aFreq, int aWaveform); 67 | virtual FilterInstance *createInstance(); 68 | RobotizeFilter(); 69 | }; 70 | } 71 | 72 | #endif -------------------------------------------------------------------------------- /include/soloud_tedsid.h: -------------------------------------------------------------------------------- 1 | /* 2 | TED/SID module for SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef TEDSID_H 26 | #define TEDSID_H 27 | 28 | #include "soloud.h" 29 | 30 | class SIDsound; 31 | class TED; 32 | 33 | namespace SoLoud 34 | { 35 | class TedSid; 36 | class File; 37 | 38 | class TedSidInstance : public AudioSourceInstance 39 | { 40 | TedSid *mParent; 41 | SIDsound *mSID; 42 | TED *mTED; 43 | int mPos; 44 | unsigned int mSampleCount; 45 | int mRegValues[128]; 46 | public: 47 | 48 | TedSidInstance(TedSid *aParent); 49 | ~TedSidInstance(); 50 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 51 | virtual void tick(); 52 | virtual bool hasEnded(); 53 | virtual float getInfo(unsigned int aInfoKey); 54 | }; 55 | 56 | class TedSid : public AudioSource 57 | { 58 | public: 59 | int mLooppos; 60 | int mLength; 61 | unsigned short* mOps; 62 | int mModel; 63 | TedSid(); 64 | ~TedSid(); 65 | result load(const char *aFilename); 66 | result loadMem(const unsigned char *aMem, unsigned int aLength, bool aCopy = false, bool aTakeOwnership = true); 67 | result loadFile(File *aFile); 68 | virtual AudioSourceInstance *createInstance(); 69 | }; 70 | }; 71 | 72 | #endif -------------------------------------------------------------------------------- /include/soloud_vizsn.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2018 Jari Komppa 4 | 5 | vizsn speech synthesizer (c) by Ville-Matias Heikkilä, 6 | released under WTFPL, http://www.wtfpl.net/txt/copying/ 7 | (in short, "do whatever you want to") 8 | 9 | Integration and changes to work with SoLoud by Jari Komppa, 10 | released under same license. 11 | */ 12 | 13 | #ifndef SOLOUD_VIZSN_H 14 | #define SOLOUD_VIZSN_H 15 | 16 | #include "soloud.h" 17 | 18 | namespace SoLoud 19 | { 20 | class Vizsn; 21 | 22 | struct VizsnResonator 23 | { 24 | public: 25 | float a, b, c, p1, p2; 26 | 27 | float resonate(float i); 28 | float antiresonate(float i); 29 | VizsnResonator(); 30 | }; 31 | 32 | struct VizsnBank 33 | { 34 | VizsnResonator r[10]; 35 | float pitch; 36 | float frica, voice, aspir, bypas, breth; 37 | VizsnBank(); 38 | }; 39 | 40 | class VizsnInstance : public AudioSourceInstance 41 | { 42 | public: 43 | VizsnInstance(Vizsn *aParent); 44 | ~VizsnInstance(); 45 | 46 | virtual unsigned int getAudio(float *aBuffer, unsigned int aSamplesToRead, unsigned int aBufferSize); 47 | virtual bool hasEnded(); 48 | 49 | public: 50 | Vizsn *mParent; 51 | VizsnBank mBank0, mBank1, mBank0to1; 52 | int mNper, mNmod, mNopen; 53 | int mEchobuf[1024], mPtr; 54 | int mCurrentVoiceType; 55 | float mPitch; 56 | char *mS; 57 | float mBuf[2048]; 58 | unsigned int mBufwrite; 59 | unsigned int mBufread; 60 | float vcsrc(int aPitch, int aVoicetype); 61 | float noisrc(); 62 | float genwave(); 63 | void setphone(VizsnBank *aB, char aP, float aPitch); 64 | void slidePrepare(int aNumtix); 65 | void slideTick(); 66 | int mA; 67 | int mB; 68 | int mOrgv; 69 | float mGlotlast; 70 | }; 71 | 72 | class Vizsn : public AudioSource 73 | { 74 | public: 75 | char *mText; 76 | Vizsn(); 77 | virtual ~Vizsn(); 78 | void setText(char *aText); 79 | public: 80 | virtual AudioSourceInstance *createInstance(); 81 | }; 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /include/soloud_waveshaperfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2018 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #ifndef SOLOUD_WAVESHAPERFILTER_H 26 | #define SOLOUD_WAVESHAPERFILTER_H 27 | 28 | #include "soloud.h" 29 | 30 | namespace SoLoud 31 | { 32 | class WaveShaperFilter; 33 | 34 | class WaveShaperFilterInstance : public FilterInstance 35 | { 36 | WaveShaperFilter *mParent; 37 | public: 38 | virtual void filterChannel(float *aBuffer, unsigned int aSamples, float aSamplerate, time aTime, unsigned int aChannel, unsigned int aChannels); 39 | virtual ~WaveShaperFilterInstance(); 40 | WaveShaperFilterInstance(WaveShaperFilter *aParent); 41 | }; 42 | 43 | class WaveShaperFilter : public Filter 44 | { 45 | public: 46 | enum FILTERPARAMS { 47 | WET = 0, 48 | AMOUNT 49 | }; 50 | float mAmount; 51 | virtual WaveShaperFilterInstance *createInstance(); 52 | result setParams(float aAmount); 53 | WaveShaperFilter(); 54 | virtual ~WaveShaperFilter(); 55 | virtual int getParamCount(); 56 | virtual const char* getParamName(unsigned int aParamIndex); 57 | virtual unsigned int getParamType(unsigned int aParamIndex); 58 | virtual float getParamMax(unsigned int aParamIndex); 59 | virtual float getParamMin(unsigned int aParamIndex); 60 | }; 61 | } 62 | 63 | #endif -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | > Expected behavior: 2 | 3 | 4 | > Actual behavior: 5 | 6 | 7 | > Steps to reproduce the problem: 8 | 9 | 10 | > SoLoud version, operating system, backend used, any other potentially useful information: 11 | 12 | 13 | [//]: # ( You don't need to follow the above template if you do not want to; feel free to start from scratch. ) 14 | [//]: # ( Following the template leads to problem reports that are helpful to the developers. ) 15 | [//]: # ( ...yes, this weird syntax is how one writes comments in a markdown file ) 16 | -------------------------------------------------------------------------------- /scripts/checkapidoc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ Complains if some API call is not documented """ 3 | 4 | import soloud_codegen 5 | import glob 6 | import os 7 | 8 | def checkfile(apifunc, fname): 9 | """ Checks whether the string can be found in a file """ 10 | if apifunc in open(fname).read(): 11 | #print("; " + apifunc + " found in " + fname) 12 | return True 13 | return False 14 | 15 | def checkfiles(apifunc): 16 | """ Goes through all multimarkdown files in doc dir and passes 17 | them to checkfile. If found, early out. 18 | """ 19 | for file in glob.glob("../docsrc/*.mmd"): 20 | if checkfile(apifunc, file): 21 | return True 22 | return False 23 | 24 | print("Checking for undocumented APIs..") 25 | print() 26 | 27 | found = 0 28 | total = 0 29 | 30 | for func in soloud_codegen.soloud_func: 31 | apifunc = func[1].replace("_",".") 32 | if ((apifunc[-2::] != "Ex") and 33 | (apifunc[-7::] != "destroy") and 34 | (apifunc[-6::] != "create")): 35 | total += 1 36 | if not checkfiles(apifunc + "()"): 37 | print(apifunc) 38 | found += 1 39 | 40 | if found == 0: 41 | print("All good! (" + str(total) + ", not counting ctor/dtor/ex)") 42 | else: 43 | print() 44 | print(str(found) + " / " + str(total) + " APIs undocumented. Get to work!") 45 | print("(not counting ctor/dtor/ex variants)") 46 | -------------------------------------------------------------------------------- /scripts/checksanity.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ Complains if some API call is not tested """ 3 | 4 | import soloud_codegen 5 | import glob 6 | import os 7 | 8 | def checkfile(apifunc, fname): 9 | """ Checks whether the string can be found in a file """ 10 | if apifunc in open(fname).read(): 11 | # print(apifunc + " found in " + fname) 12 | return True 13 | return False 14 | 15 | def checkfiles(apifunc): 16 | """ Goes through all sources files in sanity dir and passes 17 | them to checkfile. If found, early out. 18 | """ 19 | for file in glob.glob("../src/tools/sanity/*.cpp"): 20 | if checkfile(apifunc, file): 21 | return True 22 | for file in glob.glob("../src/tools/sanity/*.h"): 23 | if checkfile(apifunc, file): 24 | return True 25 | return False 26 | 27 | print("Checking for untested APIs..") 28 | print() 29 | 30 | found = 0 31 | total = 0 32 | 33 | for func in soloud_codegen.soloud_func: 34 | apifunc = func[1].replace("_",".") 35 | if ((apifunc[-2::] != "Ex") and 36 | (apifunc[-7::] != "destroy")): 37 | if (apifunc[-6::] == "create"): 38 | apifunc = "SoLoud::" + apifunc[:-7:] 39 | total += 1 40 | if not checkfiles(apifunc): 41 | print(apifunc) 42 | found += 1 43 | 44 | if found == 0: 45 | print("All good! (" + str(total) + ", not counting ctor/dtor/ex)") 46 | else: 47 | print() 48 | print(str(found) + " / " + str(total) + " APIs untested. Get to work!") 49 | print("(not counting ctor/dtor/ex variants)") 50 | -------------------------------------------------------------------------------- /scripts/compile_gamemaker_dll.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | call vcvars32.bat 3 | cl /LD /MT /Ox /nologo soloud_gamemaker_dll.c soloud_gamemaker_dll.def user32.lib 4 | -------------------------------------------------------------------------------- /scripts/gen_autoit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # AutoIt wrapper generator 3 | 4 | from soloud_codegen import * 5 | 6 | fo = open("soloud.au3", "w") 7 | 8 | """ 9 | Global $dll = DllOpen(@ScriptDir & "\soloud.dll") 10 | 11 | Const $CONSTANT = 1234567890 12 | 13 | 14 | 15 | Func _SoLoud_method($param1, $param2, $paramN) 16 | Local $ret = DllCall($dll, "return type e.g. int", "function", "type1 if necessary", "param1 if necessary", "typeN if necessary", "paramN if necessary") 17 | If @error Then Return SetError(1, 1, 0) 18 | Return $ret[0] 19 | EndFunc 20 | """ 21 | 22 | fo.write("; SoLoud wrapper for AutoIt\n") 23 | fo.write("; This file is autogenerated; any changes will be overwritten\n") 24 | fo.write('Global $dll = DllOpen(@ScriptDir & "\\soloud_x86.dll")\n') 25 | fo.write("\n") 26 | fo.write("; Enumerations\n") 27 | for x in soloud_enum: 28 | fo.write("Const $" + x + " = " + str(soloud_enum[x]) + "\n") 29 | fo.write("\n") 30 | fo.write("; Functions\n") 31 | for x in soloud_func: 32 | funcdef = "Func _" + x[1] + "(" 33 | first = True; 34 | for p in x[2]: 35 | if len(p) > 0: 36 | if not first: 37 | funcdef += ", " 38 | else: 39 | first = False 40 | funcdef += "$" + p[1] 41 | funcdef += ")" 42 | 43 | calldef = "\tLocal $ret = DllCall($dll, " 44 | calldef += '"' + x[0] + '", ' # return type 45 | calldef += '"' + x[1] + '"' 46 | 47 | for p in x[2]: 48 | if len(p) > 0: 49 | calldef += ', "' + p[0] + '", "' + p[1] + '"' 50 | calldef += ')' 51 | 52 | fo.write(funcdef + "\n") 53 | fo.write(calldef + "\n") 54 | fo.write('\tIf @error Then Return SetError(1, 1, 0)\n') 55 | fo.write('\tReturn $ret[0]\n') 56 | fo.write('EndFunc\n') 57 | fo.write("\n") 58 | 59 | fo.close() 60 | print("soloud.au3 generated") 61 | -------------------------------------------------------------------------------- /scripts/gen_blitzmax.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # BlitzMax wrapper generator 3 | # Thanks to James Boyd for help with this! 4 | 5 | import soloud_codegen 6 | 7 | fo = open("../glue/soloud.bmx", "w") 8 | 9 | """ 10 | Global SoloudLib:Int = LoadLibraryA ("soloud_x86.dll") 11 | 12 | If not SoloudLib Then Notify "soloud_x86.dll not found"; End 13 | 14 | Const SFXR_BLIP:Int = 6 15 | 16 | Global Soloud_destroy:Int (aSoloud:Byte Ptr) "win32" = GetProcAddress (SoloudLib, "Soloud_destroy") 17 | 18 | """ 19 | 20 | C_TO_BMX_TYPES = { 21 | "int":"Int", 22 | "void":"Int", 23 | "const char *":"Byte Ptr", 24 | "const unsigned char *":"Byte Ptr", 25 | "unsigned int":"Int", 26 | "float":"Float", 27 | "double":"Double", 28 | "float *":"Float Ptr", 29 | "File *":"Byte Ptr", 30 | "unsigned char *":"Byte Ptr", 31 | "char *":"Byte Ptr", 32 | "unsigned char":"Byte", 33 | "short *":"Byte Ptr" 34 | } 35 | 36 | for soloud_type in soloud_codegen.soloud_type: 37 | C_TO_BMX_TYPES[soloud_type + " *"] = "Byte Ptr" 38 | 39 | fo.write("' SoLoud wrapper for BlitzMax\n") 40 | fo.write("' This file is autogenerated; any changes will be overwritten\n") 41 | fo.write("\n") 42 | fo.write('Global SoloudLib:Int = LoadLibraryA ("soloud_x86.dll")\n') 43 | fo.write('If not SoloudLib Then Notify "soloud_x86.dll not found"; End\n') 44 | fo.write("\n") 45 | fo.write("' Enumerations\n") 46 | for x in soloud_codegen.soloud_enum: 47 | fo.write("Const " + x + ":Int = " + str(soloud_codegen.soloud_enum[x]) + "\n") 48 | fo.write("\n") 49 | fo.write("' Functions\n") 50 | for x in soloud_codegen.soloud_func: 51 | funcdef = "Global " + x[1] + ":" + C_TO_BMX_TYPES[x[0]] + " (" 52 | first = True; 53 | for p in x[2]: 54 | if len(p) > 0: 55 | if not first: 56 | funcdef += ", " 57 | else: 58 | first = False 59 | funcdef += p[1] + ":" + C_TO_BMX_TYPES[p[0]] 60 | funcdef += ")" 61 | funcdef += ' "win32" = GetProcAddress (SoloudLib, "'+x[1]+'")' 62 | fo.write(funcdef + "\n") 63 | 64 | fo.close() 65 | print("soloud.bmx generated") 66 | -------------------------------------------------------------------------------- /scripts/make_gmez.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | del soloud.gmez 3 | cd gm_temp 4 | 7z a -r -y ../../glue/soloud.gmez * 5 | cd .. 6 | rd /s /q gm_temp 7 | del soloud_gamemaker_dll.* 8 | del soloud.extension.gmx 9 | -------------------------------------------------------------------------------- /scripts/makeglue.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import glob 3 | import subprocess 4 | 5 | for file in glob.glob("gen_*.py"): 6 | subprocess.call(["python",file]) 7 | 8 | -------------------------------------------------------------------------------- /scripts/readme.txt: -------------------------------------------------------------------------------- 1 | The 'codegen' tool can be used to parse SoLoud headers and generate the 2 | soloud_codegen.py file. 3 | 4 | This file can then be used to generate various "glue" code for non-c 5 | environments. 6 | -------------------------------------------------------------------------------- /soloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jarikomppa/soloud/e82fd32c1f62183922f08c14c814a02b58db1873/soloud.png -------------------------------------------------------------------------------- /src/audiosource/ay/chipplayer.h: -------------------------------------------------------------------------------- 1 | #ifndef _CHIPPLAYER_H_INCLUDED 2 | #define _CHIPPLAYER_H_INCLUDED 3 | 4 | #include "sndchip.h" 5 | 6 | namespace SoLoud 7 | { 8 | class AyInstance; 9 | } 10 | 11 | class ChipPlayer 12 | { 13 | public: 14 | 15 | // play next song chunk to buffer 16 | unsigned play(float *dst, unsigned need_samples); 17 | 18 | // for internal use by ChipSong class 19 | void set_timings(unsigned system_clock_rate, unsigned chip_clock_rate, unsigned sample_rate); 20 | void set_volumes(SNDCHIP::CHIP_TYPE t, unsigned global_vol, const SNDCHIP_VOLTAB *vt, const SNDCHIP_PANTAB *pt); 21 | 22 | ChipPlayer(SoLoud::AyInstance *aInstance); 23 | ~ChipPlayer(); 24 | 25 | //private: 26 | SoLoud::AyInstance *mInstance; 27 | SNDBUFFER buffer; 28 | SNDCHIP chip; 29 | SNDCHIP chip2; 30 | 31 | 32 | unsigned locate(unsigned tick); 33 | unsigned playtick; 34 | unsigned playpos; 35 | unsigned system_clock_rate; 36 | unsigned ticks_per_buffer; 37 | 38 | unsigned get_time(unsigned tick); 39 | }; 40 | 41 | #endif // _CHIPPLAYER_H_INCLUDED 42 | -------------------------------------------------------------------------------- /src/audiosource/ay/readme.txt: -------------------------------------------------------------------------------- 1 | The AY sound support is based on public domain zxssk library 2 | "created under public domain license by SMT, jan.2006" 3 | -------------------------------------------------------------------------------- /src/audiosource/ay/sndbuffer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "sndbuffer.h" 3 | #include "sndrender.h" 4 | #include 5 | 6 | SNDBUFFER::SNDBUFFER(unsigned aSize) { 7 | read_position = 0; 8 | samples_ready = 0; 9 | // size must be power of 2 for faster calc cyclic position: pos = (pos+1) & (size-1) 10 | if (aSize & (aSize-1)) { 11 | unsigned i = 1; 12 | while (i < aSize) i *= 2; 13 | aSize = i; 14 | } 15 | SNDBUFFER::size = aSize; 16 | buffer = (SNDSAMPLE*)malloc(aSize * sizeof(SNDSAMPLE)); 17 | reset(); 18 | } 19 | 20 | SNDBUFFER::~SNDBUFFER() 21 | { 22 | free(buffer); 23 | } 24 | 25 | void SNDBUFFER::reset() 26 | { 27 | read_position = 0; 28 | memset(buffer, 0, size * sizeof(SNDSAMPLE)); 29 | } 30 | 31 | void SNDBUFFER::get_buffers(bufptr_t& pos1, unsigned& size1, bufptr_t& pos2, unsigned& size2, unsigned count) 32 | { 33 | pos1 = read_position; 34 | pos2 = 0; 35 | size1 = size - read_position; 36 | if (count < size1) { 37 | size1 = count; 38 | size2 = 0; 39 | } else { 40 | size2 = count-size1; 41 | } 42 | } 43 | 44 | void SNDBUFFER::samples_read(unsigned count) 45 | { 46 | unsigned size1, size2, pos1, pos2; 47 | get_buffers(pos1, size1, pos2, size2, count); 48 | memset(buffer + pos1, 0, size1 * sizeof(SNDSAMPLE)); 49 | if (size2) { 50 | memset(buffer + pos2, 0, size2 * sizeof(SNDSAMPLE)); 51 | } 52 | read_position = (read_position + count) & (size-1); 53 | } 54 | 55 | void SNDBUFFER::count_start() 56 | { 57 | samples_ready = size; 58 | } 59 | 60 | unsigned SNDBUFFER::count_single(const SNDRENDER& render) 61 | { 62 | return (render.dstpos - read_position) & (size-1); 63 | } 64 | 65 | void SNDBUFFER::count(const SNDRENDER& render) 66 | { 67 | unsigned samples = count_single(render); 68 | if (samples < samples_ready) samples_ready = samples; 69 | } 70 | 71 | unsigned SNDBUFFER::count_end() 72 | { 73 | return samples_ready; 74 | } 75 | -------------------------------------------------------------------------------- /src/audiosource/ay/sndbuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union SNDSAMPLE 4 | { 5 | unsigned sample; // left/right channels in low/high WORDs 6 | struct { unsigned short left, right; } ch; // or left/right separately 7 | }; 8 | 9 | typedef unsigned bufptr_t; 10 | class SNDRENDER; 11 | 12 | class SNDBUFFER 13 | { 14 | public: 15 | SNDBUFFER(unsigned size); 16 | ~SNDBUFFER(); 17 | 18 | void reset(); 19 | 20 | SNDSAMPLE* buffer; 21 | bufptr_t size; 22 | 23 | void count_start(); 24 | void count(const SNDRENDER& render); 25 | unsigned count_end(); 26 | 27 | unsigned count_single(const SNDRENDER& render); 28 | void get_buffers(bufptr_t& pos1, unsigned& size1, bufptr_t& pos2, unsigned& size2, unsigned count); 29 | 30 | // can read some samples starting from here, use count_start(), count(), count_end() to detect count of samples ready 31 | bufptr_t read_position; 32 | 33 | // called when application read `counts` samples from `read_position` 34 | // SNDBUFFER needs to zero buffer under read samples to continue mixing 35 | void samples_read(unsigned count); 36 | 37 | private: 38 | unsigned samples_ready; 39 | }; 40 | 41 | 42 | 43 | 44 | #if 0 // USAGE EXAMPLE 45 | 46 | #include "sndrender/*.h" 47 | 48 | SNDBUFFER buf(4096); 49 | SNDCHIP ay1(buf), ay2(buf); 50 | SNDRENDER beeper(buf); 51 | 52 | // global emulation loop 53 | for (;;) { 54 | ay1.start_frame(); 55 | ay2.start_frame(); 56 | beeper.start_frame(); 57 | 58 | // Z80 emulation before INT 59 | for (int t = 0; t < 71680; t++) { 60 | ay1.select(0); 61 | ay1.write(t, t % 100); 62 | ay2.select(3); 63 | ay2.write(t, t % 100); 64 | beeper.update(t, t % 4000, t % 400); 65 | } 66 | ay1.end_frame(t); 67 | ay2.end_frame(t); 68 | beeper.end_frame(t); 69 | 70 | buf.count_start(); 71 | buf.count(ay1); 72 | buf.count(ay2); 73 | buf.count(beeper); 74 | unsigned n_samples = buf.count_end(); 75 | 76 | bufptr_t pos1, pos2; 77 | unsigned size1, size2; 78 | buf.get_buffers(pos1, size1, pos2, size2, n_samples); 79 | 80 | wav_play(buf.buffer+pos1, size1); 81 | wav_play(buf.buffer+pos2, size2); 82 | buf.samples_read(n_samples); 83 | } 84 | 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /src/audiosource/ay/sndrender.h: -------------------------------------------------------------------------------- 1 | /* 2 | sound resampling core for Unreal Speccy project 3 | created under public domain license by SMT, jan.2006 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "sndbuffer.h" 9 | 10 | struct SNDOUT; 11 | 12 | const unsigned SNDR_DEFAULT_SYSTICK_RATE = 3500000; // ZX-Spectrum Z80 clock 13 | const unsigned SNDR_DEFAULT_SAMPLE_RATE = 44100; 14 | 15 | class SNDRENDER 16 | { 17 | public: 18 | SNDRENDER(SNDBUFFER& sndbuffer); 19 | 20 | void set_timings(unsigned sys_clock_rate, unsigned sample_rate); 21 | 22 | // 'render' is a function that converts array of DAC inputs into PCM-buffer 23 | void render(SNDOUT *src, unsigned srclen, unsigned sys_ticks); 24 | 25 | // set of functions that fills buffer in emulation progress: 26 | 27 | // when called, we assume that sys_tick reset to 0 28 | void start_frame(); 29 | // system writes to DAC at given sys_tick 30 | void update(unsigned sys_tick, unsigned l, unsigned r); 31 | // emulate non-changed DAC value until end of frame 32 | void end_frame(unsigned endframe_sys_tick); 33 | 34 | protected: 35 | 36 | friend class SNDBUFFER; // access to dstpos in count() 37 | SNDBUFFER& sndbuffer; 38 | 39 | unsigned mix_l, mix_r; // current L/R volume values 40 | bufptr_t dstpos; // write position 41 | bufptr_t dst_start; // write position at start of frame. used to track count of samples in frame 42 | 43 | private: 44 | // local copies of sndbuffer params (for speed) 45 | SNDSAMPLE* buffer; 46 | unsigned bufsize; 47 | 48 | unsigned tick, base_tick; 49 | unsigned s1_l, s1_r; 50 | unsigned s2_l, s2_r; 51 | 52 | unsigned sys_clock_rate, sample_rate; 53 | unsigned passed_sys_ticks, passed_snd_ticks; 54 | unsigned mult_const; 55 | 56 | void flush(unsigned endtick); 57 | }; 58 | 59 | struct SNDOUT 60 | { 61 | unsigned timestamp; // in 'system clock' ticks 62 | SNDSAMPLE newvalue; 63 | }; 64 | -------------------------------------------------------------------------------- /src/audiosource/speech/darray.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "darray.h" 4 | 5 | darray::darray() 6 | { 7 | mAllocChunk = 128; 8 | mAllocated = mUsed = 0; 9 | mData = NULL; 10 | } 11 | 12 | void darray::clear() 13 | { 14 | free(mData); 15 | mAllocChunk = 128; 16 | mAllocated = mUsed = 0; 17 | mData = NULL; 18 | } 19 | 20 | darray::~darray() 21 | { 22 | clear(); 23 | } 24 | 25 | char * darray::getDataInPos(int aPosition) 26 | { 27 | if (aPosition < mAllocated && aPosition < mUsed) 28 | return mData + aPosition; 29 | 30 | if (aPosition >= mAllocated) 31 | { 32 | int newsize = mAllocated; 33 | 34 | while (newsize <= aPosition) 35 | { 36 | newsize += mAllocChunk; 37 | mAllocChunk *= 2; 38 | } 39 | 40 | char *newdata = (char*)realloc(mData, newsize); 41 | if (!newdata) 42 | { 43 | free(mData); 44 | mData = NULL; 45 | mAllocated = mUsed = 0; 46 | return NULL; 47 | } 48 | else 49 | { 50 | memset(newdata + mAllocated, 0, newsize - mAllocated); 51 | } 52 | 53 | mData = newdata; 54 | mAllocated = newsize; 55 | } 56 | 57 | if (aPosition >= mUsed) 58 | { 59 | mUsed = aPosition + 1; 60 | } 61 | 62 | return mData + aPosition; 63 | } 64 | 65 | void darray::put(int aData) 66 | { 67 | char *s = getDataInPos(mUsed); 68 | 69 | *s = (char)aData; 70 | } 71 | -------------------------------------------------------------------------------- /src/audiosource/speech/darray.h: -------------------------------------------------------------------------------- 1 | #if !defined(DARRAY_H) 2 | #define DARRAY_H 3 | 4 | class darray 5 | { 6 | protected: 7 | char *mData; 8 | int mUsed; 9 | int mAllocated; 10 | int mAllocChunk; 11 | public: 12 | darray(); 13 | ~darray(); 14 | void clear(); 15 | char *getDataInPos(int aPosition); 16 | void put(int aData); 17 | int getSize() const { return mUsed; } 18 | char *getData() { return mData; } 19 | }; 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /src/audiosource/speech/legal_readme.txt: -------------------------------------------------------------------------------- 1 | The speech synth is based on rsynth by the late 2 | Nick Ing-Simmons (et al). 3 | 4 | He described the legal status as: 5 | 6 | This is a text to speech system produced by 7 | integrating various pieces of code and tables 8 | of data, which are all (I believe) in the 9 | public domain. 10 | 11 | Since then, the rsynth source code has passed legal 12 | checks by several open source organizations, so it 13 | "should" be pretty safe. 14 | 15 | The primary copyright claims seem to have to do 16 | with text-to-speech dictionary use, which I've 17 | removed completely. 18 | 19 | I've done some serious refactoring, clean-up and 20 | feature removal on the source, as all I need is 21 | "a" free, simple speech synth, not a "good" 22 | speech synth. Since I've removed a bunch of stuff, 23 | this is probably safer public domain release 24 | than the original. 25 | 26 | (I'm rather surprised there's no good public domain 27 | speech synths out there; after all, it's 2013..) 28 | 29 | I'm placing my changes in public domain as well, 30 | or if that's not acceptable for you, then CC0: 31 | http://creativecommons.org/publicdomain/zero/1.0/ 32 | 33 | The SoLoud interface files (soloud_speech.*) are 34 | under ZLib/LibPNG license. 35 | 36 | -- Jari Komppa 37 | 2013 38 | -------------------------------------------------------------------------------- /src/audiosource/speech/resonator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "resonator.h" 3 | 4 | #ifndef PI 5 | #define PI 3.1415926535897932384626433832795f 6 | #endif 7 | 8 | /* Convert formant freqencies and bandwidth into resonator difference equation coefficents 9 | */ 10 | void resonator::initResonator( 11 | int aFrequency, /* Frequency of resonator in Hz */ 12 | int aBandwidth, /* Bandwidth of resonator in Hz */ 13 | int aSamplerate) 14 | { 15 | float arg = (-PI / aSamplerate) * aBandwidth; 16 | float r = (float)exp(arg); 17 | mC = -(r * r); 18 | arg = (-2.0f * PI / aSamplerate) * aFrequency; 19 | mB = r * (float)cos(arg) * 2.0f; 20 | mA = 1.0f - mB - mC; 21 | } 22 | 23 | /* Convert formant freqencies and bandwidth into anti-resonator difference equation constants 24 | */ 25 | void resonator::initAntiresonator( 26 | int aFrequency, /* Frequency of resonator in Hz */ 27 | int aBandwidth, /* Bandwidth of resonator in Hz */ 28 | int aSamplerate) 29 | { 30 | initResonator(aFrequency, aBandwidth, aSamplerate); /* First compute ordinary resonator coefficients */ 31 | /* Now convert to antiresonator coefficients */ 32 | mA = 1.0f / mA; /* a'= 1/a */ 33 | mB *= -mA; /* b'= -b/a */ 34 | mC *= -mA; /* c'= -c/a */ 35 | } 36 | 37 | /* Generic resonator function */ 38 | float resonator::resonate(float input) 39 | { 40 | float x = mA * input + mB * mP1 + mC * mP2; 41 | mP2 = mP1; 42 | mP1 = x; 43 | return x; 44 | } 45 | 46 | /* Generic anti-resonator function 47 | Same as resonator except that a,b,c need to be set with initAntiresonator() 48 | and we save inputs in p1/p2 rather than outputs. 49 | There is currently only one of these - "mNasalZero" 50 | */ 51 | /* Output = (mNasalZero.a * input) + (mNasalZero.b * oldin1) + (mNasalZero.c * oldin2) */ 52 | 53 | float resonator::antiresonate(float input) 54 | { 55 | float x = mA * input + mB * mP1 + mC * mP2; 56 | mP2 = mP1; 57 | mP1 = input; 58 | return x; 59 | } 60 | 61 | resonator::resonator() 62 | { 63 | mA = mB = mC = mP1 = mP2 = 0; 64 | } 65 | 66 | resonator::~resonator() 67 | { 68 | } 69 | 70 | void resonator::setGain(float aG) 71 | { 72 | mA *= aG; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /src/audiosource/speech/resonator.h: -------------------------------------------------------------------------------- 1 | #ifndef RESONATOR_H 2 | #define RESONATOR_H 3 | 4 | class resonator 5 | { 6 | float mA, mB, mC, mP1, mP2; 7 | public: 8 | 9 | /* Convert formant freqencies and bandwidth into resonator difference equation coefficents 10 | */ 11 | void initResonator( 12 | int aFrequency, /* Frequency of resonator in Hz */ 13 | int aBandwidth, /* Bandwidth of resonator in Hz */ 14 | int aSamplerate); 15 | 16 | /* Convert formant freqencies and bandwidth into anti-resonator difference equation constants 17 | */ 18 | void initAntiresonator( 19 | int aFrequency, /* Frequency of resonator in Hz */ 20 | int aBandwidth, /* Bandwidth of resonator in Hz */ 21 | int aSamplerate); 22 | 23 | /* Set gain */ 24 | void setGain(float aG); 25 | 26 | /* Generic resonator function */ 27 | float resonate(float input); 28 | 29 | /* Generic anti-resonator function 30 | Same as resonator except that a,b,c need to be set with initAntiresonator() 31 | and we save inputs in p1/p2 rather than outputs. 32 | There is currently only one of these - "mNasalZero" 33 | 34 | Output = (mNasalZero.a * input) + (mNasalZero.b * oldin1) + (mNasalZero.c * oldin2) 35 | */ 36 | 37 | float antiresonate(float input); 38 | 39 | resonator(); 40 | 41 | ~resonator(); 42 | }; 43 | 44 | #endif -------------------------------------------------------------------------------- /src/audiosource/speech/tts.h: -------------------------------------------------------------------------------- 1 | 2 | extern int xlate_string (const char *string,darray *phone); 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/audiosource/tedsid/readme.txt: -------------------------------------------------------------------------------- 1 | The TED / SID support is based on tedplay (c) 2012 Attila Grosz, used under Unlicense http://unlicense.org/ 2 | -------------------------------------------------------------------------------- /src/audiosource/tedsid/ted.h: -------------------------------------------------------------------------------- 1 | 2 | class TED 3 | { 4 | public: 5 | unsigned int masterVolume; 6 | int Volume; 7 | int Snd1Status; 8 | int Snd2Status; 9 | int SndNoiseStatus; 10 | int DAStatus; 11 | unsigned short Freq1; 12 | unsigned short Freq2; 13 | int NoiseCounter; 14 | int FlipFlop[2]; 15 | int dcOutput[2]; 16 | int oscCount[2]; 17 | int OscReload[2]; 18 | int waveForm[2]; 19 | int oscStep; 20 | int sampleRate; 21 | unsigned char noise[256]; // 0-8 22 | unsigned int channelMask[3]; 23 | int vol; 24 | 25 | TED(); 26 | void enableChannel(unsigned int channel, bool enable); 27 | void setFreq(unsigned int channel, int freq); 28 | void oscillatorReset(); 29 | void oscillatorInit(); 30 | void writeSoundReg(unsigned int reg, unsigned char value); 31 | void storeToBuffer(short *buffer, unsigned int count); 32 | unsigned int waveSquare(unsigned int channel); 33 | unsigned int waveSawTooth(unsigned int channel); 34 | unsigned int waveTriangle(unsigned int channel); 35 | unsigned int getWaveSample(unsigned int channel, unsigned int wave); 36 | void renderSound(unsigned int nrsamples, short *buffer); 37 | void setMasterVolume(unsigned int shift); 38 | void selectWaveForm(unsigned int channel, unsigned int wave); 39 | void setplaybackSpeed(unsigned int speed); 40 | unsigned int getTimeSinceLastReset(); 41 | void setSampleRate(unsigned int value); 42 | void setFilterOrder(unsigned int value); 43 | void initFilter(unsigned int sampleRate_, unsigned int filterOrder_); 44 | }; -------------------------------------------------------------------------------- /src/audiosource/wav/dr_impl.cpp: -------------------------------------------------------------------------------- 1 | #define DR_MP3_IMPLEMENTATION 2 | #define DR_MP3_NO_STDIO 3 | #define DR_MP3_FLOAT_OUTPUT 4 | #include "dr_mp3.h" 5 | 6 | #define DR_WAV_IMPLEMENTATION 7 | #define DR_WAV_NO_STDIO 8 | #include "dr_wav.h" 9 | 10 | #define DR_FLAC_IMPLEMENTATION 11 | #define DR_FLAC_NO_STDIO 12 | #define DR_FLAC_NO_CRC 13 | #include "dr_flac.h" 14 | -------------------------------------------------------------------------------- /src/audiosource/wav/stb_vorbis.h: -------------------------------------------------------------------------------- 1 | #define STB_VORBIS_HEADER_ONLY 2 | #include "stb_vorbis.c" -------------------------------------------------------------------------------- /src/backend/null/soloud_null.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SoLoud audio engine 3 | Copyright (c) 2013-2015 Jari Komppa 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | */ 24 | 25 | #include "soloud.h" 26 | 27 | #if !defined(WITH_NULL) 28 | 29 | namespace SoLoud 30 | { 31 | result null_init(Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer) 32 | { 33 | return NOT_IMPLEMENTED; 34 | } 35 | }; 36 | 37 | #else 38 | 39 | namespace SoLoud 40 | { 41 | static void nullCleanup(Soloud * /*aSoloud*/) 42 | { 43 | } 44 | 45 | result null_init(Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer, unsigned int aChannels) 46 | { 47 | if (aChannels == 0 || aChannels == 3 || aChannels == 5 || aChannels == 7 || aChannels > MAX_CHANNELS || aBuffer < SAMPLE_GRANULARITY) 48 | return INVALID_PARAMETER; 49 | aSoloud->mBackendData = 0; 50 | aSoloud->mBackendCleanupFunc = nullCleanup; 51 | 52 | aSoloud->postinit_internal(aSamplerate, aBuffer, aFlags, aChannels); 53 | aSoloud->mBackendString = "null driver"; 54 | return SO_NO_ERROR; 55 | } 56 | }; 57 | #endif 58 | -------------------------------------------------------------------------------- /src/tools/resamplerlab/stb_image_write.c: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_WRITE_IMPLEMENTATION 2 | #include "stb_image_write.h" 3 | --------------------------------------------------------------------------------