Documentation updates

This commit is contained in:
bni
2011-06-20 21:55:56 +02:00
parent 3e8fc32ba9
commit ce14b68a14
2 changed files with 22 additions and 15 deletions

View File

@@ -1,28 +1,32 @@
# SoundPlug, webOS #
# SoundPlug, webOS
## Rationale ##
This code makes it possible to play low latency audio in a webOS app.
## Rationale
This plugin makes it possible to play low-latency sounds in a webOS app.
The native JavaScript "Audio" object in webOS is not usable for playing sounds in games etc. The same goes for the PhoneGap "Media" object.
The native JavaScript "Audio" object in webOS is not usable for playing sounds in games etc. The latency is too high, and playing multiple sounds for an extended period leads to various problems.
This is a plugin for webOS, that can be used in a webOS "hybrid" app to play low latency sounds.
This plugin can be used in a webOS "hybrid" app. That is by using both browser code and native code in the .ipk.
The plugin uses SDL_mixer to play sound. That means multiple sounds can play at the same time and the same sound can play overlapping itself (essential for arcade games).
The native code in this plugin uses SDL_mixer to play sound. This means multiple sounds can play at the same time and the same sound can play overlapping itself (essential for arcade games).
The plugin has been developed for use with the game Orbium (https://github.com/bni/orbium), but It should be generally useful for all games and multimedia apps.
## Usage ##
You must define a "object" element like this somewhere in your page (eg index.html):
## Usage
You must define a "object" element like this somewhere in your page (eg index.html, or in a mojo scene):
```html
<object id="soundPlug" width="1" height="1" type="application/x-palm-remote" x-palm-pass-event="true">
<param name="appid" value="<your-app-id>">
<param name="exe" value="soundplug_plugin">
<param name="Param1" value="0">
<param name="Param2" value="1">
</object>
```
Sounds can then be played from JavaScript like this:
```javascript
document.getElementById("soundPlug").play("boink.wav");
```
Copy boink.wav (and other sound files you have), to your project directory.
@@ -35,7 +39,7 @@ https://developer.palm.com/content/api/dev-guide/pdk/js-and-plug-in-interface.ht
This plugin has been built with the 3.0 SDK and verified to work on webOS 1.4.5 and 3.0. It should work on all versions and on all webOS hardware.
## License ##
## License
The MIT License
Copyright (c) 2011 Björn Nilsson

View File

@@ -1,7 +1,7 @@
# SoundPlug, iOS #
# SoundPlug, iOS
## Rationale ##
This PhoneGap plugin it possible to play low latency audio in an iOS app.
## Rationale
This plugin makes it possible to play low-latency sounds in an iOS app.
The native JavaScript "Audio" object in iOS is not usable at all. The same goes for the PhoneGap "Media" object, that has high latency and other problems.
@@ -9,14 +9,17 @@ Multiple sounds can play at the same time and the same sound can play overlappin
The plugin has been developed for use with the game Orbium (https://github.com/bni/orbium), but It should be generally useful for all games and multimedia apps.
## Usage ##
## Usage
Add SoundPlug.m and SoundPlug.h to your xcode project (in the Plugins dir).
Add test.wav to xcode project as a resource.
Play sound in JavaScript like this: PhoneGap.exec("SoundPlug.play", "test.wav");
Play sound in JavaScript like this:
```javascript
PhoneGap.exec("SoundPlug.play", "test.wav");
```
## License ##
## License
The MIT License
Copyright (c) 2011 Björn Nilsson