Audio

The audio object provides information about supported audio functionality on the device.


Supported Platform(s)

- BlackBerry OS 5.0+
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
blackberry.audio.supportedContentTypes Y Y Y      Y
blackberry.audio.supportedProtocols Y Y Y      Y

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

You must declare the feature element(s) below in your configuration document:

Feature IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<feature id="blackberry.audio" /> Y Y Y      Y
<feature id="blackberry.audio.Player" /> Y Y Y      Y

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Functions

static String[] blackberry.audio.supportedContentTypes (protocol : String)


Request the list of supported content types for a specified protocol.


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator


Parameters
protocol The input protocol for the supported content types.

Return:

The list of supported content types for the protocol provided



Code Example:
<script type="text/javascript">
  // Display supported content types for specified protocol 
  var protocol = "file";
  var contentTypes = blackberry.audio.supportedContentTypes(protocol);

  if (contentTypes) {
    var printingContentTypesList = "";
    for (i = 0; i < contentTypes.length; i++) {
      printingContentTypesList += contentTypes[i] + "\n";
    }
    
    alert("List of " + contentTypes.length + " supported content-types for '" + protocol + "' :\n" + printingContentTypesList);
  }    
</script>

static String[] blackberry.audio.supportedProtocols (content_type : String)


Request the list of supported protocols for a specified content type.


Supported Platforms
 - BlackBerry OS 5.0+
 - Ripple Emulator


Parameters
content_type The content type for the supported protocols.

Return:

The list of supported protocols for the content type provided



Code Example:
<script type="text/javascript">
  // Display all supported protocols
  var protocols = blackberry.audio.supportedProtocols(null);

  if (protocols) {
    var printingProtocolsList = "";
    for (i = 0; i < protocols.length; i++) {
      printingProtocolsList += protocols[i] + "\n";
    }
    
    alert("List of " + protocols.length + " supported protocols:\n" + printingProtocolsList);  
  }    
</script>
Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:15:31 GMT-0500 (EST)