Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Implemented] Call recording for N900

    Closed Thread
    Page 10 of 13 | Prev |   8     9   10   11     12   | Next | Last
    gviterbo | # 91 | 2010-01-22, 09:17 | Report

    Originally Posted by spawn View Post
    i changed my version of recorder to encode files to flac format and added possibility to listen / delete recording after it's done.

    if anyone is interested recording using power button menu i could share
    this mod.
    +1 I want one too! Big thanks!

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by gviterbo; 2010-01-22 at 09:19.

     
    spawn | # 92 | 2010-01-22, 10:22 | Report

    here comes, requires some manual work & root privileges

    first creation of dirs
    Originally Posted by
    mkdir -p /usr/local/phone_recorder/bin
    mkdir /usr/local/phone_recorder/python
    then adding wrapper file:

    /usr/local/phone_recorder/bin/phone_recorder
    Code:
    #!/bin/sh
    exec python /usr/local/phone_recorder/python/phone_recorder.py
    and exec priv
    chmod 755 /usr/local/phone_recorder/bin/phone_recorder

    python file
    /usr/local/phone_recoder/python/phone_recoder.py
    Code:
    import gtk
    import hildon
    import time 
    import pygst
    pygst.require("0.10")
    import gst
    import os
    
    
    class Recorder(hildon.Program):
        def __init__(self):
            self.done=0
            if self.done>1:
                gtk.main_quit
    
            hildon.Program.__init__(self)
            gtk.set_application_name("Phone call record")
            self.program = hildon.Program.get_instance()
            
            self.window=hildon.StackableWindow()
            self.window.set_title("recorder")
            self.program.add_window(self.window)
            
            self.start=time.time()
            button=hildon.Button(gtk.HILDON_SIZE_AUTO, hildon.BUTTON_ARRANGEMENT_VERTICAL,"Recording...\nClick to stop")
            ts =  time.strftime("%Y%m%d_%H%M%S")
            self.fileName = "/home/user/MyDocs/record/Rec_%s.flac" % time.strftime("%Y%m%d_%H%M%S")
            self.player = gst.parse_launch ("adder name=theAdder ! flacenc ! filesink location=%s. pulsesrc device=sink.hw0.monitor ! queue ! theAdder. pulsesrc device=source.hw0 ! queue ! theAdder." % self.fileName)
            self.player.set_state(gst.STATE_PLAYING)
            button.connect("clicked", self.do_stop)
            self.window.add(button)
            self.done+1
    
        def select_event(self,tool,val):
            if val==0:
                gtk.main_quit()
            elif val==1:
                os.unlink(self.fileName)
            elif val==2:
                player = gst.parse_launch ("filesrc location=%s ! flacdec ! pulsesink" % self.fileName)
                player.set_state(gst.STATE_PLAYING)
                return 1
    
            gtk.main_quit()
    
             
        def do_stop(self,widget):
            self.done=1
            self.player.set_state(gst.STATE_NULL)
            now=time.time()
            window=hildon.StackableWindow()
    
            label=gtk.Label("Recording complete\nCreated file: %(fn)s\nrecorded total: %(sec)d sec" % {"fn": self.fileName,"sec" : (now-self.start)})
            window.add(label)
            label.show()
    
            toolbar = gtk.Toolbar()
            toolitem = gtk.ToolButton(gtk.image_new_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_LARGE_TOOLBAR),"Exit")
            toolitem.connect("clicked", self.select_event, 0)
            toolbar.insert(toolitem, 0)
            toolitem = gtk.ToolButton(gtk.image_new_from_stock(gtk.STOCK_DELETE,gtk.ICON_SIZE_LARGE_TOOLBAR),"Delete")
            toolitem.connect("clicked", self.select_event, 1)
            toolbar.insert(toolitem, 1)
            toolitem = gtk.ToolButton(gtk.image_new_from_stock(gtk.STOCK_MEDIA_PLAY,gtk.ICON_SIZE_LARGE_TOOLBAR),"Play")
            toolitem.connect("clicked", self.select_event, 2)
            toolbar.insert(toolitem, 2)
            window.add_toolbar(toolbar)
    
            window.connect("delete_event", gtk.main_quit, None)
            window.show_all()
            
        def run(self):
            self.window.show_all()
            gtk.main()
    
    prog=Recorder()
    prog.run()
    adding dbus service
    /usr/share/dbus-1/services/phone_recorder.service
    Code:
    [D-BUS Service]
    Name=com.misc.phone_recorder
    Exec=/usr/local/phone_recorder/bin/phone_recorder
    and finally editing of systemui.xml
    /etc/systemui/systemui.xml

    add this inside powerkeymeny tags.
    Code:
     <menuitem priority="750" name="Record">
        <callback service="com.misc.phone_recorder" path="/com/misc/phone_recorder"
        interface="com.misc.phone_recorder" method="record" bus="session"
        autostart="true">
         <argument type="boolean">true</argument>
        </callback>
     </menuitem>
    and reboot.

    ps. my very first python code ever, so most likely quite bad code

    pss. also create dir /home/user/MyDocs/record/
    with write privs to user or modify that file location.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by spawn; 2010-01-22 at 10:39.
    The Following 4 Users Say Thank You to spawn For This Useful Post:
    daperl, davall, go1dfish, iKneaDough

     
    qwerty12 | # 93 | 2010-01-22, 10:26 | Report

    Originally Posted by spawn View Post
    here comes, requires some manual work & root privileges

    first creation of dirs


    then adding wrapper file:

    /usr/local/phone_recorder/bin/phone_recorder

    and exec priv
    chmod 755 /usr/local/phone_recorder/bin/phone_recorder

    python file
    /usr/local/phone_recoder/python/phone_recoder.py


    adding dbus service
    /usr/share/dbus-1/services/phone_recorder.service


    and finally editing of systemui.xml
    /etc/systemui/systemui.xml

    add this inside powerkeymeny tags.


    and reboot.

    ps. my very first python code ever, so most likely quite bad code
    FWIW, if you create an osso.Context within the app, add the customary "#! /usr/bin/env python2.5" to the top and mark it as executable, then you don't need the script to start it.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to qwerty12 For This Useful Post:
    iKneaDough

     
    sxg75 | # 94 | 2010-01-22, 10:27 | Report

    Originally Posted by spawn View Post
    i changed my version of recorder to encode files to flac format and added possibility to listen / delete recording after it's done.
    Great! Would it be possible to share ideas with original author? The approach using Power button and lossless audio has great appeal!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to sxg75 For This Useful Post:
    iKneaDough

     
    spawn | # 95 | 2010-01-22, 10:31 | Report

    Originally Posted by qwerty12 View Post
    FWIW, if you create an osso.Context within the app, add the customary "#! /usr/bin/env python2.5" to the top and mark it as executable, then you don't need the script to start it.
    thanks, i'll make a not of that, so it works like a perl

    Edit | Forward | Quote | Quick Reply | Thanks

     
    addee | # 96 | 2010-01-22, 13:02 | Report

    I dont get it. I just saw and installed it from Application manager. But after installation there was no shortcut to it in menu.

    So unisntalled Python 2.5 that i installed yesterday, uninstalled Recaller. Now i can not find it in Application manager, even with a search?!?!?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    addee | # 97 | 2010-01-22, 13:35 | Report

    I click add Recaller Widget shortcut, but nothing happends. I only have one panel visible. Bugg?

    Tried making all panels visible but no change. It refuses to create the Widget/shortcut on the panel.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by addee; 2010-01-22 at 13:42.

     
    twaelti | # 98 | 2010-01-22, 14:24 | Report

    Originally Posted by addee View Post
    I click add Recaller Widget shortcut, but nothing happends. I only have one panel visible. Bugg?
    Reboot, then try again.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    twaelti | # 99 | 2010-01-22, 14:32 | Report

    Originally Posted by sxg75 View Post
    Great! Would it be possible to share ideas with original author? The approach using Power button and lossless audio has great appeal!
    Of course, I'm reading It looks to me like the FLAC encoder is new since PR1.1, at least I didn't see it before.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to twaelti For This Useful Post:
    iKneaDough

     
    daperl | # 100 | 2010-01-22, 15:15 | Report

    Then when we're done, we can throw some lipstick on that pig.

    Name:  Screenshot-20100122-070756.jpg
Views: 685
Size:  23.5 KB

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to daperl For This Useful Post:
    iKneaDough

     
    Page 10 of 13 | Prev |   8     9   10   11     12   | Next | Last
vBulletin® Version 3.8.8
Normal Logout