Reply
Thread Tools
Posts: 669 | Thanked: 433 times | Joined on May 2010
#1
I am trying to make a python script work and record phone sound to aac file. this is the script:
-----------------------
import gst
import time
import os

bin = gst.element_factory_make("camerabin")
bin.set_property("audioenc", gst.element_factory_make("nokiaaacenc"))

bin.set_state(gst.STATE_PLAYING)
bin.set_property("filename", "/home/user/MyDocs/current.aac")
bin.set_property("mode",1)
#starts recording
bin.emit("user-start")

time.sleep(30)

# stops recording
bin.emit("user-stop")
bin.set_state(gst.STATE_PAUSED)
bin.set_state(gst.STATE_NULL)
-----------------------
first issue - for some reason, no "current.aac" file is being created - even though the script seems to run with no errors.

second issue i have is that executing this script opens a window in n900 and i would like to avoid it.

Any help will be appreciated.
 

The Following User Says Thank You to impeham For This Useful Post:
low's Avatar
Posts: 36 | Thanked: 57 times | Joined on Jun 2012
#2
That there's a window opening is because you're pretty much just launching the camera ui to record something. I doubt that you can avoid this if you don't use a real commandline utility... does lame or so run on Maemo?

Did you try Recaller? Maybe that thing can be remote-controlled or even auto-triggered?

Please be aware of legal implications of secretly recording someone's private conversations.

Kind regards,

Sarah
 

The Following User Says Thank You to low For This Useful Post:
low's Avatar
Posts: 36 | Thanked: 57 times | Joined on Jun 2012
#3
regarding commandline foo, see the thread on call recording for some inspiration how to access the sound system from teh commandline.

o.O really wondering what you are planning to do with that thing
 

The Following User Says Thank You to low For This Useful Post:
Posts: 1,994 | Thanked: 3,342 times | Joined on Jun 2010 @ N900: Battery low. N950: torx 4 re-used once and fine; SIM port torn apart
#4
If you are launching your script from a desktop shortcut, then in /usr/share/applications/hildon/xyz.desktop, type this line: "X-App-Loading-Image=none". Then it will not attempt to launch a window when you click the shortcut.
I know recaller, I use recaller, but I would gladly find something more directly connecting to the audio, if possible. Shortcut instead of widget, bash script instead of python...
Thank you. Best wishes.
_________________
Per aspera ad astra...
 
Posts: 669 | Thanked: 433 times | Joined on May 2010
#5
the problem i have with recaller is that sometimes it makes hildon desktop stuck (the green icon does not change back to red at the end of a call) and then i have to restart the UI services.

I thought about making a recording script and attach it to dbus scripts when a call starts/ends and avoid widget changes.
 
Posts: 669 | Thanked: 433 times | Joined on May 2010
#6
Originally Posted by low View Post
That there's a window opening is because you're pretty much just launching the camera ui to record something. I doubt that you can avoid this if you don't use a real commandline utility... does lame or so run on Maemo?

Did you try Recaller? Maybe that thing can be remote-controlled or even auto-triggered?

Please be aware of legal implications of secretly recording someone's private conversations.

Kind regards,

Sarah
what should be instead of "camerabin" in order to record from the calls? tried to look for this in the net but got to a dead end...
 
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#7
Originally Posted by impeham View Post
the problem i have with recaller is that sometimes it makes hildon desktop stuck (the green icon does not change back to red at the end of a call) and then i have to restart the UI servicesservice
Hey impeham,
idk a solution/answer to your original problem.
But maybe at least an explanation/workaround for your desktop thing:
http://talk.maemo.org/showthread.php?p=1298457
better start from here.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following User Says Thank You to peterleinchen For This Useful Post:
Posts: 669 | Thanked: 433 times | Joined on May 2010
#8
Originally Posted by peterleinchen View Post
Hey impeham,
idk a solution/answer to your original problem.
But maybe at least an explanation/workaround for your desktop thing:
http://talk.maemo.org/showthread.php?p=1298457
better start from here.
Thanks

Testing the script right now
 
Posts: 669 | Thanked: 433 times | Joined on May 2010
#9
This script works well but it is a bad workaround to the main problem.
i added its execution to the call end dbus event, and in most cases it works - in some it doesn't, but the main issue is that it is reproducible almost every time when the calls end (my recorder widget is configured to record all calls automatically). if i disable the recording it does not happen again.

I want to make a script to record the calls myself and stop using this widget. If anyone knows what modifications i need to do to the script posted in the 1st post it will be great.
 
Reply


 
Forum Jump


All times are GMT. The time now is 23:27.