View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Thu Dec 29, 2005 5:53 pm Post subject: Problems with stdin module and song titles in client |
|
|
Hi
I set up my icecast today and it works fine. Because all my music is in mp3 i decided to use the stdin module from ices2. I call ist like this
Code: |
sox file.mp3 -t wav -r 44100 -c 2 -w - | ices file.xml |
In the file.xml i use the metadatafilename parameter to read the info. This works grat for one song.
After this i created a little script that does the above for every mp3 file in a directory and before it writes the current info to the metafile. But when the first song is finished an the next is played my winamp stops. I have to push the play button again. The connection is lost after each songchange. Is it posible to restart the ices whithout that behavioure of the client ?
After this i changed my script that the recoded mp3 data is piped continously to ices and the metafile is changed when a new mp3 file begins. But now the continouing ices does not recognize the rewritten metafile. The client is playing song after song without interuption but the songtitle does not change. I tried to sighup the ices proces but it does not work. Is the a solution for this?
By
Marcus |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Dec 30, 2005 12:49 am Post subject: |
|
|
you can, but you have to prevent the EOF condition being passed through the pipe. An extension of your one-liner is to make a program (eg a script which loops) that dumps out PCM on its stdout and run that program
a simple demo program could be:- decode_my_files
Code: |
#!/bin/sh
cd /place/of/mp3/files
for f in *.mp3; do
# fill out metadata file based on $f
sox "$f" -t wav -r 44100 -c 2 -w -
done
|
then run decode_my_files | ices file.xml
karl |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Fri Dec 30, 2005 11:57 am Post subject: |
|
|
Hi
Yes this works for the loosing connection problem. The winamp is conitinouing playing after the song-change. But the title and artist displayed in the client ist allways from the first song. But the metafile is rewritten bevor the new song. The ices seems to look for the metafile only on startup.
Code: |
#!/bin/bash
path=/mount1/samba_server/mp3/komplette_alben/U2/Boy
for i in `find ${path}/*.mp3 -type f`; do
mp3info -p "ARTIST=%a\nTITLE=%t\n" "$i" > /tmp/trackinfo.txt
sox "$i" -t wav -r 44100 -c 2 -w -
done
|
Marcus |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Fri Dec 30, 2005 12:13 pm Post subject: |
|
|
Hi
I found a solution
I have to make a SIGUSR1 to the ices process. Then the streaming goes on and the metafile is reloaded.
Code: |
#!/bin/bash
path=/mount1/samba_server/mp3/komplette_alben/U2/Boy
for i in `find ${path}/*.mp3 -type f`; do
mp3info -p "ARTIST=%a\nTITLE=%t\n" "$i" > /tmp/trackinfo.txt
kill -SIGUSR1 `pgrep -o ices`
sox "$i" -t wav -r 44100 -c 2 -w -
done
|
|
|
Back to top |
|
|
|