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 08-16-2010, 05:41 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Rep: Reputation: 33
Need help with first time use of SoX


Hello.

I need to transform a wav file to this form :

RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz

The wav-file is in this format :

Code:
[root@server ]$ file test.wav 
test.wav: RIFF (little-endian) data, WAVE audio, 20294 channels 1414676809 Hz
I use SoX like this :

Code:
[root@server ]# sox test.wav -r 8000 -c1 test.wav resample -ql
sox sox: effect `resample' is deprecated; see sox(1) for an alternative
sox wav: Premature EOF on .wav input file
And afterwards the format is:

Code:
[root@server ]# file test.wav
test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz
But there was an error "Premature EOF on .wav input file" and my Asterisk-server can not read this wav-file, it states :
Quote:
Unable to open input file: test.wav

How can I correctly transform this wav-file to MONO, 8000Hz ?!
 
Old 08-16-2010, 02:29 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,569

Rep: Reputation: 171Reputation: 171
The message is rather about the source file. Are you sure it's correct? Try to open it in any program (Amarok etc) and see if you get any message. Also check the input and output file length. Is the output surprisingly small?
 
Old 08-17-2010, 03:13 AM   #3
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by Mara View Post
The message is rather about the source file. Are you sure it's correct? Try to open it in any program (Amarok etc) and see if you get any message. Also check the input and output file length. Is the output surprisingly small?
Thank you for your reply.

I can play the original file, and the resampled file in Mplayer (gnome).

It has indeed decreased in file size :

Code:
-rw-r--r-- 1 root root 885K 2010-08-17 08:59 test2.wav
-rw-r--r-- 1 root root 9.6M 2010-08-17 08:57 testorig.wav
 
Old 08-17-2010, 03:28 AM   #4
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
see sox(1) for an alternative
Perhaps you really have to go for what it says. Do 'man sox' or read it here: http://sox.sourceforge.net/sox.html
 
  


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
Using SoX eQuinas Linux - Software 2 04-20-2008 11:21 PM
Documentation for Sox ? arubin Linux - Software 8 01-12-2007 08:08 AM
noise with sox bernd54321 Linux - General 1 04-21-2006 04:33 PM
SoX karunesh General 1 08-09-2005 02:07 PM
The Sox Parade H2O-linux General 4 11-01-2004 09:48 PM


All times are GMT -5. The time now is 12:30 AM.

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