Logo - Crazy Minnow Studio - game, asset, tool development

Welcome to Crazy Minnow Studio! We are a small indie software development team primarily focused on game development using the Unity engine. Our pipeline includes: games, game development tools and assets, and video tutorial production. Check out our Unity lip sync asset, SALSA Lip-Sync, available on the Unity Asset Store. Follow our blog for updates on our Unity asset and game development, as well as other happenings in indie game development.

Accessing Web-Based Audio Resources in Amplitude

UPDATE: 2018-08-06: v0.6.0 updated to fix obsolete Unity API calls.

Amplitude for WebGL provides easy access to audio analysis functions for amplitude and frequency data. Being a web-based toolset, it makes sense that our customers would want to access web-based audio files to feed to Amplitude. In fact, we have already had a couple of questions presented in our Unity forum thread for Amplitude asking how to make this work. And additionally, the assumption was it was a bug or implementation problem with Amplitude itself. The process of fetching and using async web-based audio can appear to be a bit daunting. The difficulty is not an Amplitude or webGL issue, it is an issue of timing and dealing with the asynchronous nature of the web.

During our research, we created a small API in an attempt to make the process much easier. You will most likely need to understand Unity's implementation of web-based resources, especially if you wish to modify or troubleshoot issues you may be having. WebAudioUrls is available as a free package for Amplitude for WebGL customers -- as a starting point for their async audio projects. Please feel free to make modifications to the API files if necessary. Since Unity's implementation of WebGL is so basic and constantly changing, we do not provide support for web-audio, Unity's implementation of web-request resources, etc. Consider this package a starting point for asynchronous operations in your project. You can get the files in our download section. We have also published an Examples package, which includes single-action and batch-mode implementation examples, as well as a demo scene. Once you have grabbed the files, head over to the documentation for a detailed look at how to use the API and check out the release notes. A video tutorial is available here. PLEASE NOTE: most browsers do not like cross-site access. If your project attempts to access audio from another site, you may experience a CORS issue. If you are only testing, you can probably bypass the issue with a browser plug-in. Google is your friend -- the Mozilla site has some good information about CORS. If the examples are not working in a browser, use your browser's development mode (usually F12) to see if you are receiving errors.

Read the WebAudioUrls Documentation

Requirements: Accessing web-audio means dealing with the asynchronous tendencies of the Internet (first, accessing the URL and then streaming in the data to create an AudioClip). The API is not limited to web-gl usage and certainly not limited to Amplitude implementations. In fact, the API itself has no requirements for any asset package. The example files, on the other hand, do have dependencies in the demo scene: Amplitude, SALSA LipSync Suite v2, and AmplitudeSALSA. ALSO NOTE: depending on your implementation, you may run across a CORS issue. See the preceeding paragraph.

NOTE: While every attempt has been made to ensure the safe content and operation of these files, they are provided as-is, without warranty or guarantee of any kind. By downloading and using these files you are accepting any and all risks associated and release Crazy Minnow Studio, LLC of any and all liability.

Download Files

Categories: Amplitude

Comments: No comments yet