Client API should request utterance audio and synthesis metadata from UtteranceStore rather than directly communicating with Speechoid. This includes switching from accepting text input from client (although we might keep that feature for other reasons) to accepting segment hashes and page identity as client API arguments.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Connect API to utterance store | mediawiki/extensions/Wikispeech | master | +386 -31 | |
| Create database for utterance data | mediawiki/extensions/Wikispeech | master | +1 K -9 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | • kalle | T249200 Connect API to utterance store | |||
| Resolved | • kalle | T248469 Create database for utterance data | |||
| Resolved | • kalle | T248472 Create segment hasher | |||
| Resolved | HaraldBerthelsen | T246087 Replace url with audio data in Speechoid |
Event Timeline
Change 596676 had a related patch set uploaded (by Karl Wettin (WMSE); owner: Karl Wettin (WMSE)):
[mediawiki/extensions/Wikispeech@master] Create database for utterance data
To run swift on local machine via Docker try this:
kalle@musa:~$ docker run -v /srv --name SWIFT_DATA busybox Unable to find image 'busybox:latest' locally latest: Pulling from library/busybox d9cbbca60e5f: Pull complete Digest: sha256:836945da1f3afe2cfff376d379852bbb82e0237cb2925d53a13f53d6e8a8c48c Status: Downloaded newer image for busybox:latest kalle@musa:~$ ID=$(docker run -d -p 12345:8080 --volumes-from SWIFT_DATA -t morrisjobke/docker-swift-onlyone)
It can be reached from Vagrant on 10.11.12.1:12345
"WikispeechUtteranceFileStore": {
"description": [
"Connection details for utterance audio and metadata store.",
"Set type to 'Swift', 'FileSystem' or 'RAM'."
],
"value": {
"type": "Swift",
"swiftAuthUrl": "http://10.11.12.1:12345/auth/v1.0",
"swiftUser": "test:tester",
"swiftKey": "testing",
"fileSystemBasePath": "/tmp/wikispeech_utterances"
}
}This patch doesn't actually do anything with the API, i.e. where data is retrieved from Speechoid and passed down to the user as we (read: I) haven't upgraded the dev-server.
It does however contain all preparations to retrieve and store the data from FileBackend in the new class Utterances.
class Utterances {
...
public function createUtterance( $page_id, $language, $voice, $segment_hash,
$audioBase64, $audioMetadata ) {
...
public function findUtterance( $page_id, $language, $voice, $seg_hash ) {We do not want to work with base64 encoded strings for audio data. I'm just not sure how to handle this is raw binary data in PHP. It should however be a quick fix to switch to that, i.e. rename parameters and ensure it fits in the content-string passed down to FileBackend. One alternative to the content-string is to write a local file and use the copy-local-file-operation in FileBackend.
Is this possibly blocked by T248162: Use revision and segment ID as input for synthesizing speech
Change 596676 merged by jenkins-bot:
[mediawiki/extensions/Wikispeech@master] Create database for utterance data
Change 607285 had a related patch set uploaded (by Karl Wettin (WMSE); owner: Karl Wettin (WMSE)):
[mediawiki/extensions/Wikispeech@master] Connect API to utterance store
I updated the task as previous title and description was a comment on the code implemented in the UtteranceStore, https://gerrit.wikimedia.org/r/c/596676, which is already merged to master.
Store data from Speechoid response as files. Use [[ https://doc.wikimedia.org/mediawiki-core/master/php/classFileBackend.html | FileBackend ]] for this. This should work with audio as data in the response (T246087). The files to store are: # The audio # Related data, currently tokens, as JSON
Change 607285 merged by jenkins-bot:
[mediawiki/extensions/Wikispeech@master] Connect API to utterance store