USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

Linux and Ipods
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Audio and Video Applications
View previous topic :: View next topic  
Author Message
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Fri Jul 25, 2024 1:59 pm    Post subject: scripts look like the most helpful alternative to Amarok Reply with quote

I'm not into the iPod or music player scene that much at all, though my wife and children all play around with iPod Nano. They use iTunes on Windows to sync up their stuff, so they are no help at all in this discussion.

Looks like the take away from this, at least so far, is that the two best options as far as getting precisely what you want is either to use Amarok, which seems to have the richest feature set, but it has the disadvantage of carrying with it a lot of KDE libraries, or to use individual commands to manage the transfers.

If you are open to the shell script idea, maybe jbsnake could share his scripts with you. Otherwise it looks like a hodgepodge of stuff, which really will not save you on space, and in that context, Amarok may end up being the lesser of evils.

Let us know if you come up with any other creative alternatives.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Lord.DragonFly.of.Dawn
Advanced Member


Joined: 18 Jul 2024
Posts: 607
Location: South Portland, Maine, USA, Earth, Sol System

PostPosted: Fri Jul 25, 2024 11:08 pm    Post subject: Reply with quote

Given my directory structure a shell script should work very well indeed....

an interesting idea.....



_________________
ArchLinux x86_64 - Custom Built Desktop
ArchLinux x86_64 - Compaq CQ50 Laptop
ArchLinux i686 - Acer Aspire One Netbook
ArchLinux i686 - Dell Presario ze2000 (w/ shattered LCD)

PuppyLinux, CloneZilla, PartedMagic, DBAN - rescue thumbdrives
Windows 7 (x86_64 desktop alternate boot)
Back to top
View user's profile Send private message Visit poster's website
jbsnake
Moderator


Joined: 02 Dec 2024
Posts: 1726
Location: Georgia

PostPosted: Sat Jul 26, 2024 9:32 pm    Post subject: Reply with quote

here's the "ogg2mp3" script i wrote:
Code:

#!/bin/bash

# usage:   ogg2mp3 <source_directory> <destination_directory> <artist>
# example:   ogg2mp3 /ripped/music/ogg /ripped/music/mp3 "Pearl Jam"
# another:   for artist in */; do ogg2mp3 /ripped/music/ogg /ripped/music/mp3 $artist; done


fSlash='/'

function notAForwardSlash
{
   if [[ $1 != $fSlash ]]
        then
      return 0
        else
           return 1
        fi
}
### end notAForwardSlash ###


function getFileName
{
   STRING="${1}"
        LENGTH=${#STRING}
   # echo "${STRING}: is ${LENGTH} long"
   for ((n=0;n <= $LENGTH; n++))
        do
      CHAR=${STRING:$n:1}
      if notAForwardSlash $CHAR
      then
         FileName="${FileName}${CHAR}"
      else
         FileName=""
      fi
      # echo "${FileName}"
   done
}
### end getFileName ###

function inStr
{
        searchFor="$1";
        lenOf=${#searchFor};
        searchIn="$2";

        for (( i=0; i < ${#searchIn}; i++ ))
        do
                if [[ "${searchIn:$i:$lenOf}" = "$searchFor" ]]
                then
                        return $i
                fi
        done
        return -1
}

function get_ogg_info
{
   index=0
   vorbiscomment -l "$1" > info.lst
   for turn in artist title album genre date tracknumber
   do
      tmp_comment=`grep -i "$turn" info.lst`
      inStr "=" "$tmp_comment"
      item=$?
      comment=${tmp_comment:$item+1}
      ((index++))
      case $index in
      1)   cartist="$comment";
         ;;
      2)   ctitle="$comment";
         ;;
      3)   calbum="$comment";
         ;;
      4)   cgenre="$comment";
         ;;
      5)   cdate="$comment";
         ;;
      6)   ctracknumber="$comment";
         ;;
      esac
   done
}

function encode_mp3
{
   old_file="${1}"
   new_dir="${2}"
   getFileName "${old_file}"
   new_file="${FileName:0:${#FileName}-4}.mp3"
   get_ogg_info "$old_file"
   oggdec "${old_file}" -o - | lame  -b 320 --tt "$ctitle" --ta "$cartist" --tl "$calbum" --ty "$cdate" --tn "$ctracknumber" --tg "$cgenre" -h - > "${new_dir}/${new_file}"
   sleep .5
}

source_dir="${1}"
dest_dir="${2}"
artist="${3}"

if [[ "${source_dir:${#source_dir}-1:1}" = '/' ]]
then
   source_dir="${source_dir:0:${#source_dir}-1}"
fi

# read -p "Enter the destination directory: " dir

if [[ ! -e "${dest_dir}" ]]
then
   mkdir "${dest_dir}" 2> /dev/null
   if [[ $? = 0 ]]
   then
      echo ":: ${dest_dir} created successfully"
   else
      echo ":: Failed creating ${dest_dir}"
      echo ": Aborting!"
      exit
   fi
fi


# read -p "Enter the artists name: " artist

ls -Rd "${source_dir}/${artist}"/*/ > "${source_dir}/${artist}"/albumlist.dat
clear
echo ":: The albums found under that artist's directory are as shown:"
cat "${source_dir}/${artist}/albumlist.dat"
# read -p ":: Are these the correct albums that you would like to encode? (y|n) " ans
# ans=`echo ${ans:0:1} | tr [:upper:] [:lower:]`
# if [[ ${ans} != 'y' ]]
# then
#   exit
# fi

until ! read cur_album
do
   album="${cur_album:0:${#cur_album}-1}"
   getFileName "${album}"
   album="${FileName}"
   ls "${source_dir}/${artist}/${album}"/*.ogg > "${source_dir}/${artist}/${album}"/songsonalbum.dat
   echo ":: Beginning to encode the following songs:"
   cat "${source_dir}/${artist}/${album}/songsonalbum.dat"
   
   if [[ ! -e "${dest_dir}/${artist}" ]]
   then
      mkdir "${dest_dir}/${artist}"
   fi

   if [[ ! -e "${dest_dir}/${artist}/${album}" ]]
   then
      mkdir "${dest_dir}/${artist}/${album}"
   fi
   
   until ! read cur_song
   do
      getFileName "${cur_song}"
      song="${FileName}"
      FileName=""
      encode_mp3 "${cur_song}" "${dest_dir}/${artist}/${album}"
   done < "${source_dir}/${artist}/${album}"/songsonalbum.dat
   rm "${source_dir}/${artist}/${album}"/songsonalbum.dat

done < "${source_dir}/${artist}"/albumlist.dat

rm "${source_dir}/${artist}"/albumlist.dat



_________________
laptop: Arch Linux - Kernel 2.6.24-ARCH
server: Arch Linux - Kernel 2.6.33-ARCH
Back to top
View user's profile Send private message
rumbarg
Jr. Member


Joined: 06 Jun 2024
Posts: 69
Location: Houston, TX

PostPosted: Sat Jul 26, 2024 10:06 pm    Post subject: Reply with quote

I just read about this one - don't have a clue whether it might be helpful...might just complicate things?

Quote:
Ampache is a LAMP application that gives you a Web interface to your music collection, allowing you to search, rate, and play your music over the network. It even offers transcoding support to allow clients to play back lossless-encoded FLAC files from the server and stream them to clients as MP3 audio files.


http://www.linux.com/feature/140754

regards,

rumbarg



_________________
sidux sidux 2024-01 - Χάος
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Audio and Video Applications All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse