Следите за новостями русскоязычного сообщества Ubuntu в Twitter-ленте @ubuntu_ru_loco
0 Пользователей и 1 Гость просматривают эту тему.
ls | grep "бля-бля-бля" > бля-бля-бля.txt
ls | grep ".awb" >BOOK.INX
Спасибо всем Вот что вышлоКод: [Выделить]ls | grep ".awb" >BOOK.INX
ls *.awb >BOOK.INX
#!/bin/bash# Hack to avoid using the Nokia Audiobooks application # No hassle with Windoze plus conversion is faster too# The script just takes one single compulsory parameter: book_title # Execute it in a directory contaning the mp3s plus a single cover jpg# Any file names are fine# Output files are in the folder ./book_title# This folder can be moved as-is to the Audiobooks directory in the phone# Change the parameters to amrwb-encoder if you want more compression, etc# Change the chapter values by hand in the index file if you're a perfectionist# Note: some sections are optional in theory (chapters, content_info),# but removing some of them breaks the program# Required packages (Debian): mpg321, resample, amrwb, mplayer# Courtesy of Fezouro (Ubuntu forums)index="/tmp/index.inx"tmp="/tmp/tmp.wav" tmp2="/tmp/tmp2.wav"rm -f $tmp $tmp2 $indexmkdir "$1";echo "#BOOK" > $indexecho "$1;" >> $indexecho "#PIC" >> $indexecho "$1.jpg;" >> $indexecho "#TRACKS" >> $indexfind . -maxdepth 1 -iname "*mp3" | sort | while read i; do j=`basename "$i" .mp3` base=`basename "$j" .MP3` out="$base.awb" mpg321 -q -w $tmp "$i" resample -to 16000 -terse $tmp $tmp2 # resample to awb rate lengthd=`mplayer -vo null -ao null -frames 0 -identify $tmp2 2>/dev/null | grep ID_LENGTH | awk -F= '{print $2}'` # length in seconds length=`echo "scale=0;$lengthd/1" | bc` # remove decimals amrwb-encoder -dtx 7 $tmp2 "$1/$out" # convert to awb echo "$out:$length;" >> $index rm -f $tmp $tmp2 doneecho "#CHAPTERS" >> $indexchapter=1;find . -maxdepth 1 -iname "*mp3" | sort | while read i; do j=`basename "$i" .mp3` base=`basename "$j" .MP3` out="$base.awb" echo "$out:0s:$chapter:$base;" >> $index chapter=$(($chapter+1))doneecho "#VERSION" >> $indexecho "0.7;" >> $indexecho "#CONTENT_INFO" >> $indexecho "NokiaAudiobookManagerVersion=Hack by Fezouro;" >> $indexecho "CodecMode=7;" >> $indexecho "CodecBitRate=23050;" >> $indexecho "DTX=1;" >> $indexecho "SBRA=0;" >> $indexecho "SBRA_Rate=900;" >> $indexecho "InputFormat=2;" >> $index# index must be in little endian UTF-16 unicode formaticonv -t UTF-16 $index > "$1/$1.inx"# copy book cover with right namecover=`find . -maxdepth 1 -iname \*.jpg`cp "$cover" "$1/$1.jpg"rm -f $tmp $tmp2 $index
ls > 1.txt
Страница сгенерирована за 0.076 секунд. Запросов: 21.