--- hatari/src/includes/sound.h 2019/04/01 07:09:16 1.1 +++ hatari/src/includes/sound.h 2019/04/01 07:10:37 1.1.1.4 @@ -1,22 +1,35 @@ /* - Hatari + Hatari - sound.h + + This file is distributed under the GNU Public License, version 2 or at + your option any later version. Read the file gpl.txt for details. */ +#ifndef HATARI_SOUND_H +#define HATARI_SOUND_H + + /* Envelope shape table */ -typedef struct { - int WaveStart[4],WaveDelta[4]; +typedef struct +{ + int WaveStart[4], WaveDelta[4]; } ENVSHAPE; -#define MIXBUFFER_SIZE 4096 /* Size of circular buffer to store sample to (44Khz) */ -#define MIXBUFFER_LENGTH (MIXBUFFER_SIZE-1) +#define MIXBUFFER_SIZE 8192 /* Size of circular buffer to store sample to (44Khz) */ #define SAMPLES_BUFFER_SIZE 1024 -#define SAMPLES_PER_FRAME SoundPlayBackFreqFrameLengths[OutputAudioFreqIndex][0] /* Number of generated samples per frame(eg 44Khz=882) */ -#define SAMPLES_FREQ (SAMPLES_PER_FRAME*50) /* Frequency of generated samples */ +/* Number of generated samples per frame (eg. 44Khz=882) : */ +#define SAMPLES_PER_FRAME ((SoundPlayBackFrequencies[OutputAudioFreqIndex]+25)/50) +/* Frequency of generated samples: */ +#define SAMPLES_FREQ (SoundPlayBackFrequencies[OutputAudioFreqIndex]) #define YM_FREQ (2000000/SAMPLES_FREQ) /* YM Frequency 2Mhz */ + extern BOOL bWriteEnvelopeFreq,bWriteChannelAAmp,bWriteChannelBAmp,bWriteChannelCAmp; extern BOOL bEnvelopeFreqFlag; +extern char MixBuffer[MIXBUFFER_SIZE]; +extern int SoundCycles; +extern int nGeneratedSamples; extern void Sound_Init(void); extern void Sound_Reset(void); @@ -26,10 +39,11 @@ extern void Sound_CreateLogTables(void); extern void Sound_CreateEnvelopeShapes(void); extern void Sound_CreateSoundMixClipTable(void); extern void Sound_GenerateYMFrameSamples(void); -extern void Sound_PassYMSamplesToDirectSound(void); extern void Sound_UpdateHBL(void); extern void Sound_Update(void); extern void Sound_Update_VBL(void); -extern BOOL Sound_BeginRecording(/*HWND hWnd,*/char *pszCaptureFileName); -extern void Sound_EndRecording(/*HWND hWnd*/); +extern BOOL Sound_BeginRecording(char *pszCaptureFileName); +extern void Sound_EndRecording(); extern BOOL Sound_AreWeRecording(void); + +#endif /* HATARI_SOUND_H */