Skip to content

Commit

Permalink
Unlock WavPack codec for recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jun 21, 2021
1 parent eb5a7c8 commit 28ab60a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion saraswati/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ def add_channel(self, name: str, source: str):
# TODO: Add WavPack (wavpackenc)
# https://gstreamer.freedesktop.org/documentation/wavpack/wavpackenc.html
pipeline_expression = (
f"{source} ! audioconvert ! queue ! flacenc ! flactag ! flacparse ! "
# TODO: Make "codec" configurable.
#f"{source} ! audioconvert ! queue ! flacenc ! flactag ! flacparse ! "
f"{source} ! audioconvert ! queue ! wavpackenc ! " # ! wavpackparse
f"muxer.audio_0 splitmuxsink name=muxer muxer=matroskamux "
f"max-size-time={chunk_duration_ns:.0f} max-files={self.settings.chunk_max_files}"
)
Expand Down Expand Up @@ -217,6 +219,10 @@ def on_message(self, pipeline: Pipeline, bus, message):
logger.info("End of stream: {}".format(message))
pipeline.gst.set_state(Gst.State.NULL)

elif message.type == Gst.MessageType.WARNING:
err, debug = message.parse_warning()
logger.warning("Pipeline warning: {} ({})".format(err, debug))

elif message.type == Gst.MessageType.ERROR:
err, debug = message.parse_error()
logger.error("Pipeline error: {} ({})".format(err, debug))
Expand Down

0 comments on commit 28ab60a

Please sign in to comment.