zaf / asterisk-googletts

Asterisk AGI script that uses Google's translate text to speech service.
GNU General Public License v2.0
214 stars 125 forks source link

SoX - missing filename #3

Closed rsn86 closed 12 years ago

rsn86 commented 12 years ago

Hi,

I'm having some trouble running the googletts.

I got a 'missing filename' error, for both modes (cli and agi), in development snapshots or stable 0.6 versions.

./googletts-cli.pl -l en -t "Hello world" -s 1 /usr/bin/sox: SoX v14.0.0 Failed: missing filename ./googletts-cli.pl: sox failed to process sound file. at ./googletts-cli.pl line 169.

I also tried it with SoX v12.18.1 and got the same error.

Regards, Rodrigo

rsn86 commented 12 years ago

Version 0.5 works fine.

zaf commented 12 years ago

Can you please send me the output of sox --help (i want to check the supported file formats and effetcs) and also tell me what distro you are running. If you try something like googletts-cli.pl -o test.wav -t "Hello world" does it write the wav file or it fails again?

rsn86 commented 12 years ago

Hi,

Elastix 2.3.0 RC1 x86_64 - CentOS release 5.8 (Final) sox: SoX v14.4.0

Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopt]]...

SPECIAL FILENAMES (infile, outfile):

SPECIAL FILENAMES (infile only): "|program [options] ..." Pipe input from external program (where supported) http://server/file Use the given URL as input file (where supported)

GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect): --buffer BYTES Set the size of all processing buffers (default 8192) --clobber Don't prompt to overwrite output file (default) --combine concatenate Concatenate all input files (default for sox, rec) --combine sequence Sequence all input files (default for play) -D, --no-dither Don't dither automatically --effects-file FILENAME File containing effects and options -G, --guard Use temporary files to guard against clipping -h, --help Display version number and usage information --help-effect NAME Show usage of effect NAME, or NAME=all for all --help-format NAME Show info on format NAME, or NAME=all for all --i, --info Behave as soxi(1) --input-buffer BYTES Override the input buffer size (default: as --buffer) --no-clobber Prompt to overwrite output file -m, --combine mix Mix multiple input files (instead of concatenating) --combine mix-power Mix to equal power (instead of concatenating) -M, --combine merge Merge multiple input files (instead of concatenating) --magic Use magic' file-type detection --multi-threaded Enable parallel effects channels processing --norm Guard (see --guard) & normalise --play-rate-arg ARG Defaultrate' argument for auto-resample with `play' --plot gnuplot|octave Generate script to plot response of filter effect -q, --no-show-progress Run in quiet mode; opposite of -S --replay-gain track|album|off Default: off (sox, rec), track (play) -R Use default random numbers (same on each run of SoX) -S, --show-progress Display progress while processing audio data --single-threaded Disable parallel effects channels processing --temp DIRECTORY Specify the directory to use for temporary files -T, --combine multiply Multiply samples of corresponding channels from all input files (instead of concatenating) --version Display version number of SoX and exit -V[LEVEL] Increment or set verbosity level (default 2); levels: 1: failure messages 2: warnings 3: details of processing 4-6: increasing levels of debug messages FORMAT OPTIONS (fopts): Input file format options need only be supplied for files that are headerless. Output files will have the same format as the input file where possible and not overriden by any of various means including providing output format options.

-v|--volume FACTOR Input file volume adjustment factor (real number) --ignore-length Ignore input file length given in header; read to EOF -t|--type FILETYPE File type of audio -e|--encoding ENCODING Set encoding (ENCODING may be one of signed-integer, unsigned-integer, floating-point, mu-law, a-law, ima-adpcm, ms-adpcm, gsm-full-rate) -b|--bits BITS Encoded sample size in bits -N|--reverse-nibbles Encoded nibble-order -X|--reverse-bits Encoded bit-order --endian little|big|swap Encoded byte-order; swap means opposite to default -L/-B/-x Short options for the above -c|--channels CHANNELS Number of channels of audio data; e.g. 2 = stereo -r|--rate RATE Sample rate of audio -C|--compression FACTOR Compression factor for output format --add-comment TEXT Append output file comment --comment TEXT Specify comment text for the output file --comment-file FILENAME File containing comment text for the output file --no-glob Don't `glob' wildcard match the following filename

AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb amr-nb amr-wb anb au avi avr awb caf cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 fap ffmpeg flac fssd gsm gsrt hcom htk ima ircam la lpc lpc10 lu m4a m4b mat mat4 mat5 maud mp2 mp3 mp4 mpg nist ogg paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 sb sd2 sds sf sl sln smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox w64 wav wavpcm wmv wv wve xa xi PLAYLIST FORMATS: m3u pls AUDIO DEVICE DRIVERS: alsa ao oss ossdsp pulseaudio

EFFECTS: allpass band bandpass bandreject bass bend biquad chorus channels compand contrast dcshift deemph delay dither divide+ downsample earwax echo echos equalizer fade fir firfit+ flanger gain highpass hilbert input# ladspa loudness lowpass mcompand mixer* noiseprof noisered norm oops output# overdrive pad phaser pitch rate remix repeat reverb reverse riaa silence sinc spectrogram speed splice stat stats stretch swap synth tempo treble tremolo trim upsample vad vol

Outputting to a wav file runs flawless (./googletts-cli.pl -o test.wav -t 'Hello World' -s 1.0)

But without outputting to file I got an error.

./googletts-cli.pl -l en -t "Hello world" /usr/bin/sox FAIL formats: can't open output file `default': can not open audio device: Connection refused ./googletts-cli.pl: sox failed to process sound file. at ./googletts-cli.plline 168.


