› Forums › Technical support › Downsampling with sox
- This topic has 5 replies, 2 voices, and was last updated 1 year, 6 months ago by Simon.
-
AuthorPosts
-
-
February 8, 2023 at 12:21 #16768
In the instructions, you say that
if we recorded at 24bits instead of 16bits, we should use sox to change the bit depth, and we can downsample at the same time using sox instead of ch_wave:
bash$ sox recordings/arctic_a0001.wav -b16 -r 16k wav/arctic_a0001.wav
Which is the flag I need to use to downsample at the same time? Does the flag -r indicate the original recording sampling rate (in which case I would have to change this to 48k) or the target downsampled rate?
Thanks 🙂
-
February 8, 2023 at 13:13 #16769
-r
indicates the sampling rate of the output file.sox
will automatically determine the sampling rate of the input.-
February 9, 2023 at 16:41 #16770
Thanks Simon. I realised I had also recorded with 2 channels so needed to discard 1. Now I’m running something like:
bash$ sox recordings/arctic_a0001.wav -b16 -r 16k wav/arctic_a0001.wav remix 1
Now it seems like the files in the wav directory are much bigger (68.7 MB each) compared to in the recordings directory (1.1 MB each). Where am I going wrong? I expected them to be much smaller in the wav dir.
This is causing problems when I get to do_alignment. It’s throwing an AllocBlock error.
-
-
February 9, 2023 at 18:00 #16771
Run
soxi recordings/arctic_a0001.wav
to see information about that file format, and post the output here. If you wish, attach one file, such asrecordings/arctic_a0001.wav
to your post so I can investigate. -
February 9, 2023 at 18:08 #16772
This is the output from soxi:
Input File : ‘recordings/arctic_a0001.wav’
Channels : 2
Sample Rate : 48000
Precision : 24-bit
Duration : 00:00:03.84 = 184320 samples ~ 288 CDDA sectors
File Size : 1.11M
Bit Rate : 2.31M
Sample Encoding: 24-bit Signed Integer PCMI’ve attached a sample file too.
Attachments:
You must be logged in to view attached files. -
February 10, 2023 at 13:13 #16774
bash$ sox recordings/arctic_a0001.wav -b16 -r 16k wav/arctic_a0001.wav remix 1
works as expected for me on your file.
Use
soxi
to inspect your output file: does it have the expected sampling rate, bit depth and duration?One explanation for the large size of your output file could be that you accidentally combined multiple files, which would happen if you did this:
bash$ sox recordings/*.wav -b16 -r 16k wav/arctic_a0001.wav remix 1
-
-
AuthorPosts
- You must be logged in to reply to this topic.