Последний раз редактировалось null_device; 03.10.2015 в 13:41.
Когда есть, но не знаешь где - это все равно, что нету.
С любовью к вам, Yandex.Direct
Размещение рекламы на форуме способствует его дальнейшему развитию
Тут есть инфа - http://support.microsoft.com/kb/89879/ru
Ну и тут еще немного - http://arcw.comptek.ru/telephony/tnotes/tt1-13.html
Принцип декодирования ADPCM:
В принципе ничего сложного, но врядли хватит спеку сил на лету это распаковать, хотя все зависит от частоты дискретизации.ADPCM Decoding
Figure 2 shows a block diagram of the ADPCM decoding process. An ADPCM sample is presented to the decoder. The decoder computes the difference between the previous linear output estimate and the anticipated one. This difference is added to the previous estimate to produce the linear output estimate. The input ADPCM sample is also presented to the step size calculator to compute the step size estimate.
Figure 2
The decoder accepts ADPCM code values, L(n), and step size values. It calculates a reproduced differential value, and accumulates an estimated waveform value, X. Here is a pseudocode algorithm:
d(n) = (ss(n)*B2)+(ss(n)/2*B1)+(ss(n)/4*B0)+(ss(n)/8)
if (B3 = 1)
then d(n) = d(n) * (-1)
_ _
X(n) = X(n-1) + d(n)
Note: For the calculation of ss(n), see Calculation of Step Size.
Calculation of Step Size
For both the encoding and decoding process, the ADPCM algorithm adjusts the quantizer step size based on the most recent ADPCM value. The step size for the next sample, n+1, is calculated with the following equation:
ss(n+1) = ss(n) * 1.1M(L(n))
This equation can be implemented efficiently as a two-stage lookup table. First the magnitude of the ADPCM code is used as an index to look up an adjustment factor as shown in Table 1) . Then that adjustment factor is used to move an index pointer in Table 2. The index pointer then points to the new step size. Values greater than 3 will increase the step size. Values less than 4 decrease the step size.
Table 1 - M(L(n)) Values
Table 2 - Calculated Step SizesКод:L(n) Value M(L(n)) 1111 or 0111 +8 1110 or 0110 +6 1101 or 0101 +4 1100 or 0100 +2 1011 or 0011 -1 1010 or 0010 -1 1001 or 0001 -1 1000 or 0000 -1
This method of adapting the scale factor with changes in the waveform is optimized for voice signals, not square waves or other non-sinusoidal waveforms.Код:No. Step Size No. Step Size No. Step Size No. Step Size 1 16 13 50 25 157 37 494 2 17 14 55 26 173 38 544 3 19 15 60 27 190 39 598 4 21 16 66 28 209 40 658 5 23 17 73 29 230 41 724 6 25 18 80 30 253 42 796 7 28 19 88 31 279 43 876 8 31 20 97 32 307 44 963 9 34 21 107 33 337 45 1060 10 37 22 118 34 371 46 1166 11 41 23 130 35 408 47 1282 12 45 24 143 36 449 48 1411 49 1552
Initial Conditions
When the ADPCM algorithm is reset the step size ss(n) is set to the minimum value (16) and the estimated waveform value X is set to zero (half scale). Playback of 48 samples (24 bytes) of plus and minus zero (10002 and 00002) will reset the algorithm. Twenty four bytes of 08 Hex or 80 Hex will satisfy this requirement. It is necessary to alternate positive and negative zero values because the encoding formula always adds 1/8 of the quantization size. If all values were positive or negative, a DC component would be added that would create a false reference level.
GS-у и DMAUSC это под силу, а вот AY не уверен.
Последний раз редактировалось Дмитрий; 06.08.2012 в 11:08.
http://zxpress.ru/article.php?id=1382
Монстру я верю.(есть исходник, играет по MCC примерно 20кГц
с распаковкой из 2bit!!!
хорошо, есть алгоритм,который дает звук без формата, тогда куда он спасет?
рассуждения не очень тащемта, но как получается вывод более чистый звука?
дальнейшее теории меня просто пугают.
http://countercomplex.blogspot.com/2...e-line-of.html
в ссылке, кстати, есть еще одна тема:
http://countercomplex.blogspot.com/2...ine-music.html
но потом я нифига не понимаю( получается, что звук гонится в PCM, тогда вопрос - куда идти чтобы улучшить звук?
и в дальнейшем, другие алгоритмы генерации музыки ведут или к срачу, или к бестолковому трепу с теми, кому медведь на ухо наступил.
Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)