Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2010-04-03 20:14:13 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2010-04-03 20:14:13 (GMT)
commite93a2bc44827060e1b9608770c8b42a0b2d7bfe3 (patch)
treee085582cc744428a5a7c1c3a0f7261902a759d1b
parent20c21eb35fa72578821d1f016de2a49bd2513c39 (diff)
Record 64 does not record sound #1244
-rw-r--r--glive.py57
1 files changed, 20 insertions, 37 deletions
diff --git a/glive.py b/glive.py
index d681d44..a6bd46b 100644
--- a/glive.py
+++ b/glive.py
@@ -341,47 +341,30 @@ class Glive:
def startRecordingAudio(self):
logger.debug('startRecordingAudio')
- # XXX re-create pipe every time
- # to supress gst glitches during the second invoking
- if True:
- audio_pipe = \
- 'alsasrc ' \
- '! queue ' \
- '! audioconvert ' \
- '! vorbisenc name=vorbisenc ' \
- '! oggmux ' \
- '! filesink location=%s ' \
- % TMP_OGG
-
- if camera_presents:
- self.audio_pipe = gst.parse_launch( \
- '%s ' \
- '! queue ' \
- '! %s ' \
- '%s ' \
- % (self.src_str, self.play_str, audio_pipe))
- else:
- self.audio_pipe = gst.parse_launch(audio_pipe)
-
- def message_cb(bus, message, self):
- if message.type == gst.MESSAGE_ERROR:
- err, debug = message.parse_error()
- logger.error('audio_pipe: %s %s' % (err, debug))
+ audio_pipe = \
+ 'alsasrc ' \
+ '! audioconvert ' \
+ '! audio/x-raw-int,rate=16000,channels=1,depth=16 ' \
+ '! queue ' \
+ '! speexenc quality=2 name=vorbisenc ' \
+ '! oggmux ' \
+ '! filesink location=%s ' \
+ % TMP_OGG
- bus = self.audio_pipe.get_bus()
- bus.add_signal_watch()
- bus.connect('message', message_cb, self)
+ self.audio_pipe = gst.parse_launch(audio_pipe)
def process_cb(self, pixbuf):
- taglist = self.getTags(Constants.TYPE_AUDIO)
- cover = utils.getStringFromPixbuf(pixbuf)
- taglist[gst.TAG_EXTENDED_COMMENT] = 'coverart=%s' % cover
-
- vorbisenc = self.audio_pipe.get_by_name('vorbisenc')
- vorbisenc.merge_tags(taglist, gst.TAG_MERGE_REPLACE_ALL)
+ # XXX setting tags on fc9 crashes Record
+ #taglist = self.getTags(Constants.TYPE_AUDIO)
+ #cover = utils.getStringFromPixbuf(pixbuf)
+ #taglist[gst.TAG_EXTENDED_COMMENT] = 'coverart=%s' % cover
+ #vorbisenc = self.audio_pipe.get_by_name('vorbisenc')
+ #orbisenc.merge_tags(taglist, gst.TAG_MERGE_REPLACE_ALL)
self.pixbuf = pixbuf
- self._switch_pipe(self.audio_pipe)
+ if camera_presents:
+ self._switch_pipe(self.play_pipe)
+ self.audio_pipe.set_state(gst.STATE_PLAYING)
if camera_presents:
# take photo first
@@ -392,7 +375,7 @@ class Glive:
def stopRecordingAudio( self ):
logger.debug('stopRecordingAudio')
- self._switch_pipe(self.play_pipe)
+ self.audio_pipe.set_state(gst.STATE_NULL)
if (not os.path.exists(TMP_OGG)):
self.ca.m.cannotSaveVideo()