From: Clemens Ladisch <clemens@ladisch.de>
To: Ignacy Kasperowicz <fikufik@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Problem with setting period time and buffer time.
Date: Tue, 19 Feb 2008 15:45:50 +0100 [thread overview]
Message-ID: <47BAEB9E.4050202@ladisch.de> (raw)
In-Reply-To: <9673d3ac0802190449x7130357cg6518402f7e9862d0@mail.gmail.com>
Ignacy Kasperowicz wrote:
>> Just write the data to the device.
>
> Ok, but when I just write data to the device I don't really know how
> long it'll be playing.
But you know how many sample you are writing, and you know the sample
rate.
> There is no problem when I've infinite loop with writei inside. but I
> need to change freq of my sound signal with exact 843 us period time.
Assuming a sample rate of 48 kHz, 1/1200 s corresponds to exactly
40 samples. At 44.1 kHz, this would be 36.75 samples, so you'd have to
use groups of 37+37+37+36 samples with appropriate phase shifting.
BTW: 1 / 1200 Hz = 833.33... µs
HTH
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2008-02-19 14:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-18 23:57 Problem with setting period time and buffer time Ignacy Kasperowicz
2008-02-19 8:17 ` Clemens Ladisch
[not found] ` <9673d3ac0802190320gab8bb7ara92a27b7f602d28b@mail.gmail.com>
2008-02-19 12:41 ` Ignacy Kasperowicz
2008-02-19 12:42 ` Clemens Ladisch
2008-02-19 12:49 ` Ignacy Kasperowicz
2008-02-19 14:45 ` Clemens Ladisch [this message]
2008-02-19 20:19 ` Ignacy Kasperowicz
2008-02-20 0:35 ` Ignacy Kasperowicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47BAEB9E.4050202@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=fikufik@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.