@expertanalytics/request-raw-audio-components
v0.0.3
Published
Two React components for showing available audio files and requesting audio from an edge device by the Expert Analytics Audio Analytics project.
Downloads
2
Readme
Request Raw Audio Components
Two React components for showing available audio files and requesting audio from an edge device by the Expert Analytics Audio Analytics project.
Table of available raw audio
Example:
import { AudioTable } from "request-raw-audio-components";
function MyComponent() {
const audioFiles: AudioFile[] = [
{
"download_link": "https://s3....",
"start_time": "utc-start-time",
"end_time": "utc-end-time",
"data_id": "data-id"
}
]
return <AudioTable rows={audioFiles} />
}
Dialog Form for asking for raw audio
Pop up dialog for requesting raw audio.
import {
RawAudioFormValues,
RequestResponse,
RequestRawAudioDialog,
} from "request-raw-audio-components";
async function rawAudioRequestHandler(cals: RawAudioFormValues): Promise<RequestResponse> {
// implementation
}
function MyComponent() {
const [showRequestRawAudioDialog, setShowRequestRawAudioDialog] =
React.useState<boolean>(false);
const versions = useAudioVersions() // Get available versions of the runtime
return (
<RequestRawAudioDialog
open={showRequestRawAudioDialog}
setOpen={setShowRequestRawAudioDialog}
submitHandler={rawAudioRequestHandler}
runtimeVersions={versions ?? []}
defaultValues={{
startTime: timeseriesStartTime,
endTime: timeseriesEndTime,
edgeId: currentEdgeId,
projectId: projectId,
}}
/>
)