maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Fm transmitter + play music at specified time? (https://talk.maemo.org/showthread.php?t=48227)

ToJa92 2010-03-24 18:58

Fm transmitter + play music at specified time?
 
Is that combo possible?

It's because I got a Philips Wake-up light, which has a FM receiver, and it plays the alarm sound(in this case a FM signal) a half hour before it gets to the max volume. Which means if I use the normal alarm it would shut off way before the time the alarm is at the max level.

festivalnut 2010-03-24 19:04

Re: Fm transmitter + play music at specified time?
 
its a combo i've been tring to work out too, but alas i'm a noob, any experts got a trick to make this happen please?

MohammadAG 2010-03-24 19:09

Re: Fm transmitter + play music at specified time?
 
You could make a script that turns on the FM transmitter and plays a sound, and open terminal and type sleep <time> && sh <script filename>
pseudo code:
#!/bin/sh
dbus command to activate FMTX
play-sound <soundfile>

qwerty12 2010-03-24 19:12

Re: Fm transmitter + play music at specified time?
 
Quote:

Originally Posted by MohammadAG (Post 580834)
dbus command to activate FMTX

fmtx_client -p1

Patola 2010-03-24 19:13

Re: Fm transmitter + play music at specified time?
 
Yes. Schedule with fcron, use play-sound to play the file and turn the transmitter on/off with the lines I added to the Phone control page.

festivalnut 2010-03-24 19:22

Re: Fm transmitter + play music at specified time?
 
wow, quick response, thanks guys! but before i go getting annoyed at my command line ineptitude... <time> is this referring to wake up time, time from now til wake up, and what format would i use? i assume <script filename> is the name of whatever script i'm apparently compiling using the pseudo code? and i'm also guessing i dont need super user for this? sorry if i'm a bit slow still new to linux and n900

MohammadAG 2010-03-24 19:23

Re: Fm transmitter + play music at specified time?
 
Code:

#!/bin/sh
fmtx_client -p1
play-sound /usr/share/sounds/ui-wrong_charger.wav

Save it as alarm.sh
Change the sound to whatever file you want
Chmod +x it:
Code:

chmod +x alarm.sh
Then run it as root
Code:

sleep <time-in-seconds> && sh alarm.sh
Edit: took a look at fxtx_client
You can change the code to fmtx_client -p1 -f(frequency) to something you know won't be covered by another radio station, that way you don't have to set the FMTX every time you go to bed, and you don't have to set the clock each time.

You can also install fm-boost and make it boost
.
Code:

#!/bin/sh
fmtx_client -p1
fm-boost
# sleep is to make sure boost works
sleep 3
play-sound /usr/share/sounds/ui-wrong_charger.wav

Edit 2: you owe qwerty12 a thanks :)

festivalnut 2010-03-24 19:38

Re: Fm transmitter + play music at specified time?
 
thanks sent! now i'm gonna boldly dive into xterm like a 14 year old virgin and hope i dont end up embarrasing myself! :D

ToJa92 2010-03-24 19:39

Re: Fm transmitter + play music at specified time?
 
Now, can I play a whole album? I guess I just set several play-sound's? Or can I set a playlist? Also, is cron available in maemo?

festivalnut 2010-03-24 20:25

Re: Fm transmitter + play music at specified time?
 
okay i seem to be halfway there, compiled script, chmod'd it (whatever the hell that is!) ran it, fm transmitter comes on but i get an error message along the lines of Home directory /home/user not ours. i noticed your code has the sound file under usr/share... do i have to copy my sounds to that location rather than MyDocs? and if so is that a good idea? or if not wtf have i done wrong?


All times are GMT. The time now is 16:55.

vBulletin® Version 3.8.8