LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-26-2002, 12:02 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
What is there to split up wav files?


Is there a command line audio tool to split up wav files into smaller ones (at silent periods)?

Presently I use the graphical surface of glame for this purpose, but it is quite time consuming.

Thanks for your help.

Last edited by J_Szucs; 12-26-2002 at 12:04 PM.
 
Old 12-26-2002, 01:02 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
sox should be able to handle this fine.
 
Old 12-26-2002, 02:17 PM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Thanks, but sox does not seem to do it: I checked its manual and it has no such option.

Although it has a split option, but that establishes a different task: it splits one mono channel into two stereo ones.

Any other tip?
 
Old 12-26-2002, 03:40 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Sox trim option looks like it might work:
Code:
 trim start [ length ]
From the SOX man.

So, I'd think that:
sox -trim (time to start) and then time in length to trim would split. Then for the other half:
sox -trim (time where length ended) time to end of song would probably work.

I am not sure as I've never tried, but that's how I read it from the man.

Cool
 
Old 12-26-2002, 03:43 PM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Ah, further down the manpage, it goes into more detail on trim:
Code:
 trim start [ length ]
           Trim can trim off unwanted audio data  from  the
           beginning and end of the audio file.  Audio sam-
           ples are not sent to the output stream until the
           start location is reached.
           The  optional  length parameter tells the number
           of samples to output after the start sample  and
           is  used  to trim off the back side of the audio
           data.  Using a value of 0 for the start  parame-
           ter  will allow trimming off the back side only.
           Both options can be specified  using  either  an
           amount  of  time  and an exact count of samples.
           The format for specifying  lengths  in  time  is
           hh:mm:ss.frac.  A start value of 1:30.5 will not
           start until 1 minute,  thirty  and  1/2  seconds
           into  the audio data.  The format for specifying
           sample counts is the number of samples with  the
           letter  's'  appended  to  it.  A value of 8000s
           will wait until 8000  samples  are  read  before
           starting to process audio data.
Cool
 
Old 12-26-2002, 06:58 PM   #6
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
I saw that trim option, but that cannot save me time:
I would like to automatise splitting up my albums to tracks (I would like to archive my tape collection).

If I would use the trim option of sox, I should still open each album and record where the track boundaries are. Opening an album with glame takes 5 through 10 minutes for me, while I just sit and watch the progress bar.

Then I should start sox, which could split only one track in one turn, so I should repeat this for each track (or maybe I could write a shell to automatise the process, but it does not worth time: the whole thing would be hell slow)

I thought there will be plenty of utils to do this thing, as splitting up an album to tracks did not seem so hard for a computer program to do based on the silent periods between the tracks.

In spite, when I google searched the net I could find nothing useful. Only one util called 'gramofile' can do the trick, but that is very slow: lame is faster to prepare an mp3 than gramofile to split up the same wav. Besides it does not have a command line interface, so one just have to sit and watch the progress bar endlessly.

Last edited by J_Szucs; 12-26-2002 at 07:08 PM.
 
Old 12-26-2002, 08:29 PM   #7
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
http://freshmeat.net/projects/kwavcu...c_id=113%2C120

http://freshmeat.net/projects/sloop....c_id=113%2C901

http://freshmeat.net/projects/tape2mp3/?topic_id=123 (I believe this one is probably closest to what you are looking for)

http://freshmeat.net/projects/wavspl...15%2C118%2C113

Those are the top 4 I picked out of the first page that came up at www.freshmeat.net with a search on wav split

Cool
 
Old 12-27-2002, 12:18 PM   #8
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Sorry, I forgot to mention that tape2mp3 did not compile (although its libsndfile dependency was satisfied):

trackscan.c: In function `main':
trackscan.c:37: warning: implicit declaration of function `sf_open_read'
trackscan.c:37: warning: assignment makes pointer from integer without a cast
trackscan.c:89: structure has no member named `samples'
trackscan.c:90: structure has no member named `samples'
make[1]: *** [trackscan.o] Error 1
make: *** [stuff] Error 2

The others on the first 10 googled pages were either for windows or had no command line interface or had no automatic track splitting.

Anyway, I will continue searching tonight.

Last edited by J_Szucs; 12-27-2002 at 09:00 PM.
 
Old 12-27-2002, 07:09 PM   #9
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Success.

Tape2mp3 now works. It was the old dependency issue:
1. It did not compile with the new, 1.0.3 version of libsndfile
2. It compiled with the old, 0.0.20 version of libsndfile (coming in source), but it did not work
3. It complied and worked with the libsndfile rpm from SuSe ftp.

Tape2mp3 now works and is very fast: it splits the tracks of an album in 30s. (Previously it took 5-10 minutes just to open them in glame).

For those who read this thread and want to archive tapes I can also recommend an other program called "normalize", which normalizes the volume of wav files (even faster).

So, my great assisstants for archiving tapes:
arecord (recording an album in one turn into wav)
+ tape2mp3 (splitting to tracks)
+ normalize (normalizing volume)
+ lame (mp3 encoding).
All these are command line programs, so everything (except recording) can be fully automatized with a small script so that no user interaction is needed.
 
Old 12-27-2002, 07:12 PM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Sweet, glad you got it working, and even have a plethora of tools to make each step go quickly.

Cool
 
Old 12-28-2002, 03:30 PM   #11
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Ummm...
In practice, I had to make an important modification in the tools used:

Replaced arecord with wavrec as the wav recording tool.

Reason: arecord (or, at least its version 0.5.10 included with SuSe 7.3) seems to be buggy when preparing the wav header. This resulted in tape2mp3 splitting the album at the wrong places.
(The error of arecord was not noticed so far, since glame, which I had used as the editor, seemed to automatically correct it even without an error message)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dd question - split files Sn7 Linux - Software 5 08-30-2009 05:42 AM
Help needed to split files 242VDM242 Linux - Newbie 10 04-07-2005 10:39 AM
how to split up audio files? SciYro Linux - General 3 10-27-2004 12:25 PM
dd question - split files Sn7 Linux - General 1 09-19-2004 11:15 AM
How to rejoin split files SharpyWarpy Linux - General 2 02-07-2003 03:42 PM


All times are GMT -5. The time now is 06:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration