Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open input #1

Open
RenierD opened this issue Oct 11, 2017 · 11 comments
Open

Can't open input #1

RenierD opened this issue Oct 11, 2017 · 11 comments

Comments

@RenierD
Copy link

RenierD commented Oct 11, 2017

sox FAIL formats: can't open input -': can't find sox file format identifier play WARN alsa: can't encode 0-bit Unknown or not applicable sox FAIL formats: can't determine type of -'
sox FAIL formats: can't determine type of -' sox FAIL formats: can't determine type of -'
sox FAIL formats: can't determine type of -' play FAIL formats: can't determine type of -'

@alexpgates
Copy link
Owner

Try installing SoX with all the supported formats. My guess is this is happening because SoX doesn't ship with MP3 support by default.
sudo apt-get install sox libsox-fmt-all

@RenierD
Copy link
Author

RenierD commented Oct 12, 2017

Hi @alexpgates

Software packages installed as recommended. I've never worked with sox, so have no clue (yet) what the commands are trying to do, but maybe something in the command line?

pi@mockingbird ~ $ sudo apt-get install sox libsox-fmt-all
Reading package lists... Done
Building dependency tree
Reading state information... Done
libsox-fmt-all is already the newest version.
sox is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

@alexpgates
Copy link
Owner

@RenierD Double check the name of your directory. The script is looking in /home/pi/chime/ - which could probably be pi-chime if you've cloned the repo. (I'll fix that)

If that doesn't seem to work, let me know which version of Raspbian you are using so I can poke around.

@RenierD
Copy link
Author

RenierD commented Oct 12, 2017

Triple checked directory structures. Play commands work separately, but not the combined command. The loop also works with individual play commands. Checked that the mp3s wasn't corrupt and tried removing the dashes in my filenames (I still use the original ones - after I uploaded to Instructables the filenames were changed to the ones this script use).

The commands you used for SoX, are they not maybe pre-configured? Does SoX work out-of-the-box after installation?

I'm using Raspbian Wheezy.

@alexpgates
Copy link
Owner

SoX seemed to work out of the box for me.

Does something like this work for you in a new file?

This should make it chime 5 times.

sox /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 | \
sox - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 remix v2 | \
sox - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 remix v2 | \
sox - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 remix v2 | \
play - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 remix v2

@RenierD
Copy link
Author

RenierD commented Oct 13, 2017

@alexpgates thank you for your patience so far. Still no 'luck'. (Just ignore my directory structure and names - they are the original ones.) Tried with and w/out sudo.

pi@mockingbird ~ $ sox /home/pi/Scripts/sounds/big-ben-strike.mp3 -p pad 2 0 | \                                                                                                                                                              > sox - -m sox /home/pi/Scripts/sounds/big-ben-strike.mp3 -p pad 2 0 | \ -p pad                                                                                                                                                               2 0 remix v2 | \
> sox - -m sox /home/pi/Scripts/sounds/big-ben-strike.mp3 -p pad 2 0 | \ -p pad                                                                                                                                                               2 0 remix v2 | \
> sox - -m sox /home/pi/Scripts/sounds/big-ben-strike.mp3 -p pad 2 0 | \ -p pad                                                                                                                                                               2 0 remix v2 | \
> play - -m sox /home/pi/Scripts/sounds/big-ben-strike.mp3 -p pad 2 0 | \ remix                                                                                                                                                               v2
-bash:  -p: command not found
-bash:  -p: command not found
-bash:  -p: command not found
-bash:  remix: command not found
sox FAIL formats: can't open input file `sox': No such file or directory
sox FAIL formats: can't open input file `sox': No such file or directory
sox FAIL formats: can't open input file `sox': No such file or directory
play WARN alsa: can't encode 0-bit Unknown or not applicable
play FAIL formats: can't open input  `-': premature EOF

@alexpgates
Copy link
Owner

@RenierD No problem at all! I'm still learning things here.

Let's try this all on one line. Does this work when executed right from the command line?

sox /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 | sox - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 remix v2 | sox - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 remix v2 | sox - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 -p pad 2 0 remix v2 | play - -m /home/pi/chime/FOPGM68INC0CAI9.mp3 remix v2

@RenierD
Copy link
Author

RenierD commented Nov 6, 2017

Hi @alexpgates. Sorry for the delay. I tried simplifying the commands. Each time I get a different error. The error I get for using the one-liner as above:

sox FAIL formats: can't open input  `-': can't find sox file format identifier
sox FAIL formats: can't determine type of  `-'
sox FAIL formats: can't determine type of  `-'
play WARN alsa: can't encode 0-bit Unknown or not applicable
play FAIL formats: can't determine type of  `-'

It seems like there is something wrong with the command line (and therefore sox is trying to play the wrong path. I replaced the '-' with -t, but then I get:

sox FAIL formats: no handler for given file type `-m'
sox FAIL formats: no handler for given file type `-m'
sox FAIL formats: no handler for given file type `-m'
play WARN alsa: can't encode 0-bit Unknown or not applicable
play FAIL formats: no handler for given file type `-m'

@kc0qnd
Copy link

kc0qnd commented Nov 16, 2017

Not sure if this is the issue, but if I used "pi-chime" for the program directory, and adjusted the script with the new directory, the chime did not work. If I use "chime" for the directory, it works correctly. I believe the "-" in the directory name causes the malfunction.

@alexpgates
Copy link
Owner

@kc0qnd Great catch! I didn't even consider this.
@RenierD - let me know if this works for you!

I should probably rename this repo, yeah?

@RenierD
Copy link
Author

RenierD commented Nov 19, 2017

Tried @kc0qnd 's solution. I get the same error as above. Tried searching the errors, but nothing specific. One clue was using 'the wrong' audio device settings and another was not having access to the file(s). The files does hover play without sox remixing them. My next step is to dig into the default audio device settings. Will give feedback as soon as I have. Guidance/suggestions will still be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants