Find the answer to your Linux question:
Results 1 to 5 of 5
Hello all I am working on some server side audio conversion and was using sox as my tool of choice. I found a strange problem. If I had somefile.wav I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2013
    Posts
    3

    Sox seems to have problems with hyphens and underscores in file name


    Hello all I am working on some server side audio conversion and was using sox as my tool of choice. I found a strange problem.

    If I had somefile.wav I can convert it using sox like so

    $ sox somefile.wav somefile.mp3

    Great however

    $ sox some-other_file.wav some-other_file.mp3
    sox FAIL formats: can't open input file `BassA_110E-0.wav': No such file or directory

    Does any one know if there is way to get around this the audio files for my app are user submitted and though I could simply rename the file with a regular expression I would prefer to keep it as the user intend if possible. Thank you.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hello and welcome, tyger86!

    If I had somefile.wav I can convert it using sox like so

    $ sox somefile.wav somefile.mp3

    Great however

    $ sox some-other_file.wav some-other_file.mp3
    sox FAIL formats: can't open input file `BassA_110E-0.wav': No such file or directory

    Does any one know if there is way to get around this the audio files for my app are user submitted and though I could simply rename the file with a regular expression I would prefer to keep it as the user intend if possible.
    what seems more likely is that you just need to specify the full path to the input file. if it is in your current working dir, prepend the input file with "./" to indicate such. e.g.:
    Code:
    sox ./some-other_file.wav some-other_file.mp3
    you can always use the absolute/full path, too:
    Code:
    sox /tmp/input.wav /tmp/output.mp3

  3. #3
    Just Joined!
    Join Date
    May 2013
    Posts
    3
    I tried both of those and more such as:

    $ sux /full/path/some\-other\_file.wav /full/path/some\-other\_file.mp3

    and

    $ sux 'some-other_file.wav' 'some-other_file.mp3'

    I know the problem is with the hyphen and/or the underscore because I changed the name of one of the problem files to just bass.wav and was able to successively convert with

    $ sux bass.wav bass.mp3

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by tyger86 View Post
    I tried both of those and more such as:

    $ sux /full/path/some\-other\_file.wav /full/path/some\-other\_file.mp3

    and

    $ sux 'some-other_file.wav' 'some-other_file.mp3'

    I know the problem is with the hyphen and/or the underscore because I changed the name of one of the problem files to just bass.wav and was able to successively convert with

    $ sux bass.wav bass.mp3
    that's interesting. i can run sox on files with hyphens and underscores no problem on my box.

    can you show the output of these?

    Code:
    sox --version
    Code:
    uname -a
    Code:
    grep -H . /etc/*release*

  6. #5
    Just Joined!
    Join Date
    May 2013
    Posts
    3
    ╭─tyrel@yoda ~/code/ruby/rails/ovsm [ruby-1.9.3] ‹master*›
    ╰─➤ sox --version
    sox: SoX v14.3.2
    ╭─tyrel@yoda ~/code/ruby/rails/ovsm [ruby-1.9.3] ‹master*›
    ╰─➤ uname -a
    Linux yoda 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    ╭─tyrel@yoda ~/code/ruby/rails/ovsm [ruby-1.9.3] ‹master*›
    ╰─➤ grep -H . /etc/*release*
    /etc/lsb-releaseISTRIB_ID=Ubuntu
    /etc/lsb-releaseISTRIB_RELEASE=12.04
    /etc/lsb-releaseISTRIB_CODENAME=precise
    /etc/lsb-releaseISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
    /etc/os-release:NAME="Ubuntu"
    /etc/os-release:VERSION="12.04.2 LTS, Precise Pangolin"
    /etc/os-release:ID=ubuntu
    /etc/os-release:ID_LIKE=debian
    /etc/os-release:PRETTY_NAME="Ubuntu precise (12.04.2 LTS)"
    /etc/os-release:VERSION_ID="12.04"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •