41 #include "EST_cutils.h"
43 #include "EST_Option.h"
44 #include "EST_io_aux.h"
45 #include "EST_Pathname.h"
47 #ifdef SUPPORT_WIN32AUDIO
49 #include <EST_system.h>
76 int win32audio_supported = TRUE;
89 short bits_per_sample;
96 char *buffer =
new char[
sizeof(riff_header) + inwave.
length()*inwave.
num_channels() *
sizeof(short)];
98 struct riff_header *hdr = (
struct riff_header *)buffer;
99 char *data = buffer +
sizeof(
struct riff_header);
101 strncpy(hdr->riff,
"RIFF", 4);
102 hdr->file_size =
sizeof(riff_header) + inwave.
length()*
sizeof(short);
103 strncpy(hdr->wave,
"WAVE", 4);
104 strncpy(hdr->fmt,
"fmt ", 4);
105 hdr->header_size = 16;
106 hdr->sample_format = WAVE_FORMAT_PCM;
109 hdr->bytes_per_second = hdr->sample_rate * hdr->n_channels * 2;
110 hdr->block_align = hdr->n_channels * 2;
111 hdr->bits_per_sample = 16;
112 strncpy(hdr->data,
"data", 4);
113 hdr->data_size = hdr->n_channels * 2 * inwave.
num_samples();
115 memcpy(data, inwave.values().
memory(), hdr->n_channels * 2 * inwave.
num_samples());
124 int win32audio_supported = FALSE;
130 cerr <<
"Windows win32 audio not supported" << endl;