-
Notifications
You must be signed in to change notification settings - Fork 0
Files
Matthew Martin edited this page Jun 9, 2020
·
3 revisions
Returns a list of the audio resources currently on the machine
Body: application/json
[
{
"label": string - a human readable title of the audio resource
"uid": string - the unique identifier for the audio resource
},
]
Uploads one audio resource to the machine
Body: multipart/form-data
- label - string - a human readable title of the audio resource
- description - string - a user entered description of the audio resource
- file - file - the file containing the audio
The audio resource has been uploaded successfully
Body: application/json
{
"result": boolean - true if this particular audio resource was uploaded,
"uid": string - the unique id of the resource if it was uploaded,
"details":
{
"channels": integer - the number of audio channels,
"created": string - iso date and time the resource was created,
"description": string - user entered description,
"format":
{
"subtype": string - the number of bits/sample and whether the sample is an int/float etc,
"type": string - the type of audio file (wav, mp3, flac etc)
},
"label": string - a human readable title,
"length": integer - length of the audio file in milliseconds,
"locked": boolean - true if the file is locked because it is playing or queued to play,
"path": string - the path to where the file lives on the Pi,
"samplerate": integer - the sample rate of the audio file in Hz,
"type": string - the resource type (either sndfile or mp3),
"uid": string - the unique id of the resource,
"valid": boolean - true if the file associated with the resource is valid audio
}
}
The data sent to the endpoint was incorrect ins some way
Body: application/json
{
"result": boolean - false,
"reason": [ an array of strings giving the reasons for the failure ]
}
An audio resource already exists on the server with the given label or the server could not create a unique id
Body: application/json
{
"result": boolean - false,
"reason": [ an array of strings giving the reasons for the failure ]
}
Returned when the system has been locked using the Status API endpoint
Body: application/json
{
"result": false,
"reason":
[
"the system is locked"
]
}