Active Topics

 


Reply
Thread Tools
Posts: 41 | Thanked: 8 times | Joined on Mar 2008
#1
I'm trying to set up my N800 to do timed fm recording. So far I can record from the fm radio using maemo recorder and aumix. To automate this I plan on using cron. I can start maemo recorder but I can't figure out how to get it to record from a command.

Does anyone know how to do this? Thanks.
 
Posts: 183 | Thanked: 115 times | Joined on Nov 2007 @ Seattle, WA
#2
Why not use mplayer?
 
Posts: 41 | Thanked: 8 times | Joined on Mar 2008
#3
Well, I thought mplayer was just a player! After reading through the manual, I see it can do lots of things. I'm not sure if all the options are available with the Maemo version and if the radio on the N800 is V4L compatible or not. I just need to find time to play around with it.

Thanks for the suggestion.
 
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#4
The FM radio is V4L2 compatible. You can also use pyfmradio for fully controlling the radio with Python.
See http://pyfmradio.garage.maemo.org
 

The Following User Says Thank You to pycage For This Useful Post:
speculatrix's Avatar
Posts: 880 | Thanked: 264 times | Joined on Feb 2007 @ Cambridge, UK
#5
Originally Posted by pycage View Post
The FM radio is V4L2 compatible. You can also use pyfmradio for fully controlling the radio with Python.
See http://pyfmradio.garage.maemo.org
thanks for this. problem: I can tune in BBC R2 at 90.10 with a good signal, but when I run the example program, it immediately terminates:

/usr/local/pyFMRadio-0.22 $ ./example.py 90.10
/usr/local/pyFMRadio-0.22 $ Frequency range: 87.50 - 108.00 MHz
scanning @ 87.50 MHz
No radio stations found. The signal is too weak.
Switching off the radio.


any clues? thanks!
 
icebox's Avatar
Posts: 282 | Thanked: 120 times | Joined on Nov 2007
#6
did you manage to use mplayer to record? if you did what command line did you use? how's the quality?

thanks.
 
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#7
pyfmradio is not a ready-made application. The example script just demonstrates its usage. Also be sure to have a headphones cable plugged in. Otherwise it won't be able to find any stations.

Here's an example:

Code:
from FMRadio import FMRadio
import time

radio = FMRadio()
radio.set_volume(100)
radio.set_frequency(90.10)

try:
    while (True): time.sleep(0.1)
except KeyboardInterrupt:
    # be sure to switch off the radio after usage, or it will drain battery
    radio.close()
 
speculatrix's Avatar
Posts: 880 | Thanked: 264 times | Joined on Feb 2007 @ Cambridge, UK
#8
aha, that works. well, sort of, it turns the sound on! oddly, volume 100 in pyFMR is much much louder than I can get the tablet set to, which is about 65.

it doesn't set the station, I get this:
# ./example.py
Frequency range: 87.50 - 108.00 MHz
Traceback (most recent call last):
File "./example.py", line 39, in <module>
radio.set_frequency(90.10);
File "/usr/local/pyFMRadio-0.22/FMRadio.py", line 279, in set_frequency
assert(freq == 0 or low <= freq <= high)
AssertionError


this also happens if I try freq 96.00, so it's not the numeric value!
 
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#9
Oops, my mistake. Multiply by 1000. The radio expects KHz units.
So it's
Code:
radio.set_frequency(90.10 * 1000)
 
speculatrix's Avatar
Posts: 880 | Thanked: 264 times | Joined on Feb 2007 @ Cambridge, UK
#10
ah, much better, thanks. using "96 x 1000" doesn't barf...

# ./example.py
Frequency range: 87.50 - 108.00 MHz
scanning @ 87.50 MHz
No radio stations found. The signal is too weak.
Switching off the radio.


I'd expect to see no signal, I'm at work and the building is very well screened, will try at home.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:19.