Book Image

Python Multimedia

By : Ninad Sathaye
Book Image

Python Multimedia

By: Ninad Sathaye

Overview of this book

Multimedia applications are used by a range of industries to enhance the visual appeal of a product. This book will teach the reader how to perform multimedia processing using Python. This step-by-step guide gives you hands-on experience for developing exciting multimedia applications using Python. This book will help you to build applications for processing images, creating 2D animations and processing audio and video. Writing applications that work with images, videos, and other sensory effects is great. Not every application gets to make full use of audio/visual effects, but a certain amount of multimedia makes any application a lot more appealing. There are numerous multimedia libraries for which Python bindings are available. These libraries enable working with different kinds of media, such as images, audio, video, games, and so on. This book introduces the reader to the most widely used open source libraries through several exciting, real world projects. Popular multimedia frameworks and libraries such as GStreamer,Pyglet, QT Phonon, and Python Imaging library are used to develop various multimedia applications.
Table of Contents (13 chapters)
Python Multimedia Beginner's Guide
Credits
About the Author
About the Reviewers
Preface

Controlling playback


In an audio player, various options such as Play, Pause, Stop, and so on, provide a way to control the streaming audio. Such playback controls also find use in other audio processing techniques. We have already used some of the playback controls in Chapter 5, Working with Audios. In this chapter, we will study some more controlling options.

Play

In the previous chapter, we developed a preliminary command-line audio player using GStreamer. The audio streaming can be started by instructing the GStreamer pipeline to begin the flow of audio data. This was achieved by the following code:

self.pipeline.set_state(gst.STATE_PLAYING)

With the above instruction, the audio will be streamed until the end of the stream is reached. Refer to the code in the Playing Audio section of Chapter 5, Working with Audios to see what the surrounding code looks like. If you develop a user interface for a simple audio player, the "Play" button can be connected to a method that will set the state of...