Ubuntu 8.04 LTS 32bits sox: SoX v14.0.0

Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopts]]...

SPECIAL FILENAMES:

GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect): --buffer BYTES set the buffer size (default 8192) --combine concatenate concatenate multiple input files (default for sox, rec) --combine sequence sequence multiple input files (default for play) -h, --help display version number and usage information --help-effect NAME display usage of specified effect; use `all' to display all --interactive prompt to overwrite output file -m, --combine mix mix multiple input files (instead of concatenating) -M, --combine merge merge multiple input files (instead of concatenating) --plot gnuplot|octave generate script to plot response of filter effect -q, --no-show-progress run in quiet mode; opposite of -S --replay-gain track|album|off default: off (sox, rec), track (play) -R use default random numbers (same on each run of SoX) -S, --show-progress display progress while processing audio data --version display version number of SoX and exit -V[LEVEL] increment or set verbosity level (default 2); levels are: 1: failure messages 2: warnings 3: details of processing 4-6: increasing levels of debug messages

FORMAT OPTIONS (fopts): Format options only need to be supplied for input files that are headerless, otherwise they are obtained automatically. Output files will default to the same format options as the input file unless otherwise specified.

-c, --channels CHANNELS number of channels in audio data -C, --compression FACTOR compression factor for output format --comment TEXT Specify comment text for the output file --comment-file FILENAME file containing comment text for the output file --endian little|big|swap set endianness; swap means opposite to default -r, --rate RATE sample rate of audio -t, --type FILETYPE file type of audio -x invert auto-detected endianness -N, --reverse-nibbles nibble-order -X, --reverse-bits bit-order of data -B/-L force endianness to big/little -s/-u/-U/-A/ sample encoding: signed/unsigned/u-law/A-law -a/-i/-g/-f ADPCM/IMA_ADPCM/GSM/floating point -1/-2/-3/-4/-8 sample size in bytes -v, --volume FACTOR volume input file volume adjustment factor (real number)

SUPPORTED FILE FORMATS: 8svx aif aifc aiff aiffc al alsa ao au auto avi avr caf cdda cdr cvs cvsd dat dvms fap ffmpeg flac fssd gsm hcom ima ircam la lpc lpc10 lu m3u m4a mat mat4 mat5 maud mp2 mp3 mp4 mpg nist nul null ogg oss ossdsp paf pls prc pvf raw s1 s2 s3 s4 sb sd2 sds sf sl smp snd sndfile sndt sou sph sw txw u1 u2 u3 u4 ub ul uw vms voc vorbis vox w64 wav wmv wve xa xi

SUPPORTED EFFECTS: allpass band bandpass bandreject bass chorus compand dcshift deemph dither earwax echo echos equalizer fade filter flanger highpass key ladspa lowpass mcompand mixer noiseprof noisered oops pad pan phaser polyphase rabbit repeat resample reverb reverse silence speed stat swap synth tempo treble tremolo trim vol

effopts: depends on effect

This version supports the tempo effect, but as you may see if I don't use '-s 1.0' SoX complains.

./googletts-cli.pl -o test.wav -t 'Hello world!' /usr/bin/sox tempo: usage: [-q] factor [segment-ms [search-ms [overlap-ms]]] ./googletts-cli.pl: sox failed to process sound file. at ./googletts-cli.plline 168.

./googletts-cli.pl -o test.wav -t 'Hello world!' -s 1.0 (Runs flawless)

./googletts-cli.pl -t 'Hello world!' /usr/bin/sox: SoX v14.0.0 Failed: missing filename ./googletts-cli.pl: sox failed to process sound file. at ./googletts-cli.plline 168.

./googletts-cli.pl -t 'Hello world!' -s 1.0 /usr/bin/sox: SoX v14.0.0 Failed: missing filename ./googletts-cli.pl: sox failed to process sound file. at ./googletts-cli.plline 168.

Regards, Rodrigo

On Sun, Mar 25, 2012 at 23:11, Lefteris Zafiris < reply@reply.github.com

wrote:

Can you please send me the output of sox --help (i want to check the supported file formats and effetcs) and also tell me what distro you are running. If you try something like googletts-cli.pl -o test.wav -t "Hello world" does it write the wav file or it fails again?


Reply to this email directly or view it on GitHub: https://github.com/zaf/asterisk-googletts/issues/3#issuecomment-4686889

zaf commented 12 years ago

Unfortunately sox is a big pile of shit. I was hoping that only major versions have a totally incompatible command line syntax but as it seems minor versions suffer for this too. Please try the latest code i pushed on the repo, it contains a fix that should deal with the problem you have in elastix (it defines the type of output in playback mode to 'alsa'). As for the ubuntu version of sox i ll have to investigate it a bit more.

rsn86 commented 12 years ago

It's working on Elastix now, and it's way more important to me than working on Ubuntu (that is just a testing machine).

Seems that the libsox API is more consistent across versions than the CLI it self. Have you considered binding your apps to libsox (using pysox maybe)?

Keep up the good work :D

On Tue, Mar 27, 2012 at 05:28, Lefteris Zafiris < reply@reply.github.com

wrote:

Unfortunately sox is a big pile of shit. I was hoping that only major versions have a totally incompatible command line syntax but as it seems minor versions suffer for this too. Please try the latest code i pushed on the repo, it contains a fix that should deal with the problem you have in elastix (it defines the type of output in playback mode to 'alsa'). As for the ubuntu version of sox i ll have to investigate it a bit more.


Reply to this email directly or view it on GitHub: https://github.com/zaf/asterisk-googletts/issues/3#issuecomment-4711989

zaf commented 12 years ago

Good to know it worked.