Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: sox output files (Read 4582 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

sox output files

I'm attempting to use sox to reduce the sample rate of some WAV files.  I use the following command:

cd "c:\program files (x86)\sox-14-4-2.exe"

which brings me to this prompt:

c:\Program files (x86)\sox-14-4-2>

I then enter this command:

sox test96.wav -r 48000 test48.wav

after this, I do not get an error message, but the original prompt comes back:
c:\Program files (x86)\sox-14-4-2>

No file is generated from this process.  Does anyone have any idea as to how I can make this work?  I would assume the generated file would appear in the sox-14-4-2 folder, but I've searched my computer, and it isn't there or anywhere else.  Thanks a lot for any help, after 5 hours of messing with this, I think I need some advice.

sox output files

Reply #1
You've got a typo in your cd line, but that doesn't matter.

The problem is that you're in a special directory (program files) where a normal user cannot write.

It's better to cd into a user directory, where your wav file is stored, and then simply execute sox with the full path, for example if your wav file is in your "My Documents" folder:
Code: [Select]
c:
cd c:\Users\YourUsername\Documents
"c:\program files (x86)\sox-14-4-2\sox.exe" test96.wav ...


You can also open explorer in your current directory:
Code: [Select]
explorer .

(yes, that's a period which means current directory)
"I hear it when I see it."

sox output files

Reply #2
ah, you're right, I didn't need to use the .exe--I just mistakenly put that in the post--been a long day, I guess.

sox output files

Reply #3
Sorry, I'm not familiar with command prompt stuff.  I'll only need this to do sample rate conversion.  I'm not exactly clear on your advice.  I'm not sure how to specify where the .wav file should be read from and output into in the command.  Could someone give me an example on how to do this?  I do understand the issue of there not being permissions on the folder.  I thought of that before and set full permissions, but obviously that didn't work.  I'm more of a musician than computer audio person, so I'm pretty clueless about this stuff.  Thanks for the reply and for any further help info.  I'm thinking someone with monk-level patience will be needed to get me to the end of this..

sox output files

Reply #4
Ah, I read your post a few more times, and it sunk in.  I got it to work.  Any advice from anyone on how I can convert using "very high quality linear"?  Thanks!

sox output files

Reply #5
Open explorer, put your file into a normal directory like your "My Documents" folder. Deselect the file. Then hold the shift key on your keyboard, right click in the explorer window - you should see "Open command window here". Click that. The command window should open in the right directory.

Then just enter: "c:\program files (x86)\sox-14-4-2\sox.exe" <your arguments here>
"I hear it when I see it."

sox output files

Reply #6
Oh ok.

Here's an example:
Code: [Select]
"c:\program files (x86)\sox-14-4-2\sox.exe" input.wav output.wav rate -v 48000


The -v stands for very high quality.
"I hear it when I see it."

sox output files

Reply #7
Brilliant!  Got it!  Thanks a ton for the quick responses.  One final question-- I found this on the soundexchange website:

SoX 14.4 High Quality:   No options (this is the default setting)
SoX 14.4 High Quality (Aliasing Enabled):   -b 90 -a
SoX 14.4 VHQ Linear Phase:   -v -s
SoX 14.4 VHQ Intermediate Phase:   -v -s -I
SoX 14.4 VHQ Minimum Phase:   -v -s -M

What does the -s stand for here, as I notice you didn't use that in the command you gave me.

sox output files

Reply #8
"sox.exe --help-effect rate" will tell you:

Quote
-s          Steep filter (band-width = 99%)

so, "-s" is the same as "-b 99"

sox output files

Reply #9
Quote
Sorry, I'm not familiar with command prompt stuff. I'll only need this to do sample rate conversion.
I'd probably use TAudioConverter.      Once it's set-up for your output format and location, it's drag, drop, and click, and you can drop-in multiple files.

TAudioConverter seems to use SoX for sample rate conversion, but I don't see all of the command line options.

SoX is known for high quality conversion and I've seen the graphs showing that some re-samplers are "better" than others, but I've NEVER HEARD re-sampling artifacts no matter what tool/application I was using.*    So, I don't think it's an issue (unless the DSP programmer is incompetent). 




* Of course, if you downsample to 8kHz you'll hear a loss of high frequencies, but that's not the fault of the resampling algorithm.

sox output files

Reply #10
Thanks for everyone's advice--I'm going to dig more into this command prompt stuff to wrap my head around doing batch conversions and such.  I might be back begging for advice.

In response to the previous post (and I do appreciate the advice about the alternative program), the reason I am attempting this is that I most certainly do notice a difference in the resulting 44.1 kHz audio depending on which sample rate conversion application I use.  I also notice differences depending on use of types of dither/no dither/application applying dither.  I certainly do not want to hear these differences, as they make things very complicated, and I would rather focus on composing and recording the music itself.  However, after working with a piece of music for countless hours, I become acutely familiar with the spacial and timbral qualities of the sounds.  When reducing the bit depth and sample rate of the audio, I do not hear artifacts, as I understand the term to mean perceptible distortions of sounds such as the sort of underwater symbol sound of youtube audio.  What I do notice is a loss of spacial distance between instruments/sounds and a very noticable decrease in the clarity of reverb tails and the decay of, for example, a pad chord fading into silence.  Additionally, from a more subjective perspective, I feel as if I "get lost" in the music much less effortlessly with the reduction of bit depth and sample rate.  These examples in the reduction of clarity in the music are greater/lesser depending on the application I use for sample rate conversion or dither (so far, no dither has been my preference, but I'll experiment with sox when/if I figure out the commands for bit depth reduction and dither application).  I know this runs counter to the experiences of many people and even what some say is mathematically possible, but I would say it is more a matter of attention/focus and revealing equipment than "good hearing".  Additionally, I have run numerous blind tests on these things and have had my observations confirmed by an approximately 90% accuracy in telling the difference blind.  As someone who works with music for about 10 hours daily, perhaps I have just sensitized myself to the audio in a way that makes these differences more revealing.  Not good for my peace of mind as I obsessively search for ways to make the CD audio closer to what I experience in making the music, but perhaps better for the final product, at least to my ears if no one else notices.

Also, just as a final sentiment, I am not trying to stir up a controversy here--I simply wanted to describe my experiences for the benefit of anyone else who is searching for answers/support for their observations.  I know matters of what is perceptible in digital audio reproduction can be contentious, to say the least, in many forums, but my intention is one of discussion rather than trying to get a heated debate going.  Perhaps the above description of my observations warrants a separate topic post, which I might get going on in the future.  Thanks again to everyone who pitched in with their advice.

sox output files

Reply #11
The answers to many of your questions are given in detail here, beginning with the words "SoX Resampler Settings".
But you must understand that it is in the majority of the theoretical part, practically quite often is different.

sox output files

Reply #12
But keep in mind that that website contains BS otherwise. The Resampler Settings section is only fairly accurate because it's basically the same as can be found in the sox manual: sox.pdf (search for "very high" to immediately find the rate effect section)
"I hear it when I see it."

sox output files

Reply #13
I sometimes wonder why people here don't see a troll even when he kicks you directly in the balls. Must be some smarta** attitude. C'mon let Bublic discuss this with KingR and simply move it to the recycler afterwards.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

sox output files

Reply #14
??? I was just trying to help with how to use sox.exe on the command line.
I've just now read KingR's latest longer posting...

@KingR: Yes, this warrants a new thread and you should be ready to provide evidence for your claims when asked, as agreed upon in the ToS.
"I hear it when I see it."

sox output files

Reply #15
I am also glad to see you, Wombat. But maybe KingR not a troll, and I just said that everyone has the opportunity to listen to and evaluate the quality of SoX in different modes. What do you think about this? Just Inquisition everywhere.

sox output files

Reply #16
Nope, I'm definitely not a troll.  I came here for some help about the commands for sox.  The poster before shared his observation that he can hear no differences between programs (which prompted my response, which was not inflammatory or rude), I shared my observation that I can.  I wasn't aware, upon writing the post, that I was doing anything substantially different from the prior poster or that my post would illicit the ire of other forum members.  My understanding was that this was a forum for discussing matters involved in audio reproduction, but I understand now that relating observations about audio reproduction is something that should not be addressed here.  I'm honestly not an 'audiophile' trying to justify spending massive amounts of money on equipment--just a musician with a pretty humble recording setup trying to preserve and publish recordings that are the truest to the performances as I can, and learning as much as I can along the way.  Sample rate conversion is about the lowest on the list of things I consider when making recordings, as pretty much everything else makes a much bigger difference in my experience, but I'm just trying to do the best job I can and be thorough. 

Again, I really appreciate all of the quick responses concerning the command codes.  Hopefully someone else trying to figure out how to get started with the program will stumble upon it and it'll help them too.  Looking forward to learning more about command prompt stuff to try to do a few more things with the program.  All the best.

sox output files

Reply #17
> I understand now that relating observations about audio reproduction is something that should not be addressed here.

It's totally fine, after all, audio can only be observed, but when you start writing 500 words of flowery prose and casually describe obvious differences after running the data through a process that does pretty much nothing, that's when the eyelids start twitching, even if it's true that resamplers can be bad, even if it's true that training makes one more sensitive.

In other words, make a claim, but show your test data, lest you add to the noise.


k, back to sox