sox

Any idea why I can execute command from Command Line but not From PHP exec()

萝らか妹 提交于 2019-12-10 07:37:02
问题 OK, I have done some creative searches and am kind of hitting a road block. I am trying to use the linux program "sox." I am trying to call it from my PHP script. The script DOES work if I use the command line. However, when I use PHP exec, it does not work. Example: sox file1.mp3 file2.mp3 tempfile.mp3 -V3 ("V3" specifies a verbose output) When executing in the command line as "User X" or as root, I am able to create the new file. However, when I execute the command as: <?php exec('sox file1

Can I use SoX to generate audio?

╄→尐↘猪︶ㄣ 提交于 2019-12-08 16:20:20
问题 For a project I am working on, I need to use the SoX tool for audio generation. If there is a way to use SoX to generate certain notes/tones for a certain duration, please let me know! I have done quite some research on this to no avail. Moreover, any way to make it output directly into your speakers? I'm thinking something like redirection to /dev/audio. 回答1: You can synthesise sound effects using synth and the -n option. For instance, the following command creates a 3 seconds sine wav at

Change huge amount of data from NIST to RIFF wav file

♀尐吖头ヾ 提交于 2019-12-07 17:38:43
问题 So, I am writing a speech recognition program. To do that I downloaded 400MB of data from TIMIT. When I inteded to read the wav files (I tried two libraries) as follow: import scipy.io.wavfile as wavfile import wave (fs, x) = wavfile.read('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV') w = wave.open('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV') In both cases they have the problem that the wav file format says 'NIST' and it must be in 'RIFF' format. (Something about sph also I readed but the nist file I

Batch measurements of .wav files with sox stats

六眼飞鱼酱① 提交于 2019-12-07 12:31:58
问题 My question is similar to a previous question about "get-mean-amplitude-of-wav-from-sox": Get Mean amplitude(only) of .wav from sox I would like to be able to use the stats sox to do batch measurements of 1,000's of .wav files in a directory, and store the results in a data frame or some similar structure I can save as a csv text file. For one sound file, the code would be: ./sox SampleSound.wav -n stat Resulting in the following output: Samples read: 72000000 Length (seconds): 3600.000000

crossfading a group of audio files with sox splice

我们两清 提交于 2019-12-07 07:49:29
问题 I am able to join and crossfade two audio files using SoX, like so: sox file1.wav file2.wav outfile.wav splice -q `soxi -D file1.wav`,0.5 where the soxi substitution is fetching the duration of file1 and 0.5 is the length of the cross-fade. I am now trying to extend this to an arbitrary number of files, in order to string them together with short crossfades in between. There would seem to be 2 approaches: piping and scripting. Sox has a -p option telling it to treat it's output as piped

how to trim audio file with specific time from text file by using SoX in Mac terminal?

亡梦爱人 提交于 2019-12-06 15:35:24
I have a text file looks like this text file ,and I want to use sox to trim the audio file based on the time in the text file, so I can have different audio clips from 0.0 to 6.16, 6.16 to 13.44, 13.44 to 17.54 etc.. I understand the basic script for sox trim is *$ sox audio.wav newaudio.wav trim starttime duration* But how can I get the duration from the text file and use sox to trim the audio? Updated Answer I think the following code may be closer: #!/bin/bash index=0 while read this; do if [ $index -gt 0 ]; then d=$(bc <<< "$this - $start") echo sox audio.wav new-$index.wav trim \"$start\"

building libsox for iOS question

独自空忆成欢 提交于 2019-12-06 14:12:20
I want to build libsox for iphone device but I havent got any luck doing so. I am just wondering if it is even possible to build this library for iphone.... einsteinx already posted from my blog ;) but here both links again First post explains how you build libsox: http://uberblo.gs/2011/04/iosiphoneos-equalizer-with-libsox-making-it-a-framework The second explains how to use it: http://uberblo.gs/2011/04/iosiphoneos-equalizer-with-libsox-doing-effects please up the answer if it helped you! thanks! http://uberblo.gs/2011/04/iosiphoneos-equalizer-with-libsox-making-it-a-framework ^ This is a

Pipe ffmpeg stream to sox rec

╄→гoц情女王★ 提交于 2019-12-06 07:43:41
I am reading an audio stream via ffpmeg like this: ffmpeg -i http://icecast.radiovox.org:8000/live.ogg -f mp3 filename and want to pipe it to a sox command: rec filename rate 32k silence 1 0.1 3% 1 3.0 3%. Ultimately, what I am trying to achieve, is to record the audio from a live Icecast stream of a talk show. I only want recordings though of the individual's speaking. Everytime there is silence, I want to stop the recording and start a new one once they start speaking again. What difficulty did you meet? I tried myself and the only problem I noticed in using the example given in the sox man

Coverting PCM 16bit LE to WAV

可紊 提交于 2019-12-06 02:16:37
I'm trying to write a program in C that converts a captured Raw 16kHz PCM 16-bit file to a 16-bit WAV . I've read some posts and people recommended using libsox . Installed it and now i'm really struggling with understanding the man-page . So far (by reading the example in the source dist) I've figured out that the structs : sox_format_t sox_signalinfo_t can probably be used to describe the data I'm inputting. I also know how much info i'm processing (time) if that is somehow necessary? Some guidance is appreciated! I would recommend to write WAV header and data manually, it is really very

Change huge amount of data from NIST to RIFF wav file

自闭症网瘾萝莉.ら 提交于 2019-12-05 22:42:21
So, I am writing a speech recognition program. To do that I downloaded 400MB of data from TIMIT. When I inteded to read the wav files (I tried two libraries) as follow: import scipy.io.wavfile as wavfile import wave (fs, x) = wavfile.read('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV') w = wave.open('../data/TIMIT/TRAIN/DR1/FCJF0/SA1.WAV') In both cases they have the problem that the wav file format says 'NIST' and it must be in 'RIFF' format. (Something about sph also I readed but the nist file I donwloaded are .wav, not .sph). I downloaded then SOX from http://sox.sourceforge.net/ I added the path