We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Calling the pause() function does not pause the playback
This [pause() function](https://github.com/MycroftAI/mycroft-core/blob/a9d627c979b98053719200c6084f3b31a9a97c62/mycroft/skills/audioservice.py#L83) does not have the desired effect of pausing the playback. 
`self.emitter.emit(Message('mycroft.sudio.service.stop'))`
This stops the playback, but the Audioservice does not expose a stop function. I could make the commit to add the stop() function if agreed upon.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mycroft/skills/audioservice.py`
Content:
```
1 # Copyright 2017 Mycroft AI Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #    http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15 import time
16 
17 from os.path import abspath
18 
19 from mycroft.messagebus.message import Message
20 
21 
22 def ensure_uri(s):
23     """
24         Interprete paths as file:// uri's
25 
26         Args:
27             s: string to be checked
28 
29         Returns:
30             if s is uri, s is returned otherwise file:// is prepended
31     """
32     if '://' not in s:
33         return 'file://' + abspath(s)
34     else:
35         return s
36 
37 
38 class AudioService():
39     """
40         AudioService object for interacting with the audio subsystem
41 
42         Args:
43             emitter: eventemitter or websocket object
44     """
45 
46     def __init__(self, emitter):
47         self.emitter = emitter
48         self.emitter.on('mycroft.audio.service.track_info_reply',
49                         self._track_info)
50         self.info = None
51 
52     def _track_info(self, message=None):
53         """
54             Handler for catching returning track info
55         """
56         self.info = message.data
57 
58     def play(self, tracks=[], utterance=''):
59         """ Start playback.
60 
61             Args:
62                 tracks: track uri or list of track uri's
63                 utterance: forward utterance for further processing by the
64                            audio service.
65         """
66         if isinstance(tracks, basestring):
67             tracks = [tracks]
68         elif not isinstance(tracks, list):
69             raise ValueError
70         tracks = [ensure_uri(t) for t in tracks]
71         self.emitter.emit(Message('mycroft.audio.service.play',
72                                   data={'tracks': tracks,
73                                         'utterance': utterance}))
74 
75     def next(self):
76         """ Change to next track. """
77         self.emitter.emit(Message('mycroft.audio.service.next'))
78 
79     def prev(self):
80         """ Change to previous track. """
81         self.emitter.emit(Message('mycroft.audio.service.prev'))
82 
83     def pause(self):
84         """ Pause playback. """
85         self.emitter.emit(Message('mycroft.audio.service.pause'))
86 
87     def resume(self):
88         """ Resume paused playback. """
89         self.emitter.emit(Message('mycroft.audio.service.resume'))
90 
91     def track_info(self):
92         """ Request information of current playing track.
93 
94             Returns:
95                 Dict with track info.
96         """
97         self.info = None
98         self.emitter.emit(Message('mycroft.audio.service.track_info'))
99         wait = 5.0
100         while self.info is None and wait >= 0:
101             time.sleep(0.1)
102             wait -= 0.1
103 
104         return self.info or {}
105 
106     @property
107     def is_playing(self):
108         return self.track_info() != {}
109
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mycroft/skills/audioservice.py b/mycroft/skills/audioservice.py
--- a/mycroft/skills/audioservice.py
+++ b/mycroft/skills/audioservice.py
@@ -72,6 +72,10 @@
                                   data={'tracks': tracks,
                                         'utterance': utterance}))
 
+    def stop(self):
+        """ Stop the track. """
+        self.emitter.emit(Message('mycroft.audio.service.stop'))
+
     def next(self):
         """ Change to next track. """
         self.emitter.emit(Message('mycroft.audio.service.next'))

