Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wav burning
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Tue Mar 18, 2003 10:18 pm    Post subject: wav burning Reply with quote

what is the program you guys use to burn audio cd from wav files...
I cant find a program to do this, and yet the only one i have found doest seem to like the work mpg123 have done to rip from an mp3 to a wav...anyother good ripper by the way
Back to top
View user's profile Send private message
jetblack
Guru
Guru


Joined: 15 Jan 2003
Posts: 340
Location: Evanston, IL, USA

PostPosted: Wed Mar 19, 2003 12:00 am    Post subject: Re: wav burning Reply with quote

Iron_Mike wrote:
what is the program you guys use to burn audio cd from wav files...
I cant find a program to do this, and yet the only one i have found doest seem to like the work mpg123 have done to rip from an mp3 to a wav...anyother good ripper by the way


I use cdrecord, and I've never had a problem using it in conjunction with mpg123.

k3b has a nice ui for burning mp3 to cda, too.
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Mar 19, 2003 3:12 am    Post subject: Reply with quote

here's what cdrecord returns me after this command
Code:
 cdrecord -v -dao -useinfo dev=0,0 *.wav
:

Code:
cdrecord: Inappropriate audio coding in '1bc.wav'.


while all i did with this mp3 was :



Code:
mpg123 -w 1bc.wav 1bc.mp3


any ideas what could have went wrong?
Back to top
View user's profile Send private message
Anubis
n00b
n00b


Joined: 09 Nov 2002
Posts: 68
Location: BYU

PostPosted: Wed Mar 19, 2003 5:00 am    Post subject: Reply with quote

Hmm...no clue. I usually use abcde to rip cds, but since it's giving me a headache I've switched to grip for now. But in either case to encode from wav to mp3 both programs use lame. You may want to give it a try as well.
_________________
The one who says it cannot be done should never interrupt the one who is doing it.
Back to top
View user's profile Send private message
jetblack
Guru
Guru


Joined: 15 Jan 2003
Posts: 340
Location: Evanston, IL, USA

PostPosted: Wed Mar 19, 2003 5:08 am    Post subject: Reply with quote

Iron_Mike wrote:
here's what cdrecord returns me after this command
Code:
 cdrecord -v -dao -useinfo dev=0,0 *.wav
:

Code:
cdrecord: Inappropriate audio coding in '1bc.wav'.


while all i did with this mp3 was :



Code:
mpg123 -w 1bc.wav 1bc.mp3


any ideas what could have went wrong?


Ah - I may have left out some pertinent information. You have to make sure the sampling rate is 44.1 kHz, which won't necessarily be true for all mp3s. Try writing to stdout with mpg123 and piping the output to sox to correct for this. Here's the command I use to convert mp3 to wav:

Code:
mpg123 -s blah.mp3 | sox -t raw -r 44100 -s -w -c 2 - blah.wav


Perhaps that will help.
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Mar 19, 2003 4:07 pm    Post subject: Reply with quote

well, it did half the work,,,

the .wav that resulted of the operation is playing like 1.5times faster than it should play...

any idea why...

ah and one more thing, how do i perform the operation from mp3 to wav for several files, but in one command...cause for a 20 songs cd, it can be painfull...
i cant seem to figure out how to tell sox to make the wav the same name as the mp3...
Back to top
View user's profile Send private message
jetblack
Guru
Guru


Joined: 15 Jan 2003
Posts: 340
Location: Evanston, IL, USA

PostPosted: Wed Mar 19, 2003 9:25 pm    Post subject: Reply with quote

Strange - I hadn't noticed the reply before. Sorry about that.

I'm not sure why it would play 1.5 times fast. Is it playing too fast on the cd, or are you just playing the wav with something else? What are you using to play it back?

I wrapped this up in a script to burn cds. Basically, I pass the script a file containing a playlist of tracks that I want to burn, and it converts them to wav, normalizes the volumes and burns them to a cd. It's a bit kludgy, but I can post it tonight when I get home if you'd like.
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Wed Mar 19, 2003 10:09 pm    Post subject: Reply with quote

yup id like thatt

as for the wav playing faster, it does too on the cd...
Back to top
View user's profile Send private message
jetblack
Guru
Guru


Joined: 15 Jan 2003
Posts: 340
Location: Evanston, IL, USA

PostPosted: Fri Mar 21, 2003 4:37 pm    Post subject: Reply with quote

Sorry for the delay. The last two days have not exactly gone according to plan. Here's the script.

Code:

#!/bin/bash

declare -i cd_minutes=80
declare -i cd_seconds=$((cd_minutes*60))
declare -i total_length=0
track_list=""
files_exist=0

# cd recording options
normalize_volume="1"
dao_flag="-dao"
record_speed="8"
record_dev="0,1,0"

#############################################################################
# Begin function definition
#############################################################################

#
# ensure all files in the playlist exist (i.e. check for typos)
#
function validate_files
{
  echo "Checking for existence of files in playlist"

  while read filename ; do
    echo "file: $filename"
    if [ ! -f "$filename" ] ; then
      echo "Could not find $filename"
      files_exist=2
    fi
  done
}

#
# Kludge the second
# Read the ogg tracktime out of the tmp file to which it was written in
# validate_tracktimes. Convert it to seconds from mm:ss format.
#
# If anyone has a better way to do this, I'm all ears...
#
function read_ogg_tracktime
{
  read time
  time=${time/"*Playback length: "/}

  track_minutes=${time/"m*"/}
  track_seconds=${time/"*:"/}
  track_seconds=${track_seconds/"s"/}
 
  seconds=$((track_minutes*60+track_seconds))

  echo "$track_minutes minutes $track_seconds seconds"

  total_length=$((total_length+seconds))
}

