Coder Social home page Coder Social logo

psp-radio's Introduction

PSP Radio Emulator

A from-scratch implementation of the PSP Internet Radio player API, allowing the players to be used in a modern web browser.

What?!

The PSP, in firmware update 3.80, added support for Internet Radio players.

Sony provided a handful of players of their on, some of them mundane, and some of them quite novel. They generally tune to internet radio streams from Shoutcast or Icecast's registries.

The players actually run within the PSP's NetFront internet browser, but in a special mode where they're allowed to embed an application/x-psp-extplugin object, which then provides DOM methods for interacting with a non-JavaScript radio player implementation.

This project constitutes a reimplementation of the application/x-psp-extplugin's API in JavaScript, along with a wrapper for running and interacting with the radio players themselves. the ultimate shape of the wrapper is still to be determined, but whilst it is possible to run within a web browser, it imposes several limitations the original did not have.

How?

The radio players, at this stage, must be patched to embed the project's shim code. This is less of a problem now that Sony's original catalogue is down (Internet Archive link for your convenience)!

From there, we attach ourselves to the document in a few ways;

  1. Pretending the browser has the application/x-psp-extplugin plugin available
  2. Searching the document for any elements with an id, but no name, and copying the id value to the name so they become named properties of the document object
  3. Setting a global psp variable, which tricks some of the PSP's players into not actually embedding their application/x-psp-extplugin plugins, but just using that reference

Then, within the psp object, we keep a bunch of state and audio objects, so that we can respond to the players' requests to open streams and fetch data over HTTP. We also proxt HTTP requests via a cors proxy, as the Shoutcast and Icecast lookup APIs would otherwise be inaccesible to the web browser.

Finally, because web browsers' audio players do not expose any script-side access to the icy or other metadata from a Shoutcast stream, there is a method for polling a poorly-documented, and unfortunately poorly-supported metadata endpoint supported by some Shoutcast and Icecast servers.

What works? What's missing?

  • Loading Sony's players
    • SCE HTTP request API, rebuilt atop fetch
    • SCE String manipulation API, made no-op as UTF-8 conversion is not necessary
    • Streaming a radio station
    • Reading radio station metadata (Flaky)
    • Starting audio playback in Safari (with "allow all auto-play" set for the domain)
    • Starting audio playback in Firefox/Edge/Chrome (don't support the pls format, do seem to support MPEG streams, maybe conversion is possible?)
  • Full audio pipeline
    • Audio effects
    • Noise, sound effect and wave generator functions
      • Morse code generator in sine wave oscillator (I am not joking!)
    • Gain controls
    • Audio peak meter functions
  • Finalised UI
    • Determining if the audio pipeline is feasible on the web

psp-radio's People

Contributors

ticky avatar renovate-bot avatar dependabot[bot] avatar

Stargazers

Anne Thorpe avatar Taewoo Kim avatar  avatar LeLuCh B0Š¹ avatar Glas avatar

Watchers

 avatar

psp-radio's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm parcel-bundler Unavailable

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
psp-radio-api/package.json
  • entities ^2.0.0
  • pls ^0.1.3
  • @babel/cli 7.8.4
  • @babel/core 7.9.0
  • @babel/preset-flow 7.9.0
  • documentation 12.3.0
  • flow-bin 0.122.0
psp-radio-web/package.json
  • @babel/core 7.9.0
  • gh-pages 2.2.0
  • parcel-bundler 1.12.4
  • parcel-plugin-static-files-copy 2.3.1

  • Check this box to trigger a request for Renovate to run again on this repository

Implement audio playback in Firefox/Edge/Chrome

These browsers donā€™t support the pls playlist format, where Safari does. Theyā€™ll need an explicit pls parser, after which they should handle the references MPEG/AAC streams just fine.

May also require changes to how the metadata URL is stored and retrieved!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.