Java - субдискретизирующий wav звуковой файл

Я обычно просто использую числовой идентификатор базы данных (auto_increment) и затем использую modulu (%) оператор для выяснения, куда поместить файл. Простой и масштабируемый. Например, путь для обработки изображений с идентификатором 12345 мог быть создан как это:

12345 % 100 = 45
12345 % 1000 = 345

Заканчивается в:

/home/joe/images/345/45/12345.png

Или что-то как этот.

при использовании Linux и ext3 и файловой системы необходимо знать, что существуют пределы количеству каталогов и файлов, которые Вы можете иметь в каталоге. Предел 32000 для директоров, таким образом, необходимо всегда стремиться поддержать число на низком уровне директоров.

6
задан Jean-Francois Hamelin 16 October 2009 в 18:46
поделиться

1 ответ

I think you shouldn't use the average of those samples as that would be a median filter, not exactly downsampling. Just use every 5th/6th/7th sample and write that to the new file.

That will probably have some aliasing artifacts but might overall be recognizable.

Another, more complex solution but probably one with better results, quality-wise, would be to first convert your samples into a frequency distribution using a FFT or DFT and then convert it back with the appropriate sample rate. It's been a while since I have done such a thing but it's definitely doable. You may need to fiddle around a bit to get it working properly, though.

Also when not taking a FT of the complete array but rather in segments you have the problem of the segment boundaries being 0. A few years ago when I played with those things I didn't come up with a viable solution to this (since it generates artifacts as well) but there probably is one if you read the right books :-)

As for WMP complaining about the file: You did modify the header you write accordingly, right?

7
ответ дан 17 December 2019 в 00:11
поделиться
Другие вопросы по тегам:

Похожие вопросы: