mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
Win32: equal to config dir for now Linux: respect XDG_CACHE_HOME if specified OSX: possibly incomplete
33 lines
567 B
C++
33 lines
567 B
C++
#include "stdafx.h"
|
|
#include "AudioDumper.h"
|
|
|
|
|
|
AudioDumper::AudioDumper(u16 ch)
|
|
: m_header(ch)
|
|
{
|
|
if (GetCh())
|
|
{
|
|
m_output.open(fs::get_cache_dir() + "audio.wav", fs::rewrite);
|
|
m_output.write(m_header); // write initial file header
|
|
}
|
|
}
|
|
|
|
AudioDumper::~AudioDumper()
|
|
{
|
|
if (GetCh())
|
|
{
|
|
m_output.seek(0);
|
|
m_output.write(m_header); // rewrite file header
|
|
}
|
|
}
|
|
|
|
void AudioDumper::WriteData(const void* buffer, u32 size)
|
|
{
|
|
if (GetCh())
|
|
{
|
|
verify(HERE), size, m_output.write(buffer, size) == size;
|
|
m_header.Size += size;
|
|
m_header.RIFF.Size += size;
|
|
}
|
|
}
|