149 lines
4.1 KiB
YAML
149 lines
4.1 KiB
YAML
openapi: '3.0.2'
|
|
info:
|
|
title: Soundr
|
|
version: '1.0'
|
|
servers:
|
|
- url: http://localhost:8082/v1/
|
|
paths:
|
|
/play:
|
|
get:
|
|
summary: Plays a sound by it's base64'd name. Will load it to buffer first if not already loaded.
|
|
parameters:
|
|
- in: query
|
|
name: file
|
|
description: A base64 encoded version of the file name
|
|
schema:
|
|
type: string
|
|
- in: query
|
|
name: loop
|
|
description: Defaults to false; if true, will loop the sound until stopped
|
|
schema:
|
|
type: boolean
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: number
|
|
description: The ID of the playing sound
|
|
'400':
|
|
description: Bad Request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
reason:
|
|
type: string
|
|
description: The error message, in this case probably "file not found"
|
|
/buffer:
|
|
get:
|
|
summary: Loads a sound into the buffer.
|
|
parameters:
|
|
- in: query
|
|
name: file
|
|
description: A base64 encoded version of the file name
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
|
|
'400':
|
|
description: Bad Request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
reason:
|
|
type: string
|
|
description: The error message, in this case probably "file not found"
|
|
/bufferAll:
|
|
get:
|
|
summary: Loads all sounds into the buffer.
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
/stop:
|
|
get:
|
|
summary: Stops a given sound by it's ID.
|
|
parameters:
|
|
- in: query
|
|
name: id
|
|
description: The ID of the sound to stop
|
|
schema:
|
|
type: number
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
'400':
|
|
description: Bad Request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
reason:
|
|
type: string
|
|
description: The error message
|
|
/stopAll:
|
|
get:
|
|
summary: Stops all sounds.
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
/current:
|
|
get:
|
|
summary: Gets the current playing sound(s).
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
sounds:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: number
|
|
description: The ID of the sound
|
|
name:
|
|
type: string
|
|
description: The name of the sound
|
|
loaded:
|
|
type: boolean
|
|
description: Whether the sound is loaded into the buffer
|
|
/list:
|
|
get: # TODO REWORK!!!!!
|
|
summary: Lists all sounds in the buffer.
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
sounds:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: The name of the sound
|
|
base64:
|
|
type: string
|
|
description: The base64 version of the name
|
|
url:
|
|
type: string
|
|
description: The URL to the sound |