sample/audio-extract.rb in gstreamer-4.2.5 vs sample/audio-extract.rb in gstreamer-4.2.6
- old
+ new
@@ -26,12 +26,12 @@
sink = Gst::ElementFactory.make("appsink", nil)
raise "need appsink from gst-plugins-base" if sink.nil?
# See https://gstreamer.freedesktop.org/documentation/additional/design/mediatype-audio-raw.html
caps = Gst::Caps.new("audio/x-raw")
-caps.set_value("format", "F32LE")
-caps.set_value("rate", 16 * 1000)
-caps.set_value("channels", 1)
+caps["format"] = "F32LE"
+caps["rate", :int] = 16 * 1000
+caps["channels", :int] = 1
sink.caps = caps
sink.emit_signals = true
sink.signal_connect(:new_sample) do |_|
sample = sink.pull_sample