Commit de9af241 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Split the 'dsound' test into two parts:

- the sound format test. Plays a 5 second reference tone to help debug issues with the tone duration and help detect stutter issues. Prints explanations describing the sound format interactive test. Then plays a 1 second test tone for each supported sound format. - the 3D sound tests. Performs the volume, panning, moving listener tests, etc.
parent ca7cdb8b
Makefile
capture.ok
ds3d.ok
dsound.ok
propset.ok
testlist.c
......@@ -8,6 +8,7 @@ EXTRALIBS = -ldxguid -luuid -ldxerr9
CTESTS = \
capture.c \
ds3d.c \
dsound.c \
propset.c
......
......@@ -34,48 +34,10 @@
#include "mmreg.h"
#include "dxerr9.h"
static const unsigned int formats[][3]={
{ 8000, 8, 1},
{ 8000, 8, 2},
{ 8000, 16, 1},
{ 8000, 16, 2},
{11025, 8, 1},
{11025, 8, 2},
{11025, 16, 1},
{11025, 16, 2},
{22050, 8, 1},
{22050, 8, 2},
{22050, 16, 1},
{22050, 16, 2},
{44100, 8, 1},
{44100, 8, 2},
{44100, 16, 1},
{44100, 16, 2},
{48000, 8, 1},
{48000, 8, 2},
{48000, 16, 1},
{48000, 16, 2},
{96000, 8, 1},
{96000, 8, 2},
{96000, 16, 1},
{96000, 16, 2}
};
#define NB_FORMATS (sizeof(formats)/sizeof(*formats))
#include "dsound_test.h"
#define NOTIFICATIONS 5
static void init_format(WAVEFORMATEX* wfx, int format, int rate, int depth, int channels)
{
wfx->wFormatTag=format;
wfx->nChannels=channels;
wfx->wBitsPerSample=depth;
wfx->nSamplesPerSec=rate;
wfx->nBlockAlign=wfx->nChannels*wfx->wBitsPerSample/8;
if (wfx->nBlockAlign==0) /* align compressed formats to byte boundry */
wfx->nBlockAlign=1;
wfx->nAvgBytesPerSec=wfx->nSamplesPerSec*wfx->nChannels*wfx->wBitsPerSample/8;
wfx->cbSize=0;
}
static char * format_string(WAVEFORMATEX* wfx)
{
......
/*
* Unit tests for dsound functions
*
* Copyright (c) 2004 Francois Gouget
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
static const unsigned int formats[][3]={
{ 8000, 8, 1},
{ 8000, 8, 2},
{ 8000, 16, 1},
{ 8000, 16, 2},
{11025, 8, 1},
{11025, 8, 2},
{11025, 16, 1},
{11025, 16, 2},
{22050, 8, 1},
{22050, 8, 2},
{22050, 16, 1},
{22050, 16, 2},
{44100, 8, 1},
{44100, 8, 2},
{44100, 16, 1},
{44100, 16, 2},
{48000, 8, 1},
{48000, 8, 2},
{48000, 16, 1},
{48000, 16, 2},
{96000, 8, 1},
{96000, 8, 2},
{96000, 16, 1},
{96000, 16, 2}
};
#define NB_FORMATS (sizeof(formats)/sizeof(*formats))
/* The time slice determines how often we will service the buffer */
#define TIME_SLICE 100
#define BUFFER_LEN (4*TIME_SLICE)
extern char* wave_generate_la(WAVEFORMATEX*,double,DWORD*);
extern HWND get_hwnd();
extern void init_format(WAVEFORMATEX*,int,int,int,int);
extern void test_buffer(LPDIRECTSOUND,LPDIRECTSOUNDBUFFER,
BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
LPDIRECTSOUND3DLISTENER,BOOL,BOOL);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment