Villain In Glasses
Villain In Glasses
Explore posts from servers
SMSoftware Mansion
Created by Villain In Glasses on 7/3/2024 in #membrane-help
How do I invoke Pipeline.handle_info from a Phoenix.WebChannel?
Thank you so much! That worked 😄
9 replies
SMSoftware Mansion
Created by Villain In Glasses on 7/3/2024 in #membrane-help
How do I invoke Pipeline.handle_info from a Phoenix.WebChannel?
Nope, I updated the code to:
@impl true
def handle_init(_) do
spec =
child(:source, AudioTranscription.Source)
|> child(:sink, %Membrane.File.Sink{location: "output.wav"})

{[spec: spec], %{}}
end

@impl true
def handle_info(audio_data, ctx, state) do
# Process the audio data
{[notify_child: {:source, audio_data}], state}
end
@impl true
def handle_init(_) do
spec =
child(:source, AudioTranscription.Source)
|> child(:sink, %Membrane.File.Sink{location: "output.wav"})

{[spec: spec], %{}}
end

@impl true
def handle_info(audio_data, ctx, state) do
# Process the audio data
{[notify_child: {:source, audio_data}], state}
end
I'm still getting:
[error] <0.768.0>/ Error occured in Membrane Pipeline:
%Membrane.UnknownChildError{
message: "Child of name :source doesn't exist. Available children are [].\n"
[error] <0.768.0>/ Error occured in Membrane Pipeline:
%Membrane.UnknownChildError{
message: "Child of name :source doesn't exist. Available children are [].\n"
9 replies
SMSoftware Mansion
Created by Villain In Glasses on 7/3/2024 in #membrane-help
How do I invoke Pipeline.handle_info from a Phoenix.WebChannel?
Also, now I'm getting another error:
Error occured in Membrane Pipeline:
%Membrane.UnknownChildError{
message: "Child of name AudioTranscription.Source doesn't exist. Available children are [].\n"
}
Error occured in Membrane Pipeline:
%Membrane.UnknownChildError{
message: "Child of name AudioTranscription.Source doesn't exist. Available children are [].\n"
}
Is this the wrong way to define specify children?
@impl true
def handle_init(_) do
spec =
child(AudioTranscription.Source)
|> child(%Membrane.File.Sink{location: "output.wav"})

{[spec: spec], %{}}
end
@impl true
def handle_init(_) do
spec =
child(AudioTranscription.Source)
|> child(%Membrane.File.Sink{location: "output.wav"})

{[spec: spec], %{}}
end
9 replies
SMSoftware Mansion
Created by Villain In Glasses on 7/3/2024 in #membrane-help
How do I invoke Pipeline.handle_info from a Phoenix.WebChannel?
Oh, so that's how you use it. Thanks for the clarification.
9 replies