📄 wmaudiotesthelpers.h
字号:
/*-----------------------------------------------------------------------------
* Copyright (c) Wolfson Microelectronics plc. All rights reserved.
*
* This software as well as any related documentation is furnished under
* license and may only be used or copied in accordance with the terms of the
* license. The information in this file is furnished for informational use
* only, is subject to change without notice, and should not be construed as
* a commitment by Wolfson Microelectronics plc. Wolfson Microelectronics plc
* assumes no responsibility or liability for any errors or inaccuracies that
* may appear in this document or any software that may be provided in
* association with this document.
*
* Except as permitted by such license, no part of this document may be
* reproduced, stored in a retrieval system, or transmitted in any form or by
* any means without the express written consent of Wolfson Microelectronics plc.
*
* $Id: WMAudioTestHelpers.h 2819 2006-03-27 08:03:10Z fb $
*
* Helper functions for audio testing.
*
*
* Warning:
* This driver is specifically written for Wolfson Codecs. It is not a
* general CODEC device driver.
*
* ---------------------------------------------------------------------------*/
#ifndef __WMAUDIOTESTHELPERS_H__
#define __WMAUDIOTESTHELPERS_H__
/*
* Include files
*/
#include "WMConfig.h"
/*
* Only build this if we are asked to.
*/
#if WM_AUDIO && WM_TESTING
/*
* Global definitions
*/
/*
* A structure to define a note to play.
*/
typedef struct tagWM_TEST_SOUND
{
unsigned short frequency;
unsigned short amplitude;
unsigned int duration;
} WM_TEST_SOUND;
/*-----------------------------------------------------------------------------
* Macro: WM_TEST_REPEATS
*
* Calculates the number of buffers to transmit to get the given duration.
*
* Parameters:
* _duration test duration in milliseconds
* _sampleRate sample rate used in test
* _bufSize size of buffer in samples
*
* Returns: The number of buffers.
*---------------------------------------------------------------------------*/
#define WM_TEST_REPEATS( _duration, _sampleRate, _bufSize )\
( ( ( (_duration) * (_sampleRate) / (_bufSize) ) + 500 ) / 1000 )
/*
* Private data
*/
/*
* Function prototypes
*/
#ifdef __cplusplus
extern "C" {
#endif
/*-----------------------------------------------------------------------------
* Function: WMTestAudio_GetSound
*
* Helper function for audio tests - returns the next sound to play.
* By picking our sounds from a list, we can check that no sounds are missed
* out by checking that it generates the correct tune.
*
* Parameters:
* none
*
* Returns: const WM_TEST_SOUND *
* Pointer to next sound to play.
*---------------------------------------------------------------------------*/
const WM_TEST_SOUND *WMTestAudio_GetSound();
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* WM_AUDIO && WM_TESTING */
#endif /* __WMAUDIOTESTHELPERS_H__ */
/*------------------------------ END OF FILE ---------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -