Re: question about sampling rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Clemens,
 
Really appreciate your time answering my question. I have already started my streaming and is facing another problem now.
 
Fs = 11025 Hz
Channel  = 2
Bit resolution = 8
 
so I tried sending my data at (11025/1000) * 2 / ms, I could hear some music played but with some noise.
 
I am using Philips Speaker with MaxPackSize = 56, channel = 2, sampling bits =16, so I decided to change my framesize:
 
11025 /1000 * 2 * 16/8 / ms -> 44, this time, I cant understand the music out. The endpoint should still be able to handle it since data rate is lesser than maxpacksize.
 
Do you know what went wrong here? hope to receive your advise.
thank...
 
grace
 


 
On 7/15/06, Clemens Ladisch <clemens@xxxxxxxxxx> wrote:
Grace Baldonasa wrote:
> After computing the rate, value could be of decimal format,

In the computer, all values are binary.

> is it rounded off to either equal or greater than the whole number
> itself?

There is no whole number, it is interpreted as a number with 16 binary
fractional digits.

> subs->freqmax = subs->freqn + (subs->freqn >> 2);
> Q: why is subs->freqn shifted by 2

It's just subs->freqn plus 25 percent, and that is just some random
value that should be safe enough for any real sample clock.

> subs->phase = 0;
> /* calculate the max. size of packet */
> maxsize = ((subs->freqmax + 0xffff) * (frame_bits >> 3)) >> 16;
>
> Q: why subs->freqmax is added with 0xffff, then frame_bits is shifted by 3
> then the whole thing shifted by 16.

It's shifted by 16 to throw away the fractional digits; we calculate
whole bytes.
"frame_bits/8" is the number of bytes per frame.
Adding 0xffff ensures that despite the truncation by the final shift,
the value is rounded up.


HTH
Clemens

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux