3.10 Web import

The URI scheme soundpad:// can be used to add sounds from a website to Soundpad.

Soundpad only supports downloads from HTTP and HTTPS sources.
Requires Soundpad v4.0.0 or newer.

3.10.1 Direct file download

soundpad://sound/url/https://www.leppsoft.com/download/sound.mp3

3.10.2 Download with filename

soundpad://sound/url/https://www.leppsoft.com/download/sound/internal-sound-id/

Sample PHP web code:
    $filename = "你好声音.mp3";
    $file = "/some/directory/on/the/server/".$filename;
    if (file_exists($file)) {
        header("Content-type: application/octet-stream");
        header("Content-Length: ".filesize($file));
        header("Content-Disposition: attachment; filename*=UTF-8''".rawurlencode($filename));
        echo file_get_contents($file);
    }

Requires the header Content-Disposition to be set.

It can be simple e.g. Content-Disposition: attachment; filename=sound.mp3
or better
UTF-8: Content-Disposition: attachment; filename*=UTF-8''%E4%BD%A0%E5%A5%BD%E5%A3%B0%E9%9F%B3.mp3

3.10.3 Misc

Downloaded sounds are saved in the directory, that the user specified at File ▶ Preferences ▶ Recorder ▶ Save recordings in.

Errors

Possible errors are:

  • Error when importing files: File format is not supported.
    Occurs if
    • the Content-Disposition isn't set or contains malicious elements like invalid file name characters (/:*? etc.).
    • the filename doesn't end with one of the supported formats like mp3.
    • the file content isn't supported, similar as if the file is downloaded by the browser and then added to Soundpad.
  • Error when importing files: Call has wrong format: %the call%
    Occurs if
    • the call isn't recognized.
    • an older version of Soundpad is used. This interface was introduced in v4.0.0.
  • Error when importing files: Download failed: HTTP-404