Hello everyone!
I’m wondering if I could get some guidance on recording audio directly from the browser. I’m building a LiveView app where I need to store audio notes from users. So, I need to be able to “listen” and store those audios on the server. Are there any existing apps or could anyone help me with the “first steps” to accomplish this requirement?
Thanks a lot!
There are a handful of examples that will likely help in this thread:
Hi, I put them in context about my doubt in the phoenix documentation I find the following code (Phoenix.Channel — Phoenix v1.7.2 )
def handle_in("file_chunk", {:binary, chunk}, socket) do
...
{:reply, :ok, socket}
end
but the truth is that I am not being able to use it for what I need, which is to send audio captured by the microphone from the js client.
What I would be most interested in knowing is if there is any book or documentation that explains how to handle binary audio and video d…
For instance, check out this single-file app that handles recording & transcription:
Application.put_env(:sample, PhoenixDemo.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 8080],
server: true,
live_view: [signing_salt: "bumblebee"],
secret_key_base: String.duplicate("b", 64),
pubsub_server: PhoenixDemo.PubSub
)
Mix.install([
{:plug_cowboy, "~> 2.6"},
{:jason, "~> 1.4"},
{:phoenix, "1.7.10"},
{:phoenix_live_view, "0.20.1"},
# Bumblebee and friends
{:bumblebee, "~> 0.5.0"},
{:nx, "~> 0.7.0"},
{:exla, "~> 0.7.0"}
])
Application.put_env(:nx, :default_backend, EXLA.Backend)
This file has been truncated. show original
2 Likes