LowLatencyAudio Problem.

Get help using Construct 2

Post » Mon Jan 14, 2013 10:45 am

I've written lot of times in forum but i dont get help.

Please Does anyone expain me with detail how i solve android sound problem with LowLatencyAudio ?.especially i cant install plug-in in eclipse.There is tutorial i know but it have no detail.PleaseI wait your help.

Regards,

B
10
S
3
G
3
Posts: 162
Reputation: 3,190

Post » Mon Jan 14, 2013 3:56 pm

You can read more about this plugin at:
http://www.tricedesigns.com/2012/01/25/low-latency-polyphonic-audio-in-phonegap/

The low latency audio plugin is designed to enable low latency and polyphonic audio from PhoneGap applications, using a very simple and basic API.

Getting started:
Add the following files to your JAVA project, keeping the folder structure:
com/phonegap/PGLowLatencyAudio.java
com/phonegap/PGLowLatencyAudioAsset.java
com/phonegap/PGPolyphonicVoice.java

Add the following file to your www directory, and add to index.html:
PGLowLatencyAudio.js

Add the following to your phonegap plugins.xml file:
<plugin name="PGLowLatencyAudio" value="com.phonegap.PGLowLatencyAudio" />

Usage:
1) Preload the audio asset
2) Play the audio asset
3) When done, unload the audio asset

API methods:
preloadFX: function ( id, assetPath, success, fail)
     params: ID - string unique ID for the audio file
               assetPath - the relative path to the audio asset within the www directory
               success - success callback function
               fail - error/fail callback function
     detail:     
               The preloadFX function loads an audio file into memory. Assets that are loaded using preloadFX are managed/played using the Android SoundPool class.   These are very low-level audio methods and have minimal overhead.   These assets should be short.   Sound files longer than 5 seconds may have errors including (not playing, clipped content, not looping) - all will fail silently on the device (debug output will be visible if connected to debugger). These assets are fully concurrent and polyphonic.

preloadAudio: function ( id, assetPath, voices, success, fail)
     params: ID - string unique ID for the audio file
               assetPath - the relative path to the audio asset within the www directory
               voices - the number of polyphonic voices available
               success - success callback function
               fail - error/fail callback function
     detail:     
               The preloadAudio function loads an audio file into memory. Assets that are loaded using preloadAudio are managed/played using the Android MediaPlayer.   These have more overhead than assets laoded via preloadFX, and can be looped/stopped.   By default, there is a single "voice" - only one instance that will be stopped & restarted when you hit play. If there are multiple voices (number greater than 0), it will cycle through voices to play overlapping audio.

play: function (id, success, fail)      
     params: ID - string unique ID for the audio file
               success - success callback function
               fail - error/fail callback function
     detail:     
               Plays an audio asset

loop: function (id, success, fail)      
     params: ID - string unique ID for the audio file
               success - success callback function
               fail - error/fail callback function
     detail:     
               Loops an audio asset infinitely - this only works for assets loaded via preloadAudio

stop: function (id, success, fail)      
     params: ID - string unique ID for the audio file
               success - success callback function
               fail - error/fail callback function
     detail:     
               Stops an audio file - this only works for assets loaded via preloadAudio

unload: function (id, success, fail)      
     params: ID - string unique ID for the audio file
               success - success callback function
               fail - error/fail callback function
     detail:     
               Unloads an audio file from memory
B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Tue Jan 15, 2013 8:05 am

[QUOTE=justifun]

Add the following files to your JAVA project, keeping the folder structure:
com/phonegap/PGLowLatencyAudio.java
com/phonegap/PGLowLatencyAudioAsset.java
com/phonegap/PGPolyphonicVoice.java

[/QUOTE]

Thanks for your interest.I dont know frankly where i put the java files?
B
10
S
3
G
3
Posts: 162
Reputation: 3,190

Post » Thu Feb 27, 2014 11:57 am

Hey guys, i have the same problem, well, i know a little about languages and i make app on android eclipe ADT. Well, what i did: Get all open cordova code and put on my project, i follow this tutorial and even this i have a problem.

Note: When i finish my project on C2 i make export for HTML5 and i make embed on my eclipse with cordova phonegap.

Anyone have any suggestions?
Thanks
B
5
Posts: 40
Reputation: 359

Post » Fri Feb 28, 2014 6:46 pm

@renatomateusx the solution in pic below. You just convert your audio to .ogg and .m4a then put them c2 and set event like pic. İts my solution.


http://i.imgur.com/iyDvfPF.jpg
B
10
S
3
G
3
Posts: 162
Reputation: 3,190

Post » Fri Feb 28, 2014 7:13 pm

Message: renatomateusx is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
guero wrote:@renatomateusx the solution in pic below. You just convert your audio to .ogg and .m4a then put them c2 and set event like pic. İts my solution.



guero, thanks. Yes, i have the both extension sound. So i have this message when i'm trying run on emulator.

E/MediaPlayer(331): error (1, -2147483648)

I think is because Cordova try run the sound with DroidGap WebChromeClient... Something changed, but i don't know what...
B
5
Posts: 40
Reputation: 359

Post » Fri Feb 28, 2014 7:17 pm

@renatomateusx sorry ı dont know WebChromeClient ı use phonegap its working.
B
10
S
3
G
3
Posts: 162
Reputation: 3,190

Post » Fri Feb 28, 2014 8:42 pm

guero wrote:@renatomateusx sorry ı dont know WebChromeClient ı use phonegap its working.


guero, do you have some tutorial that explain how to start with phonegap?
Consider that just i have exported my game to HTML5

And now, what i am suppose to do?

Thanks
B
5
Posts: 40
Reputation: 359


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, mnashwan, shinkan, stylie1, tarek2 and 9 guests