49 #ifdef SUPPORT_WIN32AUDIO 68 WINBOOL STDCALL PlaySoundA(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
71 #define PlaySound PlaySoundA 87 short bits_per_sample;
94 char *buffer =
new char[
sizeof(riff_header) + inwave.
length()*inwave.
num_channels() *
sizeof(short)];
96 struct riff_header *hdr = (
struct riff_header *)buffer;
97 char *data = buffer +
sizeof(
struct riff_header);
99 strncpy(hdr->riff,
"RIFF", 4);
100 hdr->file_size =
sizeof(riff_header) + inwave.
length()*
sizeof(short);
101 strncpy(hdr->wave,
"WAVE", 4);
102 strncpy(hdr->fmt,
"fmt ", 4);
103 hdr->header_size = 16;
107 hdr->bytes_per_second = hdr->sample_rate * hdr->n_channels * 2;
108 hdr->block_align = hdr->n_channels * 2;
109 hdr->bits_per_sample = 16;
110 strncpy(hdr->data,
"data", 4);
111 hdr->data_size = hdr->n_channels * 2 * inwave.
num_samples();
128 cerr <<
"Windows win32 audio not supported" << endl;
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
int play_win32audio_wave(EST_Wave &inwave, EST_Option &al)
Utility IO Function header file.
ssize_t length() const
return the size of the waveform, i.e. the number of samples.
ssize_t num_samples() const
return the number of samples in the waveform
const EST_SMatrix & values() const
int sample_rate() const
return the sampling rate (frequency)
ssize_t num_channels() const
return the number of channels in the waveform