SoundMatchHTTPServer

This class runs a simple WSGI server that receives GET requests containing a path to an audio file to use as a sound target for synthesizer sound matching. It returns the parameter settings as JSON.

class spiegelib.network.SoundMatchHTTPServer(sound_matcher, address='localhost', port=8000)
Parameters
  • sound_matcher (SoundMatch) – SountMatch object to use

  • address (str, optional) – address to run server at. Defaults to localhost

  • port (int, optional) – port to run server at. Defaults to 8000

start()

Begin server

get(environ, start_response)

Process a GET request

static get_headers(response_body, mime_type)

Return headers for HTML

try_sound_match(query, start_response)

Trys to run a sound match given a query string

Parameters

query (dict) – Query string, which should contain a link to a target audio file