Last active
November 16, 2023 09:22
-
-
Save wkf/5658578 to your computer and use it in GitHub Desktop.
Use gstreamer to generate raw LPCM audio files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requirements: | |
brew: http://mxcl.github.io/homebrew/ | |
xquartz: https://xquartz.macosforge.org/landing/ | |
brew install mad | |
brew install gstreamer | |
brew install gst-plugins-base | |
brew install gst-plugins-good | |
brew install gst-plugins-ugly | |
test pipeline (should just play a tone): | |
gst-launch-1.0 audiotestsrc ! audioconvert ! osxaudiosink | |
write out audio file to disk (using same tone): | |
gst-launch-1.0 audiotestsrc ! audioconvert ! capsfilter caps = "audio/x-raw,format=F32BE,channels=1,rate=44100" ! filesink location = "audio.raw" | |
read audio file from disk (should play the same tone): | |
gst-launch-1.0 filesrc location = "audio.raw" ! capsfilter caps = "audio/x-raw,format=F32BE,channels=1,rate=44100" ! audioconvert ! osxaudiosink | |
decode mp3 and write to disk: | |
gst-launch-1.0 filesrc location = shake.mp3 ! decodebin ! audioconvert ! capsfilter caps = "audio/x-raw,format=F32BE,channels=1,rate=44100" ! filesink location = "audio.raw" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@CAMOBAP did you find a way to encode/parse audio/x-raw to audio/x-lpcm in order to perform a successful link with elements which require audio/x-lpcm cap like mpegtsmux?