Files
netris-nestri/packages/moq/karp/catalog/audio.ts
Wanjohi 379db1c87b feat: Add streaming support (#125)
This adds:
- [x] Keyboard and mouse handling on the frontend
- [x] Video and audio streaming from the backend to the frontend
- [x] Input server that works with Websockets

Update - 17/11
- [ ] Master docker container to run this
- [ ] Steam runtime
- [ ] Entrypoint.sh

---------

Co-authored-by: Kristian Ollikainen <14197772+DatCaptainHorse@users.noreply.github.com>
Co-authored-by: Kristian Ollikainen <DatCaptainHorse@users.noreply.github.com>
2024-12-08 14:54:56 +03:00

21 lines
532 B
TypeScript

import { type Track, decodeTrack } from "./track"
export interface Audio {
track: Track
codec: string
sample_rate: number
channel_count: number
bitrate?: number
}
export function decodeAudio(o: unknown): o is Audio {
if (typeof o !== "object" || o === null) return false
const obj = o as Partial<Audio>
if (!decodeTrack(obj.track)) return false
if (typeof obj.codec !== "string") return false
if (typeof obj.sample_rate !== "number") return false
if (typeof obj.channel_count !== "number") return false
return true
}