#
# Kludge the second - part II
# Read the mp3 tracktime out of the tmp file to which it was written in
# validate_tracktimes.
#
# If anyone has a better way to do this, I'm all ears...
#
function read_mp3_tracktime
{
  read seconds
 
  track_minutes=$((seconds/60))
  track_seconds=$((seconds-track_minutes*60))
 
  echo "$track_minutes minutes $track_seconds seconds"

  total_length=$((total_length+seconds))
}

#
# Kludge the first
# determine the length of each track in track_list,
# and write it out to a temp file for use in read_tracktimes above
# delete temp file when done.
#
function validate_tracktimes
{
  echo "Determining playtimes of files in playlist"
  declare -i track_num=0
  tmp_file=$$.tmp
 
  while read track ; do
    track_num=track_num+1
    length=${#track}
    format=${track:$length-3}

    echo "$track"
   
    case $format in
      ogg )
        ogginfo "$track" | grep "Playback length" | cat > $tmp_file
        read_ogg_tracktime < $tmp_file
        ;;

      mp3 | MP3 )
        mp3info -p %S "$track" | cat -E > $tmp_file
        read_mp3_tracktime < $tmp_file
        ;;
    esac

    rm $tmp_file
  done
}

#
# convert the files in the playlist (read into this script)
# from mp3 or ogg to wav files for burning. Use sox to ensure that
# mp3s are converted with the proper sampling rate and channels
#
function makewavs
{
  declare -i track_num
 
  while read track ; do
    track_num=$track_num+1
    length=${#track}
    format=${track:$length-3}
    wav_name="track$track_num.wav"
 
    echo "Converting $1 to wav"

    case $format in
      ogg )
        ogg123 -d wav -f $wav_name "$track"
        ;;

       mp3 | MP3 )
        mpg123 -s "$track" | sox -t raw -r 44100 -s -w -c 2 - $wav_name
        ;;
    esac

    track_list="$track_list $wav_name"
  done
 
}

#
# Burn the wav files generated in makewavs onto the cd.
# Use options in abcdb.conf to determine recording parameters.
# If the normailze_volume flag is set, then call normalize to
# adjust the volume of the wav files.
#
function burncd
{
  if [ $normalize_volume = "1" ] ; then
    echo "Normalizing wav file volume"
    normalize -m $1
  fi
 
  options="-pad -audio -dev=$record_dev speed=$record_speed $dao_flag"
  cdrecord $options $1
}


#############################################################################
# Begin script execution
#############################################################################

#
# Make sure all files on the playlist exist
#
echo $1
#exit

validate_files < "$1"
if [ $files_exist != 0 ] ; then
  echo "Some files could not be found. Please correct filenames and try again."
  exit 1
else
  echo "Playlist file existence check ok"
fi

#
# Make sure the playlist will fit on the cd
#
validate_tracktimes < "$1"
playlist_minutes=$((total_length/60))
playlist_seconds=$((total_length-$playlist_minutes*60))

echo ""
echo "Total length: $playlist_minutes minutes $playlist_seconds seconds"
echo "Maximum length: $cd_minutes minutes"

if [ $total_length -gt $cd_seconds  ] ; then
  excess_minutes=$(((total_length-cd_seconds)/60))
  excess_seconds=$((total_length-cd_seconds-excess_minutes*60))

  echo "Total length must be < $cd_minutes minutes"
  echo "Current playlist exceeds this by $excess_minutes minutes $excess_seconds seconds"
 
  exit 2
else
  echo "Playlist length ok"
fi

#
# convert playlist files to wavs and burn to the cd
#
makewavs < "$1"
burncd "$track_list"
rm $track_list


I don't have a whole lot of time to explain it, but basically just save this script, and call it like this

Code:
your_script_name playlist_file


The playlist is just a text file containing the absolute paths of the files you want to burn, one file per line.

I hope this helps a little. Let me know if you have any trouble. I didn't really intend it for general consumption, so it may have some quirks.
Back to top
View user's profile Send private message
Iron_Mike
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2003
Posts: 83

PostPosted: Mon Mar 24, 2003 11:54 pm    Post subject: Reply with quote

thx
ill try that this week...
Back to top
View user's profile Send private message
iandow
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2004
Posts: 135
Location: Washington, DC

PostPosted: Tue Jun 07, 2005 4:37 am    Post subject: Reply with quote

That script produces wav files that play extremely fast. Any idea why?

For me, it compressed a 60min mp3 file to a 7min wav file.
Back to top
View user's profile Send private message
placeholder
Advocate
Advocate


Joined: 07 Feb 2004
Posts: 2500

PostPosted: Tue Jun 07, 2005 4:56 am    Post subject: Reply with quote

Give Graveman a shot.
Back to top
View user's profile Send private message
elvisthedj
Guru
Guru


Joined: 21 Jun 2004
Posts: 483
Location: Nampa, ID

PostPosted: Tue Sep 20, 2005 1:40 am    Post subject: Reply with quote

If the in and out rates are different (mp3 isn't 44.1), then try adding resample after the out filename.
_________________
Kris Edwards
kris edwards at g mail dot c0m
PGP
WWW
Back to top
View user's profile Send private message
StarDragon
Guru
Guru


Joined: 19 Jun 2005
Posts: 390
Location: tEXas

PostPosted: Sat Dec 17, 2005 1:24 am    Post subject: Reply with quote

you could try something like this: mpg321 -q -r 44100 --stereo -w, maybe that will do the trick.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
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