I'm working with audio files / streaming where I have to process audio chunks of Float32 array types. I have not tried but I was wondering if this was possible or supported in Convex or if there is a work around.
I have a separate server (Hono) that can process the audio chunk array and return data. I intend to keep this server "private" / "hidden", that is I do not want to interact with the server directly from the client so I can take advantage of authentication that is already set in convex. I want to use a server-server communication.
The GOAL: I call an action from convex, convex calls this server. I already use this server with my convex setup for HTTP calls where the arguments are strings. Within the convex action I make a POST request to this server to get data. Works fine.
The external server has 2 open endpoints...
- One is a HTTP endpoint that I can call POST, GET etc on
- The other is a Websocket connection that accepts a Float32 array
Since convex has an open Websocket connection (I stand to be corrected), I thought I could do the same thing I did with the HTTP endpoint, have a convex action that can call this Websocket connection, most importantly, I need a bi-directional connection between client -> convex -> custom server over websockets.
First concern, convex arguments. I can use v.any() but would a Float32 array work?
P.S: I have not implemented any of this yet, I'm evaluating possibilities to see the best approach. Most importantly I do not want to expose this custom server to the client, if I do, I have to implement authentication on it, this is why I'm looking for a solution that would allow me pass this request via Convex.
Open to ideas and suggestions.