From: vollmer.philipp@t-online.de (Philipp Vollmer)
To: alsa-devel@lists.sourceforge.net
Subject: Re: Alsa Programming Examples
Date: Sat, 8 Jun 2002 09:26:25 +0200 [thread overview]
Message-ID: <200206080926.25082.do1ypv@linux> (raw)
In-Reply-To: <Pine.LNX.4.21.0206080040150.784-100000@summer.quitte>
[-- Attachment #1: Type: text/plain, Size: 251 bytes --]
> it seems params == 0 when you're calling snd_pcm_hw_refine.
Hello,
Sorry but there is no codeline like snd_pcm_hw_refine in the example.
I will send you the file as an attachment.
Best regards
Philipp Vollmer
vollmer.philipp@t-online.de
[-- Attachment #2: how1.c --]
[-- Type: text/x-csrc, Size: 1503 bytes --]
#include <stdlib.h>
#include <alsa/asoundlib.h>
main (int argc, char *argv[])
{
int i;
char buf[4096];
snd_pcm_t *playback_handle;
snd_pcm_hw_params_t *hw_params;
if ((playback_handle = snd_pcm_open (&playback_handle, "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
fprintf (stderr, "cannot open audio device %s\n", argv[1]);
exit (1);
}
// snd_pcm_open (&playback_handle, pcm_name, SND_PCM_STREAM_PLAYBACK, 0)
snd_pcm_hw_params_malloc (&hw_params);
snd_pcm_hw_params_any (playback_handle, hw_params);
snd_pcm_hw_params_set_access (playback_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);
snd_pcm_hw_params_set_format (playback_handle, hw_params, SND_PCM_FORMAT_S16_LE);
snd_pcm_hw_params_set_rate_near (playback_handle, hw_params, 44100, 0);
//snd_pcm_hw_params_set_rate_near(playback_handle, hw_params, 44100, 0);
snd_pcm_hw_params_set_channels (playback_handle, hw_params, 2);
snd_pcm_hw_params (playback_handle, hw_params);
snd_pcm_hw_params_free (hw_params);
snd_pcm_prepare (playback_handle);
for (i = 0; i < 10; ++i) {
snd_pcm_writei (playback_handle, buf, sizeof (buf));
//snd_pcm_writei (playback_handle, buf, nframes);
}
snd_pcm_close (playback_handle);
exit (0);
}
next prev parent reply other threads:[~2002-06-08 7:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-07 20:14 Alsa Programming Examples Philipp Vollmer
2002-06-07 22:43 ` Tim Goetze
2002-06-08 7:26 ` Philipp Vollmer [this message]
2002-06-09 10:50 ` Tim Goetze
2002-06-09 11:12 ` tomasz motylewski
2002-06-09 13:41 ` Tim Goetze
2002-06-09 18:31 ` Paul Davis
2002-06-10 6:16 ` Patrick Shirkey
-- strict thread matches above, loose matches on Subject: below --
2002-06-06 11:45 ALSA " Philipp Vollmer
2002-06-06 14:04 ` Paul Davis
2002-06-06 12:07 ` Philipp Vollmer
2002-06-06 14:22 ` Paul Davis
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=200206080926.25082.do1ypv@linux \
--to=vollmer.philipp@t-online.de \
--cc=alsa-devel@lists.sourceforge.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox