2012-11-01 16:19:01 +01:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
2012-11-04 23:01:49 +01:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 16:19:01 +01:00
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2013-10-02 01:54:55 +05:30
|
|
|
|
2021-05-06 01:31:38 +02:00
|
|
|
#include "Common/File/Path.h"
|
|
|
|
|
|
2013-10-07 20:26:10 +02:00
|
|
|
#include "sceAudio.h"
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2015-01-29 12:55:49 +01:00
|
|
|
struct AudioDebugStats {
|
|
|
|
|
int buffered;
|
|
|
|
|
int watermark;
|
|
|
|
|
int bufsize;
|
|
|
|
|
int underrunCount;
|
|
|
|
|
int overrunCount;
|
|
|
|
|
int instantSampleRate;
|
2020-05-16 19:44:33 +02:00
|
|
|
int targetSampleRate;
|
2015-01-29 12:55:49 +01:00
|
|
|
int lastPushSize;
|
|
|
|
|
};
|
|
|
|
|
|
2012-11-01 16:19:01 +01:00
|
|
|
// Easy interface for sceAudio to write to, to keep the complexity in check.
|
|
|
|
|
|
|
|
|
|
void __AudioInit();
|
2012-12-28 00:05:54 -08:00
|
|
|
void __AudioDoState(PointerWrap &p);
|
2017-11-14 05:12:27 +01:00
|
|
|
void __AudioUpdate(bool resetRecording = false);
|
2012-11-01 16:19:01 +01:00
|
|
|
void __AudioShutdown();
|
2012-11-17 14:20:04 +01:00
|
|
|
void __AudioSetOutputFrequency(int freq);
|
2019-06-30 23:09:46 -07:00
|
|
|
void __AudioSetSRCFrequency(int freq);
|
2012-11-01 16:19:01 +01:00
|
|
|
|
|
|
|
|
// May return SCE_ERROR_AUDIO_CHANNEL_BUSY if buffer too large
|
|
|
|
|
u32 __AudioEnqueue(AudioChannel &chan, int chanNum, bool blocking);
|
2013-06-05 12:20:07 -07:00
|
|
|
void __AudioWakeThreads(AudioChannel &chan, int result, int step);
|
|
|
|
|
void __AudioWakeThreads(AudioChannel &chan, int result);
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2016-09-03 10:06:40 -04:00
|
|
|
// Audio Dumping stuff
|
2021-05-06 01:31:38 +02:00
|
|
|
void __StartLogAudio(const Path &filename);
|
2016-09-03 10:06:40 -04:00
|
|
|
void __StopLogAudio();
|
2017-11-14 05:12:27 +01:00
|
|
|
|
2023-03-24 17:19:57 +01:00
|
|
|
class WAVDump {
|
2017-11-14 05:12:27 +01:00
|
|
|
public:
|
|
|
|
|
static void Reset();
|
|
|
|
|
};
|