{"id":13743002,"url":"https://github.com/treefortress/SoundAS","last_synced_at":"2025-05-09T00:32:31.238Z","repository":{"id":8168840,"uuid":"9591449","full_name":"treefortress/SoundAS","owner":"treefortress","description":"A modern lightweight sound manager for AS3. ","archived":false,"fork":false,"pushed_at":"2023-10-02T01:43:38.000Z","size":6662,"stargazers_count":139,"open_issues_count":11,"forks_count":45,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-11-15T14:35:10.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treefortress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-04-22T05:20:48.000Z","updated_at":"2024-11-11T01:28:37.000Z","dependencies_parsed_at":"2024-01-27T09:46:12.040Z","dependency_job_id":null,"html_url":"https://github.com/treefortress/SoundAS","commit_stats":{"total_commits":81,"total_committers":7,"mean_commits":"11.571428571428571","dds":0.07407407407407407,"last_synced_commit":"3005aa504b050aebd6de5e9f7b02cf393c36c625"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treefortress%2FSoundAS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treefortress%2FSoundAS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treefortress%2FSoundAS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treefortress%2FSoundAS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treefortress","download_url":"https://codeload.github.com/treefortress/SoundAS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171162,"owners_count":21865275,"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":[],"created_at":"2024-08-03T05:00:38.767Z","updated_at":"2025-05-09T00:32:29.965Z","avatar_url":"https://github.com/treefortress.png","language":"ActionScript","readme":"[license]: https://github.com/treefortress/SoundAS/raw/master/license.txt\n\nSoundAS - AS3 SoundManager\n==========================\n\nA modern lightweight AS3 SoundManager for Flash and AIR. \n\nThe goal of SoundAS is to simplifying playback of your audio files, with a focus on easily transitioning from one to another, and differentiating between SoundFX and Music Loops.\n\n#Features\n* Clean modern API\n* API Chaining: SoundAS.play(\"music\").fadeTo(0);\n* Supports groups of sounds\n* Supports seamless looping\n* Supports workaround for the 'looping bug' (http://www.stevensacks.net/2008/08/07/as3-sound-channel-bug/)\n* Built-in Tweening system, no dependancies\n* Modular API: Use SoundInstance directly and ignore the rest.\n* Non-restrictive and unambigous license\n\n#API Overview\n\nFull documentation can be found here: http://treefortress.com/libs/SoundAS/docs/.\n\n###SoundAS\nThis Class is the main interface for the library. It's responsible for loading and controlling all sounds globally. \n\nLoading / Unloading: \n\n*    **SoundAS.addSound**(type:String, sound:Sound):void\n*    **SoundAS.loadSound**(url:String, type:String, buffer:int = 100):void\n*    **SoundAS.removeSound**(type:String):void\n*    **SoundAS.removeAll**():void\n\nPlayback:\n\n*    **SoundAS.getSound**(type:String, forceNew:Boolean = false):SoundInstance\n*    **SoundAS.play**(type:String, volume:Number = 1, startTime:Number = 0, loops:int = 0, allowMultiple:Boolean = false, allowInterrupt:Boolean = true, enableSeamlessLoops:Boolean = false):SoundInstance\n*    **SoundAS.playFx**(type:String, volume:Number = 1, startTime:Number = 0, loops:int = 0):SoundInstance\n*    **SoundAS.playLoop**(type:String, volume:Number = 1, startTime:Number = 0, enableSeamlessLoops:Boolean = true):SoundInstance\n*    **SoundAS.resume**(type:String, volume:Number = 1, startTime:Number = 0, loops:int = 0):SoundInstance\n*    **SoundAS.resumeAll**():void\n*    **SoundAS.pause**(type:String):SoundInstance\n*    **SoundAS.pauseAll**():void\n*    **SoundAS.stopAll**():void\n*    **SoundAS.set masterVolume**(value:Number):void\n*    **SoundAS.fadeFrom**(type:String, startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000)    \n*    **SoundAS.fadeAllFrom**(startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000)\n*    **SoundAS.fadeMasterFrom**(startVolume:Number = 0, endVolume:Number = 1, duration:Number = 1000)    \n*    **SoundAS.fadeTo**(type:String, endVolume:Number = 1, duration:Number = 1000):SoundInstance\n*    **SoundAS.fadeAllTo**(endVolume:Number = 1, duration:Number = 1000):SoundInstance\n*    **SoundAS.fadeMasterTo**(endVolume:Number = 1, duration:Number = 1000)    \n\n####SoundInstance\nControls playback of individual sounds, allowing you to easily stop, start, resume and set volume or position.\n\n*     **play**(volume:Number = 1, startTime:Number = 0, loops:int = 0, allowMultiple:Boolean = true):SoundInstance\n*     **pause**():SoundInstance\n*     **resume**(forceStart:Boolean = false):SoundInstance\n*     **stop**():SoundInstance\n*     **set volume**(value:Number):void\n*     **set mute**(value:Boolean):void\n*     **fadeFrom**(startVolume:Number, endVolume:Number, duration:Number = 1000):SoundInstance\n*     **fadeTo**(endVolume:Number, duration:Number = 1000):SoundInstance\n*     **destroy**():void\n*     **endFade**(applyEndVolume:Boolean = false):SoundInstance\n\n#Code Examples\n\n###Loading\n\n    //Load sound from an external file\n    SoundAS.loadSound(\"assets/Click.mp3\", \"click\");\n\n    //Inject an already loaded Sound instance\n    SoundAS.addSound(\"click\", clickSound);\n\n###Basic Playback\n\n    //Play sound.\n        //allowMultiple: Allow multiple overlapping sound instances.\n        //allowInterrupt: If this sound is currently playing, start it over.\n    SoundAS.play(\"click\", volume, startTime, loops, allowMultiple, allowInterrupt);\n\n    //Shortcut for typical game fx (no looping, allows for multiple instances)\n    SoundAS.playFx(\"click\");\n\n    //Shortcut for typical game music (loops forever, no multiple instances)\n    SoundAS.playLoop(\"music\");\n\n    //Toggle Mute for all sounds\n    SoundAS.mute = !SoundAS.mute;\n\n    //PauseAll / ResumeAll\n    SoundAS.pauseAll();\n    SoundAS.resumeAll();\n     \n    //Toggle Pause on individual song\n    var sound:SoundInstance = SoundAS.getSound(\"music\");\n    (sound.isPaused)? sound.resume() : sound.pause();\n\n    //Fade Out\n    SoundAS.getSound(\"click\").fadeTo(0);\n\n    //Fade masterVolume out\n    SoundAS.fadeMasterTo(0);\n\n### Groups\n\n    //Create a group\n    var musicGroup:SoundManager = SoundAS.group(\"music\");\n\n    //Add sound(s) to group\n    musicGroup.loadSound(\"assets/TitleMusic.mp3\", \"titleMusic\");\n    musicGroup.loadSound(\"assets/GameMusic.mp3\", \"gameMusic\");\n\n    //Use entire SoundAS API on Group:\n    musicGroup.play(\"titleMusic\")\n    musicGroup.volume = .5;\n    musicGroup.mute = muteMusic;\n    musicGroup.fadeTo(0);\n    //etc...\n\n    //Stop All Groups\n    for(var i:int = SoundAS.groups.length; i--;){\n        SoundAS.groups[i].stopAll();\n    }\n\n###Advanced \n\n    //Mute one sound\n    SoundsAS.getSound(\"click\").mute = true;\n\n    //Fade from .3 to .7 over 3 seconds\n    SoundAS.getSound(\"click\").fadeFrom(.3, .7, 3000);\n\n\t//Manage a SoundInstance directly and ignore SoundAS\n    var sound:SoundInstance = new SoundInstance(mySound, \"click\");\n    sound.play(volume);\n    sound.position = 500; //Set position of sound in milliseconds\n    sound.volume = .5; \n\tsound.fadeTo(0);\n\n    //String 2 songs together\n    SoundAS.play(MUSIC1).soundCompleted.addOnce(function(si:SoundInstance){\n        SoundAS.playLoop(MUSIC2);\n    }\n\n    //Loop twice, and trigger something when all loops are finished.\n    SoundAS.play(MUSIC1, 1, 0, 2).soundCompleted.add(function(si:SoundInstance){\n        if(si.loopsRemaining == -1){\n            trace(\"Loops completed!\");\n            si.soundCompleted.removeAll();\n        }\n    }\n\n---\n### License\n[WTFPL][license]\n\n","funding_links":[],"categories":["Multimedia"],"sub_categories":["Sound"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreefortress%2FSoundAS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreefortress%2FSoundAS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreefortress%2FSoundAS/lists"}