<commit_before>Android Audio Bypass
====================

This is a quick demo project that illustrates the use of an Android plugin
to avoid the hideous latency added by the Unity 3D game engine on some
devices.

There are two parts, the plugin and a Unity 5 test project.  (The Plugin
should work fine with Unity 4.6, but I haven't tried it.)

The plugin is a standard Android library project.  The easiest way to build
it is by running `ant jar` from the command line, then copying the plugin
jar (`AndroidBypassPlugin.jar`) into the Unity project.  See the `mk.bat`
file for a sample build script.

The Unity project includes a pair of generated WAV files in the StreamingAssets
directory, which makes them easily accessible to both Unity and the Android
AssetManager.  UI buttons allow you to play either sound with either method
and observe the difference.

On a Moto X running 4.4.4, there's a significant difference in latency, as
demonstrated in this video [need youtube link].  On a Nexus 10, there's
no observable difference.  So while Unity is the proximate cause of latency,
it varies between devices, and the blame may be shared.


### Use of this code ###

This code is distributed under the Apache 2 license.

This is not a finished product.  It's a bare-bones demo intended to
highlight the latency discrepancy between Unity's AudioSource and Android's
SoundPool.  I'm reluctant to put too much effort into this because I'm
hoping that Unity will figure out how to make sound work better across
all Android devices.
<commit_msg>Add youtube link<commit_after>Android Audio Bypass
====================

This is a quick demo project that illustrates the use of an Android plugin
to avoid the hideous latency added by the Unity 3D game engine on some
devices.

There are two parts, the plugin and a Unity 5 test project.  (The Plugin
should work fine with Unity 4.6, but I haven't tried it.)

The plugin is a standard Android library project.  The easiest way to build
it is by running `ant jar` from the command line, then copying the plugin
jar (`AndroidBypassPlugin.jar`) into the Unity project.  See the `mk.bat`
file for a sample build script.

The Unity project includes a pair of generated WAV files in the StreamingAssets
directory, which makes them easily accessible to both Unity and the Android
AssetManager.  UI buttons allow you to play either sound with either method
and observe the difference.

On a Moto X running 4.4.4, there's a significant difference in latency, as
demonstrated in this video: https://www.youtube.com/watch?v=E_VwFBxf4ew.
On a Nexus 10, and reportedly on old and new Nexus 7s, there's no
observable difference.  So while Unity is the proximate cause of latency,
it varies between devices, and the blame might be shared by more than
one party.


### Use of this code ###

This code is distributed under the Apache 2 license.

This is not a finished product.  It's a bare-bones demo intended to
highlight the latency discrepancy between Unity's AudioSource and Android's
SoundPool.  I'm reluctant to put too much effort into this because I'm
hoping that Unity will figure out how to make sound work better across
all Android devices.

{'fraction_non_alphanumeric': 0.05216844751728473, 'fraction_numerical': 0.0069138906348208675, 'mean_word_length': 4.322742474916388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1581683', 'n_tokens_mistral': 880, 'n_tokens_neox': 780, 'n_words': 511}