Revert "Remove audio path."
[toast/stream2beamer.git] / lagarde.py
index e9fca23f68b9ee02c66211575c3b662f2c31ffa6..faf833fa3b824d4d32994ad14492a7899d27755b 100755 (executable)
@@ -194,7 +194,20 @@ class WebRTCClient:
                 pad.link(q.get_static_pad('sink'))
                 q.link(conv)
                 conv.link(sink)
-                self.pipe.set_state(Gst.State.PLAYING)
+            elif name.startswith('audio'):
+                q = Gst.ElementFactory.make('queue')
+                conv = Gst.ElementFactory.make('audioconvert')
+                resample = Gst.ElementFactory.make('audioresample')
+                sink = Gst.ElementFactory.make('autoaudiosink')
+                self.pipe.add(q)
+                self.pipe.add(conv)
+                self.pipe.add(resample)
+                self.pipe.add(sink)
+                self.pipe.sync_children_states()
+                pad.link(q.get_static_pad('sink'))
+                q.link(conv)
+                conv.link(resample)
+                resample.link(sink)
 
     def set_remote_desciption_done(self, gst_promise):
         gst_promise = Gst.Promise.new_with_change_func(self.create_answer_done)