From e6485e4abea48c14adf1d8a3088f1861b5c1d06b Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sat, 15 Sep 2012 14:01:05 +0200 Subject: [PATCH] Add basic docs for Audio API, fixes #177. --- docs/api/audio.rst | 19 +++++++++++++++++++ docs/api/index.rst | 1 + mopidy/audio/__init__.py | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 docs/api/audio.rst diff --git a/docs/api/audio.rst b/docs/api/audio.rst new file mode 100644 index 00000000..d5fb5dd9 --- /dev/null +++ b/docs/api/audio.rst @@ -0,0 +1,19 @@ +.. _audio-api: + +********* +Audio API +********* + +The audio API is the interface we have built around GStreamer to support our +specific use cases. Most backends should be able to get by with simply setting +the URI of the resource they want to play, for these cases the default playback +provider should be used. + +For more advanced cases such as when the raw audio data is delivered outside of +GStreamer or the backend needs to add metadata to the currently playing resource, +developers should sub-class the base playback provider and implement the extra +behaviour that is needed through the following API: + + +.. autoclass:: mopidy.audio.Audio + :members: diff --git a/docs/api/index.rst b/docs/api/index.rst index b5be8ed4..618096ee 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -9,5 +9,6 @@ API reference models backends core + audio frontends listeners diff --git a/mopidy/audio/__init__.py b/mopidy/audio/__init__.py index 25c53c5a..dd98dfa8 100644 --- a/mopidy/audio/__init__.py +++ b/mopidy/audio/__init__.py @@ -208,6 +208,8 @@ class Audio(ThreadingActor): """ Call this to deliver raw audio data to be played. + Note that the uri must be set to ``appsrc://`` for this to work. + :param capabilities: a GStreamer capabilities string :type capabilities: string :param data: raw audio data to be played