{"id":13458492,"url":"https://github.com/siudesu/SoLoudModule","last_synced_at":"2025-03-24T15:31:25.657Z","repository":{"id":171125896,"uuid":"647286680","full_name":"siudesu/SoLoudModule","owner":"siudesu","description":"Solar2D Lua module to use with SoLoud plugin.","archived":false,"fork":false,"pushed_at":"2024-03-15T01:50:21.000Z","size":29,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-29T03:33:08.027Z","etag":null,"topics":["lua","solar2d","soloud"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siudesu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-30T13:05:55.000Z","updated_at":"2024-07-18T19:38:33.000Z","dependencies_parsed_at":"2024-03-15T03:09:43.478Z","dependency_job_id":"83b5254e-c5ce-4a27-be1b-f74a16a349ba","html_url":"https://github.com/siudesu/SoLoudModule","commit_stats":null,"previous_names":["siudesu/soloudmodule"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siudesu%2FSoLoudModule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siudesu%2FSoLoudModule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siudesu%2FSoLoudModule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siudesu%2FSoLoudModule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siudesu","download_url":"https://codeload.github.com/siudesu/SoLoudModule/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245298042,"owners_count":20592525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","solar2d","soloud"],"created_at":"2024-07-31T09:00:53.098Z","updated_at":"2025-03-24T15:31:20.648Z","avatar_url":"https://github.com/siudesu.png","language":"Lua","readme":"# SoLoud Module\n### This [Solar2D](https://solar2d.com) Lua module aims to be a drop-in replacement for the audio API using the [SoLoud plugin](https://forums.solar2d.com/t/soloud-audio-plugin/355040).\n\n\u003c/br\u003e\n\n## Features\n - Uses same API syntax as [Solar2D's audio library](https://docs.coronalabs.com/api/library/audio/index.html)\n - Can play audio files that have been bundled using [Binary Archive](https://github.com/siudesu/BinaryArchive)\n\n\u003c/br\u003e\n\n## Limitations\n - Currently, SoLoud plugin is **not available for Linux or Switch**.\n - `stopWithDelay()` is not implemented. The same effect can be accomplished outside this module with a `timer` and `AUDIO.stop()`\n - `fadeOut()` is not implemented. The same effect can be accomplished outside this module with `AUDIO.fade()` and a `timer` to perform `AUDIO.stop()`.\n\n\u003c/br\u003e\n\n\n\n## Requirements\n- [SoLoud plugin](https://github.com/solar2d/com.xibalbastudios-plugin.Bytemap) by [Steven Johnson](https://github.com/ggcrunchy), must be added in `build.settings`.\n\n### build.settings (Plugins section)\n```lua\n\tplugins =\n\t{\n\t\t[\"plugin.soloud\"] = {publisherId = \"com.xibalbastudios\"},\n\t}\n```\n\n\u003c/br\u003e\n\n## Usage\n### Load module and play audio sound:\n```lua\n-- You may replace the original audio library reference with this module without making additional changes to your project:\n\naudio = require( \"m_soloud_audio\" )\n\nlocal sfx1 = audio.loadSound( \"soundFile.mp3\" )\n\taudio.play( sfx1 )\n\n\n-- or, load the module with any variable name without replacing the original audio library:\n\nlocal AUDIO = require( \"m_soloud_audio\" )\n\nlocal sfx1 = AUDIO.loadSound( \"soundFile.mp3\" )\n\tAUDIO.play( sfx1 )\n```\n\n\n### Loading audio from archive:\n```lua\n-- Assumes a binary archive has been loaded with audio files used below.\n\n-- Load SoLoud Module\nlocal AUDIO = require( \"m_soloud_audio\" )\n\n-- Fetch audio data from archive and insert it into a table (it's passed by reference)\nlocal BGM_Data = { bin.fetch( \"audio/BGM 01.mp3\" )}\nlocal SFX_Data = { bin.fetch( \"audio/SFX/Ding.ogg\" )}\n\n-- Create audio stream object\nlocal BGM1 = AUDIO.loadStreamFromArchive( \"audio/BGM 01.mp3\", BGM_Data )\n\n-- Create audio sound object using the same filename and path as reference\nlocal SFX1 = AUDIO.loadSoundFromArchive( \"audio/SFX/Ding.ogg\", SFX_Data )\n\n-- Play BGM on channel 1\nAUDIO.play( BGM1, { channel=1 })\n\n-- Play SFX on any available channel\nAUDIO.play( SFX1 )\n```\n\n\u003c/br\u003e\n\n### Function List - same as [Solar2D audio API](https://docs.coronalabs.com/api/library/audio/index.html):\n```\nMODULE.dispose( audioHandle )\nMODULE.fade( { channel=num, time=num, volume=num } )\nMODULE.findFreeChannel( startChannel )\nMODULE.getDuration( audioHandle )\nMODULE.getMaxVolume( { channel=num } )\nMODULE.getMinVolume( { channel=num } )\nMODULE.getVolume( { channel=num } )\nMODULE.isChannelActive( channel )\nMODULE.isChannelPaused( channel )\nMODULE.isChannelPlaying( channel )\nMODULE.loadSound( audioFileName )\nMODULE.loadStream( audioFileName )\nMODULE.pause( channel )\nMODULE.play( audioHandle, { channel=num, loops=num, duration=num, fadein=num, onComplete=function, pitch=num } )\nMODULE.reserveChannels( channels )\nMODULE.resume( channel )\nMODULE.rewind( audioHandle or { channel=num } )\nMODULE.seek( time, audioHandle or { channel=num } )\nMODULE.setMaxVolume( volume, { channel=num } )\nMODULE.setMinVolume( volume, { channel=num } )\nMODULE.setVolume( volume, { channel=num } )\nMODULE.stop( channel )\n```\n\n### Extra Audio Functions:\n```\nMODULE.setPitch( channel, pitchValue )\nMODULE.setSpeed( channel, speedValue )\n```\n\n### Binary Archive Functions\n```\nMODULE.loadSoundFromArchive( filename, data )\nMODULE.loadStreamFromArchive( filename, data )\n```\n\n### Properties (Read Only):\n```\nMODULE.freeChannels\nMODULE.totalChannels\nMODULE.unreservedFreeChannels\nMODULE.unreservedUsedChannels\nMODULE.usedChannels\n```\n\n---\n\n## License\nDistributed under the MIT License. See [LICENSE](https://github.com/siudesu/SoLoudModule/blob/main/LICENSE) for more information.\n","funding_links":[],"categories":["Audio"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiudesu%2FSoLoudModule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiudesu%2FSoLoudModule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiudesu%2FSoLoudModule/lists"}