maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   How to: Stream music to your Linux PC from a phone via Bluetooth OBEX (https://talk.maemo.org/showthread.php?t=67181)

GameboyRMH 2010-12-19 19:17

How to: Stream music to your Linux PC from a phone via Bluetooth OBEX
 
Hey everyone, here's a quick script I came up with for playing music wirelessly on a Linux PC from your N900 (or any device that supports BT OBEX). All it does it pre-buffer it a bit in a temp directory, and then it passes the file to a media player (but don't try to seek back and forth). You either have to use a CLI or register the script with your PC's desktop manager somehow.

Code:

#! /bin/sh

rm -rf /tmp/obexplayer
mkdir /tmp/obexplayer
cp "$1" /tmp/obexplayer/ &
echo "Buffering for 8 seconds..."
sleep 8
vlc /tmp/obexplayer/"$1" &

Say you save this as ~/obexplay

This example uses VLC but you can change the last line to use your media player of choice.

So you mount your device via BT OBEX, open a terminal and cd to /home/username/.gvfs/devicename/path/to/music/ (your path may be different, this is what it is in Ubuntu)

(note that on an N900 you may have to customize your OBEX root symlinks to access the MicroSD)

Then enter:

~/obexplay musicfilename.mp3

And in a few seconds the music will start playing!


All times are GMT. The time now is 09:21.

vBulletin® Version 3.8.8