{"golden_diff": "diff --git a/mycroft/skills/audioservice.py b/mycroft/skills/audioservice.py\n--- a/mycroft/skills/audioservice.py\n+++ b/mycroft/skills/audioservice.py\n@@ -72,6 +72,10 @@\n                                   data={'tracks': tracks,\n                                         'utterance': utterance}))\n \n+    def stop(self):\n+        \"\"\" Stop the track. \"\"\"\n+        self.emitter.emit(Message('mycroft.audio.service.stop'))\n+\n     def next(self):\n         \"\"\" Change to next track. \"\"\"\n         self.emitter.emit(Message('mycroft.audio.service.next'))\n", "issue": "Calling the pause() function does not pause the playback\nThis [pause() function](https://github.com/MycroftAI/mycroft-core/blob/a9d627c979b98053719200c6084f3b31a9a97c62/mycroft/skills/audioservice.py#L83) does not have the desired effect of pausing the playback. \r\n`self.emitter.emit(Message('mycroft.sudio.service.stop'))`\r\nThis stops the playback, but the Audioservice does not expose a stop function. I could make the commit to add the stop() function if agreed upon.\n", "before_files": [{"content": "# Copyright 2017 Mycroft AI Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nimport time\n\nfrom os.path import abspath\n\nfrom mycroft.messagebus.message import Message\n\n\ndef ensure_uri(s):\n    \"\"\"\n        Interprete paths as file:// uri's\n\n        Args:\n            s: string to be checked\n\n        Returns:\n            if s is uri, s is returned otherwise file:// is prepended\n    \"\"\"\n    if '://' not in s:\n        return 'file://' + abspath(s)\n    else:\n        return s\n\n\nclass AudioService():\n    \"\"\"\n        AudioService object for interacting with the audio subsystem\n\n        Args:\n            emitter: eventemitter or websocket object\n    \"\"\"\n\n    def __init__(self, emitter):\n        self.emitter = emitter\n        self.emitter.on('mycroft.audio.service.track_info_reply',\n                        self._track_info)\n        self.info = None\n\n    def _track_info(self, message=None):\n        \"\"\"\n            Handler for catching returning track info\n        \"\"\"\n        self.info = message.data\n\n    def play(self, tracks=[], utterance=''):\n        \"\"\" Start playback.\n\n            Args:\n                tracks: track uri or list of track uri's\n                utterance: forward utterance for further processing by the\n                           audio service.\n        \"\"\"\n        if isinstance(tracks, basestring):\n            tracks = [tracks]\n        elif not isinstance(tracks, list):\n            raise ValueError\n        tracks = [ensure_uri(t) for t in tracks]\n        self.emitter.emit(Message('mycroft.audio.service.play',\n                                  data={'tracks': tracks,\n                                        'utterance': utterance}))\n\n    def next(self):\n        \"\"\" Change to next track. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.next'))\n\n    def prev(self):\n        \"\"\" Change to previous track. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.prev'))\n\n    def pause(self):\n        \"\"\" Pause playback. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.pause'))\n\n    def resume(self):\n        \"\"\" Resume paused playback. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.resume'))\n\n    def track_info(self):\n        \"\"\" Request information of current playing track.\n\n            Returns:\n                Dict with track info.\n        \"\"\"\n        self.info = None\n        self.emitter.emit(Message('mycroft.audio.service.track_info'))\n        wait = 5.0\n        while self.info is None and wait >= 0:\n            time.sleep(0.1)\n            wait -= 0.1\n\n        return self.info or {}\n\n    @property\n    def is_playing(self):\n        return self.track_info() != {}\n", "path": "mycroft/skills/audioservice.py"}], "after_files": [{"content": "# Copyright 2017 Mycroft AI Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#    http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nimport time\n\nfrom os.path import abspath\n\nfrom mycroft.messagebus.message import Message\n\n\ndef ensure_uri(s):\n    \"\"\"\n        Interprete paths as file:// uri's\n\n        Args:\n            s: string to be checked\n\n        Returns:\n            if s is uri, s is returned otherwise file:// is prepended\n    \"\"\"\n    if '://' not in s:\n        return 'file://' + abspath(s)\n    else:\n        return s\n\n\nclass AudioService():\n    \"\"\"\n        AudioService object for interacting with the audio subsystem\n\n        Args:\n            emitter: eventemitter or websocket object\n    \"\"\"\n\n    def __init__(self, emitter):\n        self.emitter = emitter\n        self.emitter.on('mycroft.audio.service.track_info_reply',\n                        self._track_info)\n        self.info = None\n\n    def _track_info(self, message=None):\n        \"\"\"\n            Handler for catching returning track info\n        \"\"\"\n        self.info = message.data\n\n    def play(self, tracks=[], utterance=''):\n        \"\"\" Start playback.\n\n            Args:\n                tracks: track uri or list of track uri's\n                utterance: forward utterance for further processing by the\n                           audio service.\n        \"\"\"\n        if isinstance(tracks, basestring):\n            tracks = [tracks]\n        elif not isinstance(tracks, list):\n            raise ValueError\n        tracks = [ensure_uri(t) for t in tracks]\n        self.emitter.emit(Message('mycroft.audio.service.play',\n                                  data={'tracks': tracks,\n                                        'utterance': utterance}))\n\n    def stop(self):\n        \"\"\" Stop the track. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.stop'))\n\n    def next(self):\n        \"\"\" Change to next track. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.next'))\n\n    def prev(self):\n        \"\"\" Change to previous track. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.prev'))\n\n    def pause(self):\n        \"\"\" Pause playback. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.pause'))\n\n    def resume(self):\n        \"\"\" Resume paused playback. \"\"\"\n        self.emitter.emit(Message('mycroft.audio.service.resume'))\n\n    def track_info(self):\n        \"\"\" Request information of current playing track.\n\n            Returns:\n                Dict with track info.\n        \"\"\"\n        self.info = None\n        self.emitter.emit(Message('mycroft.audio.service.track_info'))\n        wait = 5.0\n        while self.info is None and wait >= 0:\n            time.sleep(0.1)\n            wait -= 0.1\n\n        return self.info or {}\n\n    @property\n    def is_playing(self):\n        return self.track_info() != {}\n", "path": "mycroft/skills/audioservice.py"}]}