File: pipeplay.c

package info (click to toggle)
rsynth 2.0-2
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 716 kB
  • ctags: 544
  • sloc: ansic: 5,535; sh: 1,246; makefile: 116
file content (30 lines) | stat: -rw-r--r-- 428 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <config.h>
#include <useconfig.h>
#include <stdio.h>
#include "proto.h"
#include "getargs.h"
#include "hplay.h"
#include <fcntl.h>

static FILE *dev_fd;
long samp_rate = 8000;

int
audio_init(int argc, char **argv)
{
 dev_fd = popen("/usr/audio/bin/send_sound -l16", "w");
 return (0);
}

void
audio_term(void)
{
 pclose(dev_fd);
}

void
audio_play(int n, short *data)
{
 fwrite(data, 2, n, dev_fd);
 fflush(dev_fd);
}