Created
November 18, 2014 20:22
-
-
Save markwingerd/632b7d5485a35ce57036 to your computer and use it in GitHub Desktop.
GStreamer Tutorial 1: Part 1/3 - Plays an mp3 file
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
import gst | |
# Create the pipeline for our elements. | |
pipeline = gst.Pipeline('pipeline') | |
# Create the elements for our project. | |
audio_source = gst.element_factory_make('filesrc', 'audio_source') | |
decode = gst.element_factory_make('mad', 'decode') | |
convert = gst.element_factory_make('audioconvert', 'convert') | |
equalizer = gst.element_factory_make('equalizer-3bands', 'equalizer') | |
audio_sink = gst.element_factory_make('autoaudiosink', 'audio_sink') | |
# Ensure all elements were created successfully. | |
if (not pipeline or not audio_source or not decode or not convert or | |
not equalizer or not audio_sink): | |
print 'Not all elements could be created.' | |
exit(-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment