mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-24 11:49:05 +02:00
Some improvements to Qt Audio.
This commit is contained in:
1 parent
b83fea1b6b
commit
26dfe75882
2 files changed
+4
-3
No files matched your search
+3
-3
@@ -233,10 +233,10 @@ public slots:
|
||||
fmt.setSampleSize(AUDIO_SAMPLESIZE);
|
||||
fmt.setByteOrder(QAudioFormat::LittleEndian);
|
||||
fmt.setSampleType(QAudioFormat::SignedInt);
|
||||
mixlen = 5*2*AUDIO_CHANNELS*AUDIO_SAMPLES;
|
||||
mixlen = 2*AUDIO_CHANNELS*AUDIO_SAMPLES;
|
||||
mixbuf = (char*)malloc(mixlen);
|
||||
output = new QAudioOutput(fmt);
|
||||
output->setBufferSize(mixlen);
|
||||
output->setBufferSize(mixlen*10);
|
||||
feed = output->start();
|
||||
if (feed != NULL)
|
||||
timer = startTimer(1000*AUDIO_SAMPLES / AUDIO_FREQ);
|
||||
@@ -245,7 +245,7 @@ public slots:
|
||||
protected:
|
||||
void timerEvent(QTimerEvent *) {
|
||||
memset(mixbuf, 0, mixlen);
|
||||
size_t frames = NativeMix((short *)mixbuf, 5*AUDIO_SAMPLES);
|
||||
size_t frames = NativeMix((short *)mixbuf, AUDIO_SAMPLES);
|
||||
if (frames > 0)
|
||||
feed->write(mixbuf, sizeof(short) * 2 * frames);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifndef HAVE_MKSTEMP
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
Reference in new issue
Block a user