Lines Matching defs:channel

225     /* order by channel number if both have the same position (e.g. UNKNOWN)
236 /* create a (playback order => channel number) table with channels ordered
310 static void do_generate(uint8_t *frames, int channel, int count,
322 if (chn==(unsigned int)channel) {
616 fprintf(stderr, _("Unable to parse channel map string: %s\n"), mapstr);
621 fprintf(stderr, _("Unable to set channel map: %s\n"), mapstr);
630 /* create a channel order table for default layouts */
714 static int check_wav_file(int channel, const char *name)
719 wav_file[channel] = search_for_file(name);
720 if (! wav_file[channel]) {
725 if ((fd = open(wav_file[channel], O_RDONLY)) < 0) {
726 fprintf(stderr, _("Cannot open WAV file %s\n"), wav_file[channel]);
730 fprintf(stderr, _("Invalid WAV file %s\n"), wav_file[channel]);
735 fprintf(stderr, _("Not a WAV file: %s\n"), wav_file[channel]);
740 LE_SHORT(header.body.format), wav_file[channel]);
745 wav_file[channel], LE_SHORT(header.body.channels));
750 LE_INT(header.body.rate), wav_file[channel]);
755 LE_SHORT(header.body.sample_bits), wav_file[channel]);
759 fprintf(stderr, _("Invalid WAV file %s\n"), wav_file[channel]);
762 wav_file_size[channel] = LE_INT(header.chunk.length);
797 int channel = channel_map->pos[chn] - SND_CHMAP_FL;
798 if (channel >= 0 && channel < MAX_CHANNELS)
799 return check_wav_file(chn, wavs[channel]);
806 static int read_wav(uint16_t *buf, int channel, int offset, int bufsize)
814 if (! wav_file[channel]) {
815 fprintf(stderr, _("Undefined channel %d\n"), channel);
819 if (offset >= wav_file_size[channel])
825 wavfp = fopen(wav_file[channel], "r");
831 if (offset + bufsize > wav_file_size[channel])
832 bufsize = wav_file_size[channel] - offset;
837 if (chn == (unsigned int)channel) {
903 static int write_loop(snd_pcm_t *handle, int channel, int periods, uint8_t *frames)
913 while ((err = read_wav((uint16_t *)frames, channel, cnt, bufsize)) > 0 && !in_aborting) {
932 do_generate(frames, channel, period_size, generate_pink_noise, &pink);
934 do_generate(frames, channel, period_size, generate_pattern, &pattern);
937 do_generate(frames, channel, period_size, generate_st2095_noise, &st2095);
941 do_generate(frames, channel, period_size, generate_sine, &sine);
997 "-m,--chmap Specify the channel map to override\n"
1276 int channel = get_speaker_channel(chn);
1277 printf(" %d - %s\n", channel, get_channel_name(channel));
1279 err = write_loop(handle, channel, ((rate*3)/period_size), frames);