PSP™ (PlayStation®Portable)
Internet Radio Player
Development Guide
Document Version 1.1(E)
System Software Version 5.00
© 2008 Sony Computer Entertainment Inc.
All Rights Reserved.
[Trademarks]
"PlayStation" and PSP™ are registered trademarks of Sony Computer Entertainment, Inc.
"Memory Stick" and "Memory Stick Duo" are trademarks of Sony Corporation.
"XMB" is a trademark of Sony Corporation and Sony Computer Entertainment, Inc.
"PSP (PlayStation Portable)" Internet features include of ACCESS CO., LTD.
ACCESS and NetFront are trademarks or registered trademarks of ACCESS CO., LTD. in Japan
and other countries.
Java and JavaScript are trademarks or registered trademarks of Sun Microsystems, Inc. in the
United States and other countries.
Flash, Macromedia, and Macromedia Flash are trademarks or registered trademarks of Adobe
Systems Incorporated in the United States and other countries.
SHOUTcast and Winamp™ are trademarks or registered trademarks of AOL.
SHOUTCAST is a trademark of AOL LLC. Winamp is a trademark of AOL LLC.
Macintosh is a trademark of Apple Inc.
Windows is a registered trademark of Microsoft Corporation in the United States and other
countries.
All other product and company names mentioned herein are generally trademarks and/or registered
trademarks of their respective owners.
[Terms and Conditions]
All rights (including, but not limited to, copyright) pertaining to all the materials and information
that are made available from this Guideline are managed, owned, or used with permission by, SCEI.
All materials in this Guideline are protected by copyright laws, and other applicable laws. Except for
personal, non-commercial, internal use, you are prohibited from using (including, without limitation,
copying, modifying, reproducing in whole or in part, uploading, transmitting, distributing, licensing,
selling and publishing) any of the materials, without obtaining SCEI's prior written permission.
The contents of this Guideline are not guaranteed to be valid for future versions of system software.
SCEI OR ANY OF ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY DAMAGES ARISING
OUT OF ANY CHANGE OF THE SYSTEM SOFTWARE SPECIFICATIONS.
©SCEI PSP™ Internet Radio Player Development Guide
- 2 -
Table of Contents
1 About This Document................................................................................ 6
Overview ........................................................................................................................6
Who Should Read This Document? ..............................................................................6
What Specifically gets Created when an Internet Radio Player is Developed?........7
Related Documents .....................................................................................................10
2 PSP™ Internet Radio Structure and Operation..................................... 11
PSP™ Internal ............................................................................................................12
PSP™ External............................................................................................................13
3 Creating the Internet Radio Player .........................................................20
List of JavaScript Extended Methods........................................................................22
JavaScript Extended Method Reference Details.......................................................26
sysRadioPlayStream ...................................................................................................27
sysRadioPlayPls ..........................................................................................................30
sysRadioPlayM3u........................................................................................................33
sysRadioStop ...............................................................................................................36
sysRadioSetMasterVolume .........................................................................................40
sysRadioSetSubVolume...............................................................................................43
sysRadioGetLeftAudioPeakLevel...............................................................................46
sysRadioGetRightAudioPeakLevel ............................................................................50
sysRadioGetLeftAudioAverageLevel..........................................................................54
sysRadioGetRightAudioAverageLevel .......................................................................58
sysRadioSetSineWaveOscillatorFrequencyAndVolume............................................62
sysRadioSetWhiteNoiseOscillatorVolume .................................................................65
sysRadioSetAudioShiftWidth .....................................................................................68
sysRadioSetAudioCutOffWidth..................................................................................73
sysRadioSetAudioPitchShiftWidth ............................................................................77
sysRadioPlayEffectSound ...........................................................................................81
sysRadioPrepareForHttpGet......................................................................................84
sysRadioGetHttpGetStatus ........................................................................................88
sysRadioGetHttpGetResult ........................................................................................91
©SCEI PSP™ Internet Radio Player Development Guide
- 3 -
sysRadioHttpGetTerminate........................................................................................94
sysRadioGetPlayerStatus ...........................................................................................97
sysRadioGetNetworkBandQuality...........................................................................100
sysRadioGetAudioSoundDistortionRate..................................................................103
sysRadioGetContentMetaInfo ..................................................................................106
sysRadioGetBitRate ..................................................................................................109
sysRadioGetSamplingRate .......................................................................................112
sysRadioGetStreamUrl .............................................................................................115
sysRadioGetStreamTitle...........................................................................................118
sysRadioGetRelatedPageUrl ....................................................................................121
sysRadioGetStreamIpAddress..................................................................................124
sysRadioGetStreamPort ...........................................................................................127
sysRadioGetStreamBufferLevel ...............................................................................130
sysRadioPrepareForScanDir ....................................................................................133
sysRadioScanDir .......................................................................................................136
sysRadioGetMediaInOutStatus ...............................................................................139
sysRadioPrepareForStrOperation............................................................................142
sysRadioStrLength....................................................................................................145
sysRadioStrIndexOf ..................................................................................................148
sysRadioStrSlice........................................................................................................152
sysRadioStrCharCodeAt ...........................................................................................156
sysRadioStrOperationTerminate..............................................................................159
sysRadioCharacterEntityConvert ............................................................................162
sysRadioCharacterCodeConvert ..............................................................................165
sysRadioGetAnalogStickXValue...............................................................................168
sysRadioGetAnalogStickYValue...............................................................................170
sysRadioGetAnalogStickAngleValue........................................................................172
sysRadioGetAnalogStickRadiusValue......................................................................174
sysRadioSetDebugMode............................................................................................177
sysRadioDebugLog ....................................................................................................179
sysRadioSetDebugLogTextStyle...............................................................................182
sysRadioClearDebugLog...........................................................................................188
sysRadioGetPlayerCoreVersionInfo .........................................................................190
sysRadioCapabilityCheck .........................................................................................192
sysRadioGetStartButtonToggleStatus .....................................................................195
sysRadioBackLightAlwaysOn ..................................................................................197
sysRadioBusyIndicator .............................................................................................200
©SCEI PSP™ Internet Radio Player Development Guide
- 4 -
sysRadioCaptureScreenShot ....................................................................................202
sysRadioSleep............................................................................................................205
sysRadioGetSystemStatus........................................................................................207
4 Procedure for Developing an Internet Radio Player...........................209
Overview ....................................................................................................................209
1. Create an image of the completed form ...............................................................211
2. Create graphic elements .......................................................................................212
3. Create directories on the Memory Stick Duo™ and copy image files................214
4. Create html, css, and JavaScript files and copy them to the Memory Stick
Duo™..........................................................................................................................216
5. Copy the test Internet radio player icon file to the Memory Stick Duo™ .........219
6. Unmount the PSP™ system from the PC and then cancel the PSP™ system’s
USB mode ..................................................................................................................219
7. Try starting up the Internet radio player from the test Internet player icon...220
8. Create JavaScript code .........................................................................................222
9. Change css and image files to create another Internet radio player .................230
10. Create an Internet radio player with completely different functions and design233
11. Supplement..........................................................................................................233
5 Creating the Internet Radio Player Icon............................................... 234
What is an Internet Radio Player Icon? ..................................................................234
What is the Internet Radio Player Icon Generation Tool?......................................236
How Do you Start Up the Internet Radio Player Icon Generation Tool?...............237
How Do You Make the Internet Radio Player Icon That You Created Publicly
Available? ...................................................................................................................241
6 Appendix ................................................................................................242
Terms and Phrases That are Often Used ................................................................242
7 Update History
©SCEI PSP™ Internet Radio Player Development Guide
.......................................................................................244
- 5 -
1 About This Document
Overview
This document contains information that is needed to develop a PSP™ Internet radio player.
The procedure is explained through the use of sample programs and data.
Specifically, this document contains the following information.
z Overview of the structure and operation of an Internet radio player
z Procedure for developing an Internet radio player
z Extended JavaScript method reference
z Overview of Internet radio player icons and how to create them
Who Should Read This Document?
This document is intended for anyone who is interested in developing a PSP™ Internet radio
player.
For example, a broadcaster who provides an existing Internet radio service can develop a
special-purpose Internet radio player that receives their local broadcasts. Users who obtain
that Internet radio player will be able to listen to those broadcasts on the PSP™ Internet
radio.
In addition, a normal user who is not a broadcaster can create and release an Internet radio
player that has a unique user interface, is easier to use, or has features not found in the player
released by SCE.
The difference between the two types of Internet radio player software developers mentioned
above is that one type has broadcast station information from which the audio data stream is
transmitted and the other does not. Although the essential part of the Internet radio player
implementation will be exactly the same, the two implementations can result in different
amounts of JavaScript program code that must be written.
A person who is not a broadcaster (i.e. someone who is not personally broadcasting) must
©SCEI PSP™ Internet Radio Player Development Guide
- 6 -
somehow obtain broadcast station information. Both "Internet Radio Player I" and "Internet
Radio Player II" provided by SCE rely on the SHOUTcast and icecast.org protocols to
dynamically obtain this information. When a person who is not a broadcaster develops an
Internet radio player, that person must use this same process to obtain this information
dynamically.
Since broadcast station information by nature is constantly changing over time, having the
Internet radio player save this information either internally or externally is not recommended
because of the long-term maintenance and software stability problems it can create.
One method of addressing this problem is to have the JavaScript program code that forms the
Internet radio player dynamically collect the information. Another method would be to
perform this processing on a regular basis using a service such as cron, or to have it done at
some specific time using a cgi program running on the Web server where the Internet radio
player is located.
The second half of this document describes an example implementation in JavaScript for
performing this processing, similar to the method used by "Internet Radio Player I" and
"Internet Radio Player II".
A broadcaster should remove the JavaScript code that accesses the broadcast station database
from this example implementation.
Specific details concerning the implementation of a cgi program or cron job running on a Web
server have been omitted from this document.
This document assumes that readers have a basic knowledge of HTML, XML, JavaScript, Web
servers, and Internet radio.
What Specifically gets Created when an Internet Radio Player is Developed?
Developing an Internet radio player means creating the following two items.
z The Internet radio player itself
z An Internet radio player icon
©SCEI PSP™ Internet Radio Player Development Guide
- 7 -
The "Internet radio player" is made up of HTML, JavaScript, and image data. These comprise
the Internet radio GUI, which acts in conjunction with PSP™ system software to govern the
behavior of the Internet radio player.
Example of an Internet Radio Player GUI
©SCEI PSP™ Internet Radio Player Development Guide
- 8 -
The Internet radio player icon is used to launch the Internet radio player. It is displayed on
the XMB™ under the "Network" category, in the layer below "Internet radio".
The Internet radio player icon is created using a tool that is bundled with the SDK. This
document is also included in the SDK.
There is a 1-to-1 correspondence between an Internet radio player and an Internet radio
player icon.
Example of an Internet Radio Player Icon
©SCEI PSP™ Internet Radio Player Development Guide
- 9 -
Related Documents
For details concerning Internet browser specifications and related information, refer to the
following documents.
Internet Browser Specifications
Content Creation Guidelines for the PSP™ (PlayStation®Portable) Internet Browser
Protocols
[RFC2616] Hypertext Transfer Protocol – HTTP/1.1
PERSISTENT CLIENT STATE HTTP COOKIES
http://wp.netscape.com/newsref/std/cookie_spec.html
Markup Languages
HTML 4.01 Specification http://www.w3.org/TR/html401/
XHTMLTM 1.1 – Module-Based XHTML http://www.w3.org/TR/xhtml11/
XHTMLTM Basic http://www.w3.org/TR/xhtml-basic/
CSS
Cascading Style Sheets, level1 http://www.w3.org/TR/REC-CSS1
Cascading Style Sheets, level2 http://www.w3.org/TR/REC-CSS2/
JavaScript
Standard ECMA-262
http://www.ecma-international.org/publications/standards/Ecma-262.htm
icecast
http://www.icecast.org/docs.php
SHOUTcast
http://www.shoutcast.com/support/docs/
©SCEI PSP™ Internet Radio Player Development Guide
- 10 -
2 PSP™ Internet Radio Structure and Operation
The PSP™ Internet radio system is conceptually divided into the following three main
components.
1. An Internet radio player icon, which is displayed on the XMB™ as explained in the
previous chapter.
2. An Internet radio player, which appears as a GUI in the PSP™ Internet browser.
3. The SHOUTcast/icecast2 protocol handler, which receives SHOUTcast or icecast2
protocol audio data streams for playback.
The following figure shows the position of these three components within the entire Internet
radio player system.
©SCEI PSP™ Internet Radio Player Development Guide
- 11 -
PSP™ Internal
Ⓐ PSP ™ system (hardware)
The PSP™ (PlayStation®Portable) system.
Ⓑ PSP ™ system software
Includes the operating system, device drivers, audio decoders, network access libraries,
graphics libraries, and other basic software.
Ⓒ XMB ™
Xross media bar.
The XMB™ displays the Internet radio player icon under the "Network" category, in the
layer below "Internet radio". The XMB™ also displays information associated with the
Internet radio player icon and is responsible for launching the Internet radio player.
Ⓓ Internet browser
PSP™ Internet browser.
The functionality of the PSP™ Internet browser has been extended so that it works with
the Ⓔ SHOUTcast/icecast2 protocol handler. The Ⓖ Internet radio player can use
JavaScript methods to access this additional functionality for controlling the incoming
audio data stream and for obtaining additional information.
Ⓔ SHOUTcast/icecast2 protocol handler
The SHOUTcast/icecast2 protocol handler connects to the broadcast server, receives an
audio data stream that contains content meta information, then passes that stream to an
audio decoder to decode and output audio. The Ⓔ SHOUTcast/icecast2 protocol handler
has functions for parsing Playlist (PLS) data, and for creating a JavaScript String object
representing the response from an HTTP GET sent to an arbitrary URL.
In addition, the Ⓖ Internet radio player can interface with the JavaScript extended
methods provided by the Ⓓ Internet browser to obtain content meta information extracted
by the Ⓔ SHOUTcast/icecast2 protocol handler in the form of a JavaScript String object.
The complete system comprising these components Ⓐ to Ⓔ is referred to as the “PSP™
Internet radio player core system.”
©SCEI PSP™ Internet Radio Player Development Guide
- 12 -
PSP™ External
Ⓕ Internet radio player icon
A file containing data that is used for displaying the Internet radio player icon on the
XMB™.
The file is located in the "/PSP/RADIOPLAYER" directory on a Memory Stick Duo™. The
file extension is ".prs".
The data contains the following information (details described later).
z Name of Internet radio player (required)
z URL of Internet radio player (required)
z Icon image (optional)
z Icon focus image (optional)
z Comment about the Internet radio player (optional)
z URL of author's website (optional)
z Author's name (optional)
z Copyright information (optional)
The above information can be displayed from the Ⓒ XMB™.
The Internet radio player's author is responsible for creating the Internet radio player icon.
The Internet Radio Player SDK comes with a tool that can be used to create the icon. This
document is also included in the SDK.
Ⓖ Internet radio player
GUI of the PSP™ Internet radio player.
The GUI consists of HTML, JavaScript, and image files.
The Ⓓ Internet browser can control functions provided by the Ⓔ SHOUTcast/icecast2
protocol handler by invoking JavaScript methods defined in the Internet radio player.
These functions can be used to control the connection to a broadcast server. Information
obtained from the Ⓔ SHOUTcast/icecast2 protocol handler is displayed on-screen via the
Ⓓ Internet browser.
The Ⓖ Internet radio player is placed on a Web server provided by the Internet radio
player's author. The Ⓖ Internet radio player is a client-side application that runs on the
Ⓓ Internet browser. It is not a server-side application. Therefore, server-side scripts are
not necessary.
©SCEI PSP™ Internet Radio Player Development Guide
- 13 -
HINT
As described in Chapter 1, part of the processing of an Internet radio player can also be
implemented by a server-side cgi program or service such as cron.
Ⓗ Broadcast server
Distributes the SHOUTcast or icecast2 protocol audio data stream.
To receive an audio stream, the Ⓖ Internet radio player connects to the Ⓗ broadcast
server either by directly specifying its URL, or from information contained in playlist or
M3U data that points to the desired server.
Broadcast server URL information or playlist (PLS or M3U) information can be obtained
from the Stream Directory page administered by icecast.org or the SHOUTcast
SHOWCASE page administered by AOL.
©SCEI PSP™ Internet Radio Player Development Guide
- 14 -
The PSP™ Internet radio can also be implemented in JavaScript that describes the
information collection processing related to the Ⓗ broadcast server, using the Ⓓ Internet
browser and Ⓔ SHOUTcast/icecast2 protocol handler functions.
The following figure shows this type of implementation.
"Internet Radio Player I," which is an Internet radio player that SCE made publicly
available, uses SHOUTcast SHOWCASE information. Similarly, "Internet Radio Player II"
uses the Stream Directory of icecast.org.
The second half of this document describes a sample Internet radio player that uses the
Stream Directory of icecast.org.
《Ⓘ Broadcast station information database》
Database system containing broadcast station information used for distributing audio data
streams via the SHOUTcast or icecast2 protocols.
Specifically, this database system corresponds to the SHOUTcast SHOWCASE administered
by AOL and the Stream Directory administered by icecast.org.
Each database system has its own proprietary set of Web APIs. For details related to these,
refer to the documentation for the database system in use.
©SCEI PSP™ Internet Radio Player Development Guide
- 15 -
The Ⓖ Internet radio player uses these Web APIs to find specific broadcast stations such as
those offering a particular music genre. This information can be used to create a broadcast
station list.
This processing is performed by the part in the figure marked as "database accessor". However,
the database accessor is not a real entity, but rather an abstract entity defined in JavaScript.
It is a set of components that provide functions such as HTTP GET processing, string parsing,
and processing for generating an information array.
When the URL of the broadcast server is fixed such as when a broadcaster develops software
for a local station-specific Internet radio player, the database accessor and the Ⓘ broadcast
station information database are unnecessary.
©SCEI PSP™ Internet Radio Player Development Guide
- 16 -
The explanation below divides the interrelationships among resources related to PSP™
Internet radio into three main scenarios.
The PSP™ Internet radio can support all three of these scenarios.
Scenario 1: The broadcast content provider and the broadcast server provider create a
dedicated Internet radio player for receiving their own broadcasts
The scenario shown in this figure applies when a broadcaster creates a local station-specific
Internet radio player.
Since the broadcaster (= player author) knows the information required for the connection
such as the URL and port number of the broadcast server, the broadcast station information
database is unnecessary.
This information (which are default values) can be hardcoded into the Internet radio player.
The Internet radio player can also be implemented so that default information related to the
broadcast server is dynamically read by the Internet radio player from a separate file apart
from the html or JavaScript. In this case, the format of this file is arbitrary.
The Internet radio player can be implemented in this way without requiring any non-local
station resources.
©SCEI PSP™ Internet Radio Player Development Guide
- 17 -
Scenario 2: The broadcast station information database provider and the broadcast server
provider are the same
The scenario shown in this figure applies when the broadcast content provider is separate
from the broadcast server provider and the broadcast station information database provider.
Scenario 2 can has the same form as Scenario 3 where the broadcast station information
database provider, the broadcast server provider, the broadcast content provider, and the
Internet radio player provider are separate entities.
The "Broadcast client" in this figure refers to music player software such as Winamp and
plugin software for connecting to the broadcast server.
©SCEI PSP™ Internet Radio Player Development Guide
- 18 -
Scenario 3: The broadcast station information database provider, the broadcast server
provider, the broadcast content provider, and the Internet radio player provider are separate
entities
"Internet Radio Player I" and "Internet Radio Player II," which are provided by SCE, are
implementations based on this format.
©SCEI PSP™ Internet Radio Player Development Guide
- 19 -
3 Creating the Internet Radio Player
This chapter explains how to create the PSP™ Internet radio player, which was briefly
mentioned in Chapter 1.
As explained in the previous chapters, the PSP™ Internet radio player consists of HTML and
JavaScript. Some css and image files are also added as components to create the external
appearance of the Internet radio player and to increase maintainability. Since the Internet
radio player is created by the same process as creating an ordinary Web page, the effort
required is also the same.
However, an ordinary Web page alone cannot function as an Internet radio player.
Mechanisms for producing sound and for finding broadcast stations are required for it to
function as an Internet radio player.
To implement these capabilities on an ordinary Web page, 59 JavaScript extended methods
are provided as part of the PSP™ Internet radio system. These extended methods will give the
Web page the additional capabilities needed to function as an Internet radio player.
When the Internet browser is launched as a PSP™ Internet radio player from the Internet
radio icon under the "Network" category of the XMB™, this group of 52 extended methods is
added to the PSP™ Internet browser. When the browser is started up as a normal PSP™
Internet browser, this group of methods cannot be used.
Some of the principal extended methods include sysRadioPlayPls, which accesses a playlist file
to play audio, sysRadioPlayStream for directly connecting to a broadcast server, and
sysRadioPrepareForHttpGet, which accesses an arbitrary URL to perform an HTTP GET
operation.
By combining these extended methods, you can perform a series of functions such as: obtaining
broadcast station information from the Stream Directory page of icecast.org, parsing the
HTML or XML string that is obtained, constructing the URL for accessing the broadcast
station's playlist file, using the playlist's URL to connect to the broadcast server (audio data
stream server), and finally receiving the audio data stream.
The PSP™ Internet radio player is the entity that performs this processing, interacts with the
user, and displays information on-screen such as the broadcast station's name and the content
being played.
©SCEI PSP™ Internet Radio Player Development Guide
- 20 -
HINT
It is technically possible to receive a live audio data stream by invoking the action script
"Sound.loadSound()" on the Flash player within the PSP™ Internet browser, however,
proper operation is not currently guaranteed. This is because the Flash player that is
currently implemented in system software will continuously accumulate a received audio
data stream in the PSP™ system's internal memory. Therefore, playing (receiving) audio
using the Flash player's "Sound.loadSound()" will eventually cause an "Insufficient
memory" alert dialog to appear.
©SCEI PSP™ Internet Radio Player Development Guide
- 21 -
List of JavaScript Extended Methods
A list of extended JavaScript methods for the PSP™ Internet radio player is given below.
Methods for starting and stopping playback
Method Name Function
sysRadioPlayStream Start playback by specifying URL of audio data
stream
sysRadioPlayPls Start playback by specifying URL of PLS file
sysRadioPlayM3u Start playback by specifying URL of M3U file
sysRadioStop Stop playback
Methods for controlling output volume
Method Name Function
sysRadioSetMasterVolume Set master volume level
sysRadioSetSubVolume Set sub volume level
Methods for getting audio output level
Method Name Function
sysRadioGetLeftAudioPeakLevel Get peak audio level being output from audio left
channel.
Used for displaying audio level meter, etc.
sysRadioGetRightAudioPeakLevel Get peak audio level being output from audio
right channel.
Used for displaying audio level meter, etc.
sysRadioGetLeftAudioAverageLevel Get average audio level being output from audio
left channel.
Used for displaying audio level meter, etc.
sysRadioGetRightAudioAverageLevel Get average audio level being output from audio
right channel.
Used for displaying audio level meter, etc.
Methods for controlling sound effects
Method Name Function
sysRadioSetSineWaveOscillatorFrequencyAndVolume Set oscillation frequency and
volume level of sine wave
oscillator
sysRadioSetWhiteNoiseOscillatorVolume Set volume level of pseudo white
noise oscillator
sysRadioSetAudioShiftWidth Set shift width of audio frequency component
sysRadioSetAudioCutOffWidth Set cut-off width of audio frequency component
sysRadioSetAudioPitchShiftWidth Set pitch shift width of audio frequency
component
sysRadioPlayEffectSound Play sound effect
©SCEI PSP™ Internet Radio Player Development Guide
- 22 -
Methods related to "HTTP GET" processing
Method Name Function
sysRadioPrepareForHttpGet Prepare to perform HTTP GET for specified URL
sysRadioGetHttpGetStatus Report status of sysRadioPrepareForHttpGet
processing
sysRadioGetHttpGetResult Return sysRadioPrepareForHttpGet processing
result as string
sysRadioHttpGetTerminate Perform sysRadioPrepareForHttpGet
housekeeping
Method for getting internal status
Method Name Function
sysRadioGetPlayerStatus Get internal status of player system
Methods for getting playback quality numeric values and playback information strings
Method Name Function
sysRadioGetNetworkBandQuality Get communication circuit band quality
evaluation value
sysRadioGetAudioSoundDistortionRa
te
Get audio distortion rate (upper and lower limit
saturation frequency of sound)
sysRadioGetContentMetaInfo Get content meta information related to audio
data stream being played
sysRadioGetBitRate Get bit rate of audio data stream being played
sysRadioGetSamplingRate Get sampling rate value of audio data stream
being played
Methods for getting information related to audio data stream being played
Method Name Function
sysRadioGetStreamUrl Get URL of audio data stream being played
sysRadioGetStreamTitle Get title information of audio data stream being
played
sysRadioGetRelatedPageUrl Get related Web page URL string of audio data
stream being played
sysRadioGetStreamIpAddress Get IP address of broadcast server of audio data
stream being played
sysRadioGetStreamPort Get connection port number of broadcast server of
audio data stream being played
sysRadioGetStreamBufferLevel Get level indicating residual amount of audio data
stream buffer being played
©SCEI PSP™ Internet Radio Player Development Guide
- 23 -
Methods for finding files on the Memory Stick Duo™
Method Name Function
sysRadioPrepareForScanDir Prepare for directory entry scan on the
sysRadioScanDir Scan directory and return file entry (filename)
sysRadioGetMediaInOutStatus Detect whether a Memory Stick Duo™ was
String search processing methods
Method Name Function
sysRadioPrepareForStrOperation Prepare for string search or string extraction
sysRadioStrLength Nearly equivalent to JavaScript standard method
sysRadioStrIndexOf Nearly equivalent to JavaScript standard method
sysRadioStrSlice Nearly equivalent to JavaScript standard method
sysRadioStrCharCodeAt Nearly equivalent to JavaScript standard method
sysRadioStrOperationTerminate Terminate string search processing.
Memory Stick Duo™
that was found first.
For the second and subsequent calls, return the
file entry (filename) that was found next.
inserted or removed following previous
sysRadioPrepareForScanDir
processing
"length."
Returns string length as value in terms of bytes.
"indexOf."
Searches for string pattern.
"slice."
Extracts substring.
"charCodeAt."
Returns character code of specific position in
string.
String conversion processing methods
Method Name Function
sysRadioCharacterEntityConvert Convert characters that contain a character entity
name to an actual character
sysRadioCharacterCodeConvert Convert UTF-8 string to SJIS or EUC-KR string.
Methods for getting analog pad values
Method Name Function
sysRadioGetAnalogStickXValue Get analog stick's X value
sysRadioGetAnalogStickYValue Get analog stick's Y value
sysRadioGetAnalogStickAngleValue Get analog stick's angle value
sysRadioGetAnalogStickRadiusValue Get analog stick's radius value
©SCEI PSP™ Internet Radio Player Development Guide
- 24 -
Methods related to debug log console
Method Name Function
sysRadioSetDebugMode Set debug mode
sysRadioDebugLog Display string on debug log console
sysRadioSetDebugLogTextStyle Set debug log console's text style (typeface,
sysRadioClearDebugLog Clear strings displayed on debug log console
Miscellaneous
Method Name Function
sysRadioGetPlayerCoreVersionInfo Get Internet radio player system core version
sysRadioCapabilityCheck Get support information related to a specific
sysRadioGetStartButtonToggleStatus Get PSP™ system's START button toggle status
sysRadioBackLightAlwaysOn Control backlight's always on state when powered
sysRadioBusyIndicator Control busy indicator display at bottom left of
sysRadioCaptureScreenShot Capture screenshot
sysRadioSleep Set PSP™ system sleep mode
sysRadioGetSystemStatus Inquire about internal status of PSP™ system.
character color, background color, existence of
shadow, character align attribute)
information
function
by external power supply
screen
©SCEI PSP™ Internet Radio Player Development Guide
- 25 -
JavaScript Extended Method Reference Details
Descriptions of the individual extended JavaScript methods for the PSP™ Internet radio
player are presented below.
The description of each method contains a simple sample program that runs independently.
Programs that are almost identical to these sample programs are also provided on SCE's Web
server.
You can access this page and run these programs by using the special Internet radio player
icon sysRadio_method_sample.prs, which is included in the SDK that contains this document.
This icon was created to allow you to run the sample code.
©SCEI PSP™ Internet Radio Player Development Guide
- 26 -
sysRadioPlayStream
Start playback by specifying URL of audio data stream
Syntax
result = psp .sysRadioPlayStream (url, userAgentName)
Arguments
url
userAgentName
URL of playlist
User agent name used when performing HTTP GET for getting playlist
information
Return Value
0
-1
Description
This extended method connects to the broadcast server specified by url to play audio.
The user agent name specification argument is used for controlling the behavior of the
broadcast server.
If there is no free space in the JavaScript extended method processing queue, -1 is returned.
At this time, the processing request is ignored (discarded). As long as method calls of types
that are queued are not continuously issued (such as in an endless loop), this state does not
normally occur.
The following methods are types that are queued.
Method Names of Types That
are Queued
sysRadioPlayStream Starts playback by specifying URL of audio data stream
sysRadioPlayPls Starts playback by specifying URL of PLS file
sysRadioPlayM3u Starts playback by specifying URL of M3U file
sysRadioPrepareForHttpGet Prepares for performing HTTP GET for specified URL
sysRadioCaptureScreenShot Captures screenshot
Normal
Error
Overview
©SCEI PSP™ Internet Radio Player Development Guide
- 27 -
Example
HINT
If the broadcast server is accessed by the Internet browser using an ordinary user
agent name such as "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)," the audio data
stream may not be able to be received. When the broadcast server is accessed from the
Internet browser in this manner, it may just output a Web page for management.
var result = psp.sysRadioPlayStream
("http://radio.psp.dl.playstation.net:80"
+"/psp/radio/sample/pseudo_stream/teststream_a.stream.mp3",
"pspRadioPlayer");
This statement accesses the broadcast server
"http://radio.psp.dl.playstation.net:80/psp/radio/sample/pseudo_stream/teststream_a.strea
m.mp3" to play audio.
Sample
<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>sysRadioPlayStream</title>
</head>
<body>
<h1>sysRadioPlayStream</h1>
<script language="JavaScript">
<!--
window.onload = function () { setTimeout ('initProc ()', 500); }
function initProc () {
psp.sysRadioSetMasterVolume (255);
}
function test () {
psp.sysRadioPlayStream
("http://radio.psp.dl.playstation.net:80"
+"/psp/radio/sample/pseudo_stream/teststream_a.stream.mp3",
"pspRadioPlayer");
psp.sysRadioSetSubVolume (255);
©SCEI PSP™ Internet Radio Player Development Guide
- 28 -
}
// -->
</script>
<button onclick='test ();'>TEST</button>
<object name="psp" type="application/x-psp-extplugin"></object>
</body></html>
Note) The URL in the sample code accesses a "pseudo broadcast server" that was created
to run this sample code.
Since it is not a genuine SHOUTcast or icecast2 broadcast server, its behavior will differ
from an actual server in that playback always begins from the same timecode position
immediately after connection, for example.
See Also
sysRadioPlayPls, sysRadioPlayM3u, sysRadioStop,
sysRadioSetMasterVolume, sysRadioSetSubVolume,
sysRadioPrepareForHttpGet, sysRadioCaptureScreenShot
©SCEI PSP™ Internet Radio Player Development Guide
- 29 -
sysRadioPlayPls
Syntax
result = psp .sysRadioPlayPls (url, userAgentName0, userAgentName1)
Arguments
url
userAgentName0
userAgentName1
URL of playlist
User agent name used when performing HTTP GET for getting playlist
information
User agent name used when connecting to broadcast server
Start playback by specifying URL of playlist
Return Value
0
-1
Description
This extended method connects to the HTTP server specified by url to get playlist
information and connects to the broadcast server described in this playlist information to
play audio.
The two user agent name specification arguments are used to control the behavior of the
HTTP server and broadcast server.
A playlist that is handled by a PSP™ internet radio has the following format.
[playlist]
numberofentries=2
File1=http://radio.psp.dl.playstation.net/psp/radio/sample/pseudo_stream/teststream_a.stream.mp3
Title1=(#1 - 1/100) PSP Internet Radio Test Audio Stream [RADIO PSP]
Length1=-1
Browser1=
File2=http://radio.psp.dl.playstation.net/psp/radio/sample/pseudo_stream/teststream_b.stream.mp3
Title2=(#2 - 1/100) PSP Internet Radio Test Audio Stream [RADIO PSP]
Length2=-1
Browser2=
Version=2
Normal
Error
If there is no free space in the JavaScript extended method processing queue, -1 is returned.
©SCEI PSP™ Internet Radio Player Development Guide
- 30 -