normalize and recompress shutter sound

This commit is contained in:
Andreas Frisch 2016-04-19 16:08:00 +02:00
parent f90d22abec
commit 64b7702e80
3 changed files with 6 additions and 6 deletions

BIN
shutter.m4a Normal file

Binary file not shown.

Binary file not shown.

View file

@ -10,7 +10,7 @@ from gi.repository import Gst, GObject, Gtk, GdkX11, Gdk, GstVideo
COUNTDOWN_SECONDS = 4 COUNTDOWN_SECONDS = 4
AUDIOFILE_COUNTDOWN = "beep.m4a" AUDIOFILE_COUNTDOWN = "beep.m4a"
AUDIOFILE_SHUTTER = "shutter.mp3" AUDIOFILE_SHUTTER = "shutter.m4a"
class GTK_Main: class GTK_Main:
@ -102,6 +102,7 @@ class GTK_Main:
self.countdown_timer = None self.countdown_timer = None
self.soundplayer = Gst.Pipeline.new("soundplayer") self.soundplayer = Gst.Pipeline.new("soundplayer")
self.audioplaybin = Gst.ElementFactory.make("playbin", "soundfile")
def start_stop(self, w): def start_stop(self, w):
if self.button_play.get_label() == "Start": if self.button_play.get_label() == "Start":
@ -120,10 +121,9 @@ class GTK_Main:
self.snapshot_label.set_halign(Gtk.Align.CENTER) self.snapshot_label.set_halign(Gtk.Align.CENTER)
self.snapshot_label.set_size_request(500, 300) self.snapshot_label.set_size_request(500, 300)
self.snapshot_label.get_style_context().add_class("snapshot_label") self.snapshot_label.get_style_context().add_class("snapshot_label")
self.audiplaybin = Gst.ElementFactory.make("playbin", "soundfile")
uri = 'file://'+os.path.abspath(AUDIOFILE_COUNTDOWN) uri = 'file://'+os.path.abspath(AUDIOFILE_COUNTDOWN)
self.audiplaybin.set_property('uri',uri) self.audioplaybin.set_property('uri',uri)
self.soundplayer.add(self.audiplaybin) self.soundplayer.add(self.audioplaybin)
self.soundplayer.set_state(Gst.State.PLAYING) self.soundplayer.set_state(Gst.State.PLAYING)
self.overlay.add_overlay(self.snapshot_label) self.overlay.add_overlay(self.snapshot_label)
self.overlay.show_all() self.overlay.show_all()
@ -142,7 +142,7 @@ class GTK_Main:
self.countdown_timer = None self.countdown_timer = None
self.soundplayer.set_state(Gst.State.READY) self.soundplayer.set_state(Gst.State.READY)
uri = 'file://'+os.path.abspath(AUDIOFILE_SHUTTER) uri = 'file://'+os.path.abspath(AUDIOFILE_SHUTTER)
self.audiplaybin.set_property('uri',uri) self.audioplaybin.set_property('uri',uri)
self.soundplayer.set_state(Gst.State.PLAYING) self.soundplayer.set_state(Gst.State.PLAYING)
self.overlay.remove(self.snapshot_label) self.overlay.remove(self.snapshot_label)