mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 19:34:39 +01:00
Merge pull request #32 from xsacha/master
Fix Qt audio on all platforms
This commit is contained in:
commit
f07254e211
1 file changed
+3
-4
+3
-4
@@ -159,10 +159,9 @@ public:
|
||||
mixlen = 2*AUDIO_CHANNELS*AUDIO_SAMPLES;
|
||||
mixbuf = (char*)malloc(mixlen);
|
||||
output = new QAudioOutput(fmt);
|
||||
output->setNotifyInterval(1000*AUDIO_SAMPLES / AUDIO_FREQ);
|
||||
output->setBufferSize(mixlen);
|
||||
connect(output, SIGNAL(notify()), this, SLOT(writeData()));
|
||||
feed = output->start();
|
||||
startTimer(1000*AUDIO_SAMPLES / AUDIO_FREQ);
|
||||
}
|
||||
~MainAudio() {
|
||||
feed->close();
|
||||
@@ -172,8 +171,8 @@ public:
|
||||
free(mixbuf);
|
||||
}
|
||||
|
||||
private slots:
|
||||
void writeData() {
|
||||
protected:
|
||||
void timerEvent(QTimerEvent *) {
|
||||
memset(mixbuf, 0, mixlen);
|
||||
NativeMix((short *)mixbuf, mixlen / 4);
|
||||
feed->write(mixbuf, mixlen);
|
||||
|
||||
Reference in new issue
Block a user