Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Migrate and upstream LowLatencyAudio plugin #1

Merged
merged 1 commit into from
Mar 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Cordova Low Latency Audio Plugin for iOS and Android
=======================

Prerequisites: A Cordova/PhoneGap 3.0+ project for iOS or Android.
Prerequisites: A Cordova/PhoneGap 3.0+ project for iOS, Android or BlackBerry 10.

## Index

Expand Down Expand Up @@ -115,7 +115,7 @@ Unloads an audio file from memory.
* ID - string unique ID for the audio file
* success - success callback function
* fail - error/fail callback function

##Example

In this example, the resources reside in a relative path under the Cordova root folder "www/".
Expand All @@ -134,27 +134,27 @@ The implementation goes as follows:
```javascript
if( window.plugins && window.plugins.LowLatencyAudio ) {
var lla = window.plugins.LowLatencyAudio;

// preload audio resource
lla.preloadAudio( 'music', media['music'], 1, 1, function(msg){
}, function(msg){
console.log( 'error: ' + msg );
});

lla.preloadFX( 'click', media['click'], function(msg){
}, function(msg){
console.log( 'error: ' + msg );
});

// now start playing
lla.play( 'click' );
lla.loop( 'music' );

// stop after 1 min
// stop after 1 min
window.setTimeout( function(){
//lla.stop( 'click' );
lla.stop( 'music' );

lla.unload( 'music' );
lla.unload( 'click' );
}, 1000 * 60 );
Expand All @@ -177,4 +177,3 @@ cordova plugin add https://github.com/floatinghotpot/cordova-plugin-lowlatencyau

The first iteration of the Plugin was built by [Andrew Trice](https://github.com/triceam/LowLatencyAudio).
This plugin was ported to Plugman / Cordova 3 by [Raymond Xie](https://github.com/floatinghotpot), [SidneyS](https://github.com/sidneys) and other committers.

63 changes: 37 additions & 26 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.rjfun.cordova.plugin.lowlatencyaudio"
version="1.1.4">

<name>LowLatencyAudio</name>
<author>Andrew Trice, updated by Raymond Xie, etc.</author>
<description>Cordova/PhoneGap 3+ Plugin to support Low Latency and Polyphonic Audio Playback on Android and iOS, must have for mobile apps/games, as HTML5 audio in mobile browsers is really poor. Also implemented same interface for HTML5 audio, useful when test in PC browser.</description>

<license>MIT</license>
<keywords>audio,fx,music,mp3,game</keywords>
<repo>https://github.com/floatinghotpot/cordova-plugin-lowlatencyaudio.git</repo>
Expand All @@ -23,7 +23,7 @@

<!-- android -->
<platform name="android">

<config-file target="res/xml/config.xml" parent="/*">
<feature name="LowLatencyAudio">
<param name="android-package" value="com.rjfun.cordova.plugin.LowLatencyAudio"/>
Expand All @@ -33,28 +33,39 @@
<source-file src="src/android/LowLatencyAudio.java" target-dir="src/com/rjfun/cordova/plugin" />
<source-file src="src/android/LowLatencyAudioAsset.java" target-dir="src/com/rjfun/cordova/plugin" />
<source-file src="src/android/PolyphonicVoice.java" target-dir="src/com/rjfun/cordova/plugin" />

</platform>

<!-- ios -->
<platform name="ios">

<config-file target="config.xml" parent="/*">
<feature name="LowLatencyAudio">
<param name="ios-package" value="LowLatencyAudio" />
</feature>
</config-file>

<framework src="Foundation.framework" />
<framework src="AVFoundation.framework" />
<framework src="AudioToolbox.framework" />

<header-file src="src/ios/LowLatencyAudio.h" />
<source-file src="src/ios/LowLatencyAudio.m" />

<header-file src="src/ios/LowLatencyAudioAsset.h" />
<source-file src="src/ios/LowLatencyAudioAsset.m" />


</platform>

<!-- ios -->
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="LowLatencyAudio">
<param name="ios-package" value="LowLatencyAudio" />
</feature>
</config-file>

<framework src="Foundation.framework" />
<framework src="AVFoundation.framework" />
<framework src="AudioToolbox.framework" />

<header-file src="src/ios/LowLatencyAudio.h" />
<source-file src="src/ios/LowLatencyAudio.m" />

<header-file src="src/ios/LowLatencyAudioAsset.h" />
<source-file src="src/ios/LowLatencyAudioAsset.m" />

</platform>


<!-- blackberry10 -->
<platform name="blackberry10">
<source-file src="src/blackberry10/index.js" target-dir="LowLatencyAudio"/>
<lib-file src="src/blackberry10/native/device/libLowLatencyAudio.so" arch="device"/>
<lib-file src="src/blackberry10/native/simulator/libLowLatencyAudio.so" arch="simulator"/>
<config-file target="www/config.xml" parent="/widget">
<feature name="LowLatencyAudio">
<param name="blackberry-package" value="LowLatencyAudio" />
</feature>
</config-file>
</platform>

</plugin>
Loading