8 static const int BITS_PER_SAMPLE = 16;
9 static const int CHANNELS = 2;
12 : sampleRate(sampleRate_)
13 , bufferSize(bufferSize_)
17 int driver = ao_default_driver_id();
20 memset(&format, 0,
sizeof(format));
21 format.bits = BITS_PER_SAMPLE;
22 format.channels = CHANNELS;
23 format.rate = sampleRate;
24 format.byte_format = AO_FMT_NATIVE;
26 device = ao_open_live(driver, &format,
nullptr );
59 reinterpret_cast<char*>(buffer),
60 len * CHANNELS * (BITS_PER_SAMPLE / 8));
virtual void mute()
Mute the sound system.
virtual ~LibAOSoundDriver()
LibAOSoundDriver(unsigned sampleRate, unsigned bufferSize)
virtual unsigned getFrequency() const
Returns the actual sample frequency.
virtual void uploadBuffer(short *buffer, unsigned len)
void format(SectorAccessibleDisk &disk, bool dos1)
Format the given disk (= a single partition).
virtual void unmute()
Unmute the sound system.
virtual unsigned getSamples() const
Get the number of samples that should be created 'per fragment'.