Questions tagged [libsox]

LibSoX is an audio file-format and effects library.

LibSoX is a library of sound sample file format readers/writers and sound effects processors. It is mainly developed for use by SoX (Sound exChange) but is useful for any sound application.

Resources

See Also

35 questions
1
vote
1 answer

How to change tempo of sound file using libsox in C?

I developed C code to change tempo(increase /deccrese) of sound file(3 to 10 seconds ogg files) using libsox library on Ubuntuusing following sample code.With tempo(value > 1) I am getting output file (with truncted voice) however for tempo (value <…
raj123
  • 564
  • 2
  • 10
  • 27
1
vote
1 answer

Processing audio file in memory with lib sox

I am trying to process audio file in memory with SOX C++ API and I stuck at the very beginning. The goal is to load an audio file from disk, apply few effects (tempo/gain adjustments) in memory. Here is the code I started with, but I receive a…
Egor Lakomkin
  • 1,374
  • 14
  • 26
1
vote
2 answers

libsox: record from default microphone

I need to open the default audio capture device and start recording. libsox seems to be a nice cross-platform solution. Using the binary frontend, I can just rec test.wav and the default microphone is activated. However, when browsing the…
Vorac
  • 8,726
  • 11
  • 58
  • 101
1
vote
1 answer

Hog mode / Exclusive access to audio output device with SoX

I would like to know whether SoX/LibSoX offers the possibility to access a sound device in exclusive/hog mode. The idea is to prevent other applications from accessing the sound card / DAC that is being used by the focal app. My main target is OSX…
retrography
  • 6,302
  • 3
  • 22
  • 32
1
vote
2 answers

Combining fade function and convert to a flac file

I'm using linux trying to fade and convert an audio file to flac see command below sox /tmp/audio1.wav /tmp/audio2.flac fade h 0:60 0 0:60 How can I add the flac option "-b 16" to the line above thanks
Rick T
  • 3,349
  • 10
  • 54
  • 119
0
votes
0 answers

Sox is splitting audio file a little too early

I am splitting an audio file with sox and it works reasonably well with these settings: sox in.wav out5.wav silence -l 1 0.1 1% 1 0.5 1% : newfile : restart However, it often cuts just a little bit too early at the beginning, meaning that the…
antonwilhelm
  • 5,768
  • 4
  • 19
  • 45
0
votes
0 answers

Playing multiple files simultaneously using sox in linux

I am writing a script that plays announcement using sox in linux. I use the following syntax to specify the file and the speaker to play to: sox -v 1.5 file.mp3 -t pulseaudio [speaker_name] Is there a way to play the same file into two different…
Bahi8482
  • 489
  • 5
  • 15
0
votes
0 answers

Using the sox synthesizer in C

How can I do something like play -n synth 0.2 saw F#3 in C with libsox? Is it possible at all? I couldn't find anything like that in the docs.
0
votes
1 answer

How to create null output effect?

I want to write a program just don't produce output file. How can I do that? I try to create sox_format_t with empty string or NULL string: sox_format_t* out = sox_open_write(NULL, &signalInfo, &encodingInfo, NULL, NULL, NULL); sox_format_t* out =…
desperateLord
  • 303
  • 2
  • 9
0
votes
2 answers

How to change the bitrate using SoX

I'm trying to change the bitrate of the given audio file, the following code generate an audio with 1411 kbps sox -t wav input.wav -C 320 output.wav speed 0.86 reverb 52 50 100 100 0 0; Can anyone guide me to how I can change the audio bitrate to…
0
votes
1 answer

sox library call main, and error is can't open input file `1', why?

I use the sox library on android, and i use the command to change the channel of mp3 file sox /storage/emulated/0/Music/Drivethrough.mp3 -c 1 /storage/emulated/0/Android/data/com.tian.xxx/cache/temp/results.mp3 when i run it, display can't open…
badboy_tqj
  • 300
  • 2
  • 14
0
votes
1 answer

Installing torchaudio in Windows

I am trying to install torchaudio in Windows from source. I installed sox and added it in the path env variable. Then I run python setup.py install cloned from the GitHub. When I import torchaudio, I get warning No audio backend is available. I…
Nikhil Jagtap
  • 110
  • 1
  • 13
0
votes
1 answer

Prevent SoX from doing the clipping?

I have a heavily "overflowed" WAV file (samples written in float 32-bit format): instead of [-1.0,+1.0], the samples range goes as far as [-5.0,+5.0]. Using SoX to get raw PCM audio samples from WAV file: sox --bits 32 --channels 1 --encoding…
Danijel
  • 8,198
  • 18
  • 69
  • 133
0
votes
0 answers

Sox - Using silence effect in C++

I am trying to use the sox silence effect in C++ char* silenceOptions[25]; silenceOptions[0] = "-l 1 0.2 1% -1 0.2 1%"; sox_effect_options(effect, 7, silenceOptions); I get the output: silence: usage: [ -l ] above_periods [ duration threshold[d|%]…
Chris
  • 839
  • 1
  • 12
  • 30
0
votes
3 answers

Mix and trim 2 files with Sox

I need a little bit help and hope to find that here. I am using sox for tagging some music with voice tags on my server while user is uploading the file. This is my command which I was using. Everything is working fine. sox -m {voice_tag_loop}…