青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Cpper
C/C++高級工程師 Android高級軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語言 程序猿
之前寫了一個dll,具體在這里
http://m.shnenglu.com/gaimor/anarchive/2013/07/11/201711.html
現在想增加一個c#綁定,上網搜了下
很簡單就實現了

實現后的cs代碼如下(當前只實現了一部分):
using System;
using System.Runtime.InteropServices;  

namespace gaudio
{   
    
class GAudio
    {   
        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_init")]
        
public static extern void gaudio_init(string path);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_deinit")]
        
public static extern void gaudio_deinit();

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_error_get")]
        
public static extern int gaudio_error_get();

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_is_support")]
        
public static extern int gaudio_is_support(int flag,int value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_set_float")]
        
public static extern void gaudio_set_float(int flag,float value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_get_float")]
        
public static extern void gaudio_get_float(int flag,ref float value);
        
        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_set_int32")]
        
public static extern void gaudio_set_int32(int flag,int value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_get_int32")]
        
public static extern void gaudio_get_int32(int flag,ref int value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_set_string")]
        
public static extern void gaudio_set_string(int flag,string value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_get_string")]
        
public static extern int gaudio_get_string(int flag,ref string value);
        
        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_listener_set_float3")]
        
public static extern void gaudio_listener_set_float3(int flag,float x,float y,float z);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_listener_get_float3")]
        
public static extern void gaudio_listener_get_float3(int flag,ref float x,ref float y,ref float z);
      
        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_create_from_file")]
        
public static extern IntPtr gaudio_source_create_from_file(string file,int flag);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_destroy")]
        
public static extern void gaudio_source_destroy(IntPtr source);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_start")]
        
public static extern void gaudio_source_start(IntPtr source,int flag);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_start_3d")]
        
public static extern void gaudio_source_start_3d(IntPtr source,int flag);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_pause")]
        
public static extern void gaudio_source_pause(IntPtr source);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_stop")]
        
public static extern void gaudio_source_stop(IntPtr source);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_seek")]
        
public static extern void gaudio_source_seek(IntPtr source,int seek);

        
public delegate int gposition(IntPtr source,int position);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_set_position_callback")]
        
public static extern void gaudio_source_set_position_callback(IntPtr source,gposition cb);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_set_float")]
        
public static extern void gaudio_source_set_float(IntPtr source,int flag,float value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_get_float")]
        
public static extern void gaudio_source_get_float(IntPtr source,int flag,ref float value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_set_int32")]
        
public static extern void gaudio_source_set_int32(IntPtr source,int flag,int value);

        [DllImport(
"gaudio.dll",EntryPoint = "gaudio_source_get_int32")]
        
public static extern void gaudio_source_get_int32(IntPtr source,int flag,ref int value);

        
public delegate int gread(IntPtr buffer,int size,int count,IntPtr ctx);
        
public delegate int gseek(IntPtr ctx,int offset,int mode);
        
public delegate int gtell(IntPtr ctx);
        
public delegate int gclose(IntPtr ctx);
    }
}

原始的c代碼如下:

#if defined(__cplusplus)
extern "C"
{
#endif /* __cplusplus */

/*************************************************************************
 * Doxygen documentation
 ************************************************************************
*/

/* ---------------- GAudio library related system specific defines ----------------- */
#if !defined(WIN32) && !defined(__linux__)
   
#error "gaudio library don't support this os at present"
#endif

#if defined(_WIN32)
 
#define GAPIENTRY __cdecl
#else
 
#define GAPIENTRY
#endif

#if defined(BUILDING)
#ifdef _WIN32
# define GAPI __declspec(dllexport)
#else
# define GAPI
#endif
#else
#ifdef _WIN32
# define GAPI __declspec(dllimport)
#else
# define GAPI
#endif
#endif

#ifndef NULL
   
#define NULL 0
#endif

#ifndef FALSE
#define FALSE   0
#endif

#ifndef TRUE
#define TRUE    1
#endif

/*************************************************************************
 * GAudio library API tokens
 ************************************************************************
*/

#define AUDIO_DRIVER_NULL      0
#define AUDIO_DRIVER_WINMM     1
#define AUDIO_DRIVER_DSOUND    2
#define AUDIO_DRIVER_ALSA      3
#define AUDIO_DRIVER_OSS       4
#define AUDIO_DRIVER_PORTAUDIO 5

#define AUDIO_PLUGIN_DECODER 1
#define AUDIO_PLUGIN_EFFECT  2
#define AUDIO_PLUGIN_DRIVER  3

#define MAX_SOURCE  8
#define MAX_DECODER 32
#define MAX_EFFECT  8

#define AUDIO_ENUM_POSITION    1
#define AUDIO_ENUM_VELOCITY    2
#define AUDIO_ENUM_FORWARD     3
#define AUDIO_ENUM_UP          4
#define AUDIO_ENUM_SAMPLERATE  5
#define AUDIO_ENUM_CHANNEL     6
#define AUDIO_ENUM_FORMAT      7
#define AUDIO_ENUM_DURATION    8
#define AUDIO_ENUM_LOOP        9
#define AUDIO_ENUM_GAIN        10
#define AUDIO_ENUM_GAIN_LEFT   11
#define AUDIO_ENUM_GAIN_RIGHT  12
#define AUDIO_ENUM_SILENCE     13
#define AUDIO_ENUM_TITLE       14
#define AUDIO_ENUM_TRACK       15
#define AUDIO_ENUM_ALBUM       16
#define AUDIO_ENUM_ARTIST      17
#define AUDIO_ENUM_PUBLISHDATE 18
#define AUDIO_ENUM_GENRE       19
#define AUDIO_ENUM_COMMENT     20
#define AUDIO_ENUM_AUDIO       21
#define AUDIO_ENUM_BITERATE    22
#define AUDIO_ENUM_VERSION     23
#define AUDIO_ENUM_DRIVER      24
#define AUDIO_ENUM_BALANCE     25
#define AUDIO_ENUM_CROSSFEED   26
#define AUDIO_ENUM_SOUNDFONT   27

#define BALANCE_MIN     -10
#define BALANCE_MAX      10
#define BALANCE_DEFAULT   0

#define AUDIO_CROSSEFED_NONE    -1
#define AUDIO_CROSSFEED_MIN     0
#define AUDIO_CROSSFEED_MAX     2
#define AUDIO_CROSSFEED_DEFAULT 1

typedef int32_t(GAPIENTRY
* gread)(void*,int32_t,int32_t,void*);
typedef int32_t(GAPIENTRY
* gseek)(void*,int32_t,int32_t);
typedef int32_t(GAPIENTRY
* gtell)(void*);
typedef int32_t(GAPIENTRY
* gclose)(void*);

typedef 
struct gsource   gsource;
typedef 
struct geffect   geffect;
typedef 
struct grecorder grecorder;

/*************************************************************************
 * GAudio API functions
 ************************************************************************
*/

/*! @brief Initializes the GAudio library.
 *
 *  This function initializes the GAudio library. Before any GAudio functions can
 *  be used, GAudio must be initialized, and before a program terminates GAudio
 *  should be terminated in order to free any resources allocated during or
 *  after initialization.
 *
 *  If this function fails, it calls @ref gaudio_deinit before returning.  If it
 *  succeeds, you should call @ref gaudio_deinit before the program exits.
 *
 *  Additional calls to this function after successful initialization but before
 *  termination will succeed but will do nothing.
 *
 *  @param[in] add-ons Where to search and load plug-ins which GAudio needed.
 *
 *  @return `TRUE` if successful, or `FALSE` if an error occurred.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @note This function may take several seconds to complete on some systems,
 *  while on other systems it may take only a fraction of a second to complete.
 *
 *  @sa gaudio_deinit
 *
 *  @ingroup init
 
*/
extern GAPI void gaudio_init(const char* addons);

/*! @brief Terminates the GAudio library.
 *
 *  This function frees any allocated resources and sets the library to an
 *  uninitialized state.  Once this is called, you must again call @ref gaudio_init
 *  successfully before you will be able to use most GAudio functions.
 *
 *  If GAudio has been successfully initialized, this function should be called
 *  before the program exits.  If initialization fails, there is no need to call
 *  this function, as it is called by @ref gaudio_init before it returns failure.
 *
 *  @remarks This function may be called before @ref gaudio_init.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_init
 *
 *  @ingroup init
 
*/
extern GAPI void gaudio_deinit();

/* Audio format type */
#define AUDIO_FORMAT_TYPE_NONE      -1
#define AUDIO_FORMAT_TYPE_INT4      0
#define AUDIO_FORMAT_TYPE_INT8      1
#define AUDIO_FORMAT_TYPE_UINT8     2
#define AUDIO_FORMAT_TYPE_INT16     3
#define AUDIO_FORMAT_TYPE_UINT16    4
#define AUDIO_FORMAT_TYPE_INT24     5
#define AUDIO_FORMAT_TYPE_INT32     6
#define AUDIO_FORMAT_TYPE_UINT32    7
#define AUDIO_FORMAT_TYPE_INT64     8
#define AUDIO_FORMAT_TYPE_FLOAT     9
#define AUDIO_FORMAT_TYPE_DOUBLE    10
#define AUDIO_FORMAT_TYPE_ULAW      11
#define AUDIO_FORMAT_TYPE_ALAW      12
#define AUDIO_FORMAT_TYPE_VOX_ADPCM 13
#define AUDIO_FORMAT_TYPE_MS_ADPCM  14
#define AUDIO_FORMAT_TYPE_GSM610    15
#define AUDIO_FORMAT_TYPE_IMA_ADPCM 16
#define AUDIO_FORMAT_TYPE_DPCM8     17
#define AUDIO_FORMAT_TYPE_DPCM16    18
#define AUDIO_FORMAT_TYPE_G723_24   19
#define AUDIO_FORMAT_TYPE_G723_32   20
#define AUDIO_FORMAT_TYPE_G723_40   21
#define AUDIO_FORMAT_TYPE_DWVW_12   22
#define AUDIO_FORMAT_TYPE_DWVW_16   23
#define AUDIO_FORMAT_TYPE_DWVW_24   24
#define AUDIO_FORMAT_TYPE_DWVW_N    25
#define AUDIO_FORMAT_TYPE_VORBIS    26
#define AUDIO_FORMAT_TYPE_MPC       27
#define AUDIO_FORMAT_TYPE_MAX       100

/* Channel type */
#define DEVICE_CHANNEL_MONO    1
#define DEVICE_CHANNEL_STEREO  (DEVICE_CHANNEL_MONO+1)
#define DEVICE_CHANNEL_QUAD    (DEVICE_CHANNEL_STEREO+1)
#define DEVICE_CHANNEL_5POINT1 (DEVICE_CHANNEL_QUAD+1)
#define DEVICE_CHANNEL_6POINT1 (DEVICE_CHANNEL_5POINT1+1)
#define DEVICE_CHANNEL_7POINT1 (DEVICE_CHANNEL_6POINT1+1)

#define AUDIO_VERSON       0
#define AUDIO_PLAY_MODE    1
#define AUDIO_RECORD_MODE  2

/* GAudio plugin type */
#define AUDIO_PLUGIN_AUDIO    1
#define AUDIO_PLUGIN_EFFECT   2
#define AUDIO_PLUGIN_DRIVER   3
#define AUDIO_PLUGIN_RECORDER 4

/* Audio file type */
#define AUDIO_FORMAT_NONE   -1
#define AUDIO_FORMAT_RAW     0
#define AUDIO_FORMAT_WAV     1
#define AUDIO_FORMAT_AU      2
#define AUDIO_FORMAT_AIFF    3
#define AUDIO_FORMAT_FLAC    4
#define AUDIO_FORMAT_MP2     5
#define AUDIO_FORMAT_MP3     6
#define AUDIO_FORMAT_APE     7
#define AUDIO_FORMAT_AAC     8
#define AUDIO_FORMAT_CAF     9
#define AUDIO_FORMAT_OGG     10
#define AUDIO_FORMAT_VOC     11
#define AUDIO_FORMAT_WV      12
#define AUDIO_FORMAT_MIDI    13
#define AUDIO_FORMAT_XM      14
#define AUDIO_FORMAT_S3M     15
#define AUDIO_FORMAT_MOD     16
#define AUDIO_FORMAT_IT      17
#define AUDIO_FORMAT_WMA     18
#define AUDIO_FORMAT_WMV     19
#define AUDIO_FORMAT_CD      20
#define AUDIO_FORMAT_VQF     21
#define AUDIO_FORMAT_MPC     22
#define AUDIO_FORMAT_TTA     23
#define AUDIO_FORMAT_AC3     24

/* Audio effect type */
#define AUDIO_EFFECT_NONE                  -1
#define AUDIO_EFFECT_PHASER                 0
#define AUDIO_EFFECT_INVERT                 1
#define AUDIO_EFFECT_SWAP_CHANNEL           2
#define AUDIO_EFFECT_MERGE_CHANNEL          3
#define AUDIO_EFFECT_SPEED_CHANGER          4
#define AUDIO_EFFECT_ECHO                   5
#define AUDIO_EFFECT_REVERB                 6
#define AUDIO_EFFECT_FFT                    7
#define AUDIO_EFFECT_EQUALIZER              8
#define AUDIO_EFFECT_BASSBOOST              9
#define AUDIO_EFFECT_CHORUS                 10
#define AUDIO_EFFECT_STEREO_ENHANCE         11
#define AUDIO_EFFECT_DISTORTION             12
#define AUDIO_EFFECT_FOLDBACK_DISTORTION    13
#define AUDIO_EFFECT_FLANGER                14
#define AUDIO_EFFECT_AUTOWAH                15
#define AUDIO_EFFECT_COMPRESSER             16
#define AUDIO_EFFECT_MODULATOR              17
#define AUDIO_EFFECT_FADE_IN                18
#define AUDIO_EFFECT_FADE_OUT               19
#define AUDIO_EFFECT_LEVELLER               20
#define AUDIO_EFFECT_ZIPPER                 21

extern GAPI int32_t gaudio_is_support(int32_t,int32_t);

extern GAPI void gaudio_set_float(int32_t,float);
extern GAPI void gaudio_get_float(int32_t,float*);
extern GAPI void gaudio_set_int32(int32_t,int32_t);
extern GAPI void gaudio_get_int32(int32_t,int32_t*);
extern GAPI void gaudio_set_string(int32_t,const char*);
extern GAPI int32_t gaudio_get_string(int32_t,char*);

/*! @defgroup errors Error codes
 *  @ingroup error
 *  @{ 
*/
/*! @brief GAudio has not been initialized.
 
*/
#define AUDIO_NO_ERROR      0
/*! @brief GAudio has not been initialized.
 
*/
#define AUDIO_NOT_INIT      1
#define AUDIO_BAD_TAG       2
#define AUDIO_BAD_VALUE     3
/*! @brief GAudio could not support for the requested client API on the
 *  system.
 
*/
#define AUDIO_NOT_SUPPORT   4
#define AUDIO_BAD_OPERATION 5
/*! @brief A memory allocation failed.
 
*/
#define AUDIO_OUT_OF_MEMORY 6
#define AUDIO_OVER_COUNT    7
#define AUDIO_INNER_ERROR   8

extern GAPI int32_t gaudio_error_get();
extern GAPI void gaudio_source_set_float(gsource*,int32_t,float);
extern GAPI void gaudio_source_get_float(gsource*,int32_t,float*);
extern GAPI void gaudio_source_set_int32(gsource*,int32_t,int32_t);
extern GAPI void gaudio_source_get_int32(gsource*,int32_t,int32_t*);
extern GAPI int32_t gaudio_source_get_string(gsource*,int32_t,char*);
extern GAPI void gaudio_listener_set_float3(int32_t,float,float,float);
extern GAPI void gaudio_listener_get_float3(int32_t,float*,float*,float*);

/*! @brief Create gsource from given audio file name.
 *
 *  This function create gsource from given audio file name,
 *
 *  @param[in] file The file that will be loaded.
 *  @param[in] flag A flag value which script the load mode
 *  @return An gsource instance pointer, or `NULL` if the error occur.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_source_create_from_buffer
 *  @sa gaudio_source_create_from_virtual_io
 *  @sa gaudio_source_create_from_buffer2
 *  @sa gaudio_source_destroy
 *
 *  @ingroup gsource
 
*/
extern GAPI gsource* gaudio_source_create_from_file(const char* file,int32_t flag);
/*! @brief Create gsource by given buffer
 *
 *  This function create gsource from given buffer, the buffer length is pointed by user.
 *
 *  @param[in] buffer The buffer that will be loaded.
 *  @param[in] length The length of buffer
 *  @return An gsource instance pointer, or `NULL` if the error occur.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_source_create_from_file
 *  @sa gaudio_source_create_from_virtual_io
 *  @sa gaudio_source_create_from_buffer2
 *  @sa gaudio_source_destroy
 *
 *  @ingroup gsource
 
*/
extern GAPI gsource* gaudio_source_create_from_buffer(int8_t* buffer,uint32_t length);
/*! @brief Create gsource by user io
 *
 *  This function create gsource from user io, the io operation is pointed by user.
 *
 *  @param[in] read The read callback function.
 *  @param[in] seek The seek callback function.
 *  @param[in] tell The tell callback function.
 *  @param[in] close The close callback function.
 *  @param[in] user The user client data pointer. 
 *  @return An gsource instance pointer, or `NULL` if the error occur.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_source_create_from_file
 *  @sa gaudio_source_create_from_buffer
 *  @sa gaudio_source_create_from_buffer2
 *  @sa gaudio_source_destroy
 *
 *  @ingroup gsource
 
*/
extern GAPI gsource* gaudio_source_create_from_virtual_io(gread read,gseek seek,gtell tell,gclose close,void* user);
/*! @brief Create gsource by given pcm data
 *
 *  This function create gsource from user io, the io operation is pointed by user.
 *
 *  @param[in] samplerate The given source's samplerate.
 *  @param[in] channels The given source's chgannels.
 *  @param[in] format The given source's format.
 *  @param[in] pcm The given source's data buffer.
 *  @param[in] length The length of given source data. 
 *  @return An gsource instance pointer, or `NULL` if the error occur.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_source_create_from_file
 *  @sa gaudio_source_create_from_buffer
 *  @sa gaudio_source_create_from_virtual_io
 *  @sa gaudio_source_destroy
 *
 *  @ingroup gsource
 
*/
extern GAPI gsource* gaudio_source_create_from_buffer2(uint32_t samplerate,uint32_t channels,uint32_t format,int8_t* pcm,uint32_t length);
/*! @brief Destroy gsource instance.
 *
 *  This function destroy given gsource instance,
 *
 *  @param[in] source A gsource instance which will be destroyed.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_source_create_from_file
 *  @sa gaudio_source_create_from_buffer
 *  @sa gaudio_source_create_from_virtual_io
 *  @sa gaudio_source_create_from_buffer2
 *
 *  @ingroup gsource
 
*/
extern GAPI void GAPIENTRY gaudio_source_destroy(gsource* source);
/*! @brief The function signature for source content finish callbacks.
 *
 *  This is the function signature for source finish callback functions.
 *
 *  @param[in] source The source whose content needs to be triggered.
 *
 *  @sa gaudio_source_set_finish_callback
 *
 *  @ingroup gsource
 
*/
typedef 
void(GAPIENTRY* gfinish)(gsource* source);
/*! @brief Sets the gsource callback.
 *
 *  This function sets the playing finished callback of the specified gsource, which is
 *  called when source playing finished.
 *
 *  @param[in] source The source whose callback to set.
 *  @param[in] finish The new gfinish callback.
 *
 *  @ingroup gsource
 
*/
extern GAPI void gaudio_source_set_finish_callback(gsource* source,gfinish finish);
/*! @brief The function signature for gsource error callbacks.
 *
 *  This is the function signature for gsource error callback functions.
 *
 *  @param[in] source The source whose content needs to be triggered.
 *
 *  @sa gaudio_source_set_error_callback
 *
 *  @ingroup gsource
 
*/
typedef 
void(GAPIENTRY* gerror)(gsource*,int32_t,int32_t);
/*! @brief Sets the gsource error callback.
 *
 *  This function sets the playing error callback of the specified gsource, which is
 *  called when error occur.
 *
 *  @param[in] source The source whose callback to set.
 *  @param[in] error The error callback function.
 *
 *  @ingroup gsource
 
*/
extern GAPI void gaudio_source_set_error_callback(gsource* source,gerror error);
extern GAPI void gaudio_source_set(gsource*,int32_t,float,float,float);
extern GAPI void gaudio_source_get(gsource*,int32_t,float*,float*,float*);
extern GAPI void gaudio_source_start(gsource* source,int32_t flag);
extern GAPI void gaudio_source_start_3d(gsource*,int32_t);
/*! @brief pause the specified audio source.
 *
 *  This function pause the specified audio source, if it was previously
 *  playing.
 *
 *  @param[in] source The audio source to pause.
 *
 *  @sa gaudio_source_start
 *  @sa gaudio_source_stop
 *
 *  @ingroup gsource
 
*/
extern GAPI void gaudio_source_pause(gsource* source);
/*! @brief stop the specified audio source.
 *
 *  This function stop the specified audio source, if it was previously
 *  playing or pause.
 *
 *  @param[in] source The audio source to stop.
 *
 *  @sa gaudio_source_start
 *  @sa gaudio_source_pause
 *
 *  @ingroup gsource
 
*/
extern GAPI void gaudio_source_stop(gsource* source);
/*! @brief seek the specified audio source to given position.
 *
 *  This function seek the specified audio source, if it was previously
 *  playing or pause.
 *
 *  @param[in] source The audio source to seek.
 *
 *  @sa gaudio_source_start
 *  @sa gaudio_source_stop
 *  @sa gaudio_source_seek
 *
 *  @ingroup gsource
 
*/
extern GAPI void gaudio_source_seek(gsource* source,int32_t missecond);
/*! @brief The function signature for gsource position callbacks.
 *
 *  This is the function signature for gsource position callback functions.
 *
 *  @param[in] source The source whose content needs to be triggered.
 *
 *  @sa gaudio_source_set_position_callback
 *
 *  @ingroup gsource
 
*/
typedef 
void(GAPIENTRY* gposition)(gsource*,int32_t);
extern GAPI void gaudio_source_set_position_callback(gsource* source,gposition);

/*! @brief Create geffect instance.
 *
 *  This function create given geffect instance,
 *
 *  @param[in] effect A effect id which will be created.
  * @param[out] A effect pointer instance, NULL for error occur.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_effect_create
 *
 *  @ingroup geffect
 
*/
extern GAPI geffect* gaudio_effect_create(int32_t effect,int32_t flag);
/*! @brief Destroy geffect instance.
 *
 *  This function destroy given geffect instance,
 *
 *  @param[in] effect A effect instance which will be destroyed.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_effect_create
 *
 *  @ingroup geffect
 
*/
extern GAPI void gaudio_effect_destroy(geffect* effect);
/*! @brief The function signature for geffect fft callbacks.
 *
 *  This is the function signature for geffect fft calc callback functions.
 *
 *  @param[in] source The source whose content needs to be triggered.
 *
 *  @ingroup geffect
 
*/
typedef 
void(GAPIENTRY* gefxcb)(geffect*,float*,int32_t,int32_t,int32_t);
extern GAPI void gaudio_effect_set_callback(geffect*,gefxcb);
extern GAPI void gaudio_effect_bind(geffect* effect,int32_t flag);
/*! @brief bind effect with given source.
 *
 *  @param[in] effect An effect pointer which will be bind to source.
 *  @param[in] source A source pointer which will be bind to effect.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_effect_bind
 *  @sa gaudio_effect_unbind
 *  @sa gaudio_effect_unbind_from_source
 *
 *  @ingroup geffect
 
*/
extern GAPI void gaudio_effect_bind_to_source(geffect* effect,gsource* source);
/*! @brief unbind effect from global context.
 *
 *  @param[in] effect An effect pointer which will be unbind from global.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_effect_bind_to_source
 *  @sa gaudio_effect_unbind
 *  @sa gaudio_effect_unbind_from_source
 *
 *  @ingroup geffect
 
*/
extern GAPI void gaudio_effect_unbind(geffect* effect);
/*! @brief unbind effect with given source.
 *
 *  @param[in] effect An effect pointer which will be unbind to source.
 *  @param[in] source A source pointer which will be unbind to effect.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_effect_bind
 *  @sa gaudio_effect_unbind
 *  @sa gaudio_effect_bind_to_source
 *
 *  @ingroup geffect
 
*/
extern GAPI void gaudio_effect_unbind_from_source(geffect* effect,gsource* source);
extern GAPI void gaudio_effect_set_float(geffect*,int32_t,float);
extern GAPI void gaudio_effect_get_float(geffect*,int32_t,float*);
#define AUDIO_EFFECT_ENABLE  0
extern GAPI void gaudio_effect_set_int32(geffect*,int32_t,int32_t);
extern GAPI void gaudio_effect_get_int32(geffect*,int32_t,int32_t*);

extern GAPI grecorder* gaudio_recorder_create(const char*,uint32_t,uint32_t,uint32_t,uint32_t);
extern GAPI void gaudio_recorder_start(grecorder*);
extern GAPI void gaudio_recorder_stop(grecorder*);
/*! @brief Destroy grecorder instance.
 *
 *  This function destroy given grecorder instance,
 *
 *  @param[in] source A grecorder instance which will be destroyed.
 *
 *  @note This function may only be called from the main thread.
 *
 *  @sa gaudio_recorder_create
 *
 *  @ingroup grecorder
 
*/
extern GAPI void gaudio_recorder_destroy(grecorder* recorder);

/*! @brief Returns the address of the specified function for the current
 *  context.
 *
 *  This function returns the address of the specified
 *  [client API or extension function], if it is supported
 *  by the current context.
 *
 *  @param[in] name The ASCII encoded name of the function.
 *  @return The address of the function, or `NULL` if the function is
 *  unavailable.
 *
 *  @remarks This function may be called from secondary threads.
 *
 *  @note The addresses of these functions are not guaranteed to be the same for
 *  all contexts, especially if they use different client APIs or even different
 *  context creation hints.
 *
 *  @ingroup context
 
*/
extern GAPI void* gaudio_address_get(const char* name);

#if defined(__cplusplus)
}
#endif

/*************************************************************************
 * Global definition cleanup
 ************************************************************************
*/

#endif  /* _gaudio_h_ */

需要說明的是使用IntPtr可以替換c語言中的udt類型,由于不熟悉c#以上c#代碼可能存在問題
最終的測試代碼如下:
using System;
using gaudio;

namespace Simple
{
    
class Simple
    {
        
static void Main(string[] args)
        {
            gaudio.GAudio.gaudio_init(
"addons");
            
int error = gaudio.GAudio.gaudio_error_get();
            
if(error != 0)
                
return;

            IntPtr source 
= gaudio.GAudio.gaudio_source_create_from_file("azure.xm",0);
            
if(source == null)
            {
                Console.WriteLine(
"create source failed.");
                gaudio.GAudio.gaudio_deinit();
                
return;
            }

            gaudio.GAudio.gaudio_source_start(source,
1);
            
            Console.WriteLine(
"Press any key to exit!");
            Console.ReadKey(
true);
            gaudio.GAudio.gaudio_source_destroy(source);
            gaudio.GAudio.gaudio_deinit();
        }
    }
}
posted on 2013-09-13 20:55 ccsdu2009 閱讀(3659) 評論(0)  編輯 收藏 引用 所屬分類: 雜項編程基礎
 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久精品综合网| 亚洲二区在线视频| 狼狼综合久久久久综合网| 欧美激情一区二区三区 | 国产精品久久久久9999吃药| 亚洲国内精品| 亚洲欧美区自拍先锋| 欧美午夜片欧美片在线观看| 久久成人免费| 一区二区高清视频| 久久久亚洲欧洲日产国码αv| 99re6热只有精品免费观看| 欧美日韩一级黄| 欧美www视频| 亚洲国内自拍| 女生裸体视频一区二区三区| 久久色在线播放| 亚洲人成精品久久久久| 久久久久久久91| 久久国产精品72免费观看| 亚洲综合日本| 欧美淫片网站| 欧美日本韩国在线| 国产欧美日韩| 美女视频黄a大片欧美| 日韩视频精品在线| 亚洲精品之草原avav久久| 一区二区三区精品国产| 久久精品国产欧美激情| 亚洲日本免费| 91久久午夜| 性刺激综合网| 欧美日韩午夜剧场| 亚洲国产日韩综合一区| 久久精品在线免费观看| 日韩午夜在线视频| 久久久欧美精品| 国产精品电影在线观看| 尤物九九久久国产精品的特点| 正在播放亚洲| 亚洲精品国久久99热| 午夜精品久久久久久久久久久久| 欧美成人国产一区二区| 亚洲高清资源| 欧美成人午夜激情在线| 西西人体一区二区| 国产精品你懂的在线欣赏| 99精品99| 99这里只有久久精品视频| 欧美福利一区二区三区| 伊人久久大香线蕉综合热线 | 欧美在线免费| 一本色道久久综合| 欧美精品一区二区精品网| 在线免费观看欧美| 久久全国免费视频| 欧美一级理论片| 狠狠色噜噜狠狠色综合久| 久久九九热免费视频| 欧美一二三区精品| 国产一区亚洲| 久久人人爽爽爽人久久久| 亚洲欧美一区二区三区极速播放| 国产精品久久久久久久久婷婷| 亚洲一区视频在线观看视频| 国产精品99久久99久久久二8| 国产精品女主播在线观看| 亚洲女性裸体视频| 亚洲综合精品自拍| 国精产品99永久一区一区| 久久久精品一品道一区| 午夜久久影院| 亚洲第一精品夜夜躁人人爽| 亚洲国产成人精品久久| 欧美日韩在线不卡| 亚洲影院免费观看| 午夜精品久久久久久久蜜桃app| 国产欧美在线观看| 开心色5月久久精品| 美国成人毛片| 亚洲免费网址| 久久久精品五月天| 亚洲精品一区二区三区婷婷月| 亚洲乱码久久| 国产一区二区高清不卡| 欧美超级免费视 在线| 久久久精品999| 亚洲精品1区2区| 欧美日本韩国一区二区三区| 亚洲一品av免费观看| 午夜亚洲性色福利视频| 在线观看欧美亚洲| 在线综合欧美| 亚洲国产精品专区久久| 亚洲人成在线影院| 黑人一区二区| 亚洲视频在线播放| 亚洲日本电影在线| 久久国产精品一区二区三区四区| 亚洲区欧美区| 欧美亚洲免费在线| 亚洲天堂成人在线观看| 久久精品免费电影| 亚洲尤物影院| 欧美大片免费久久精品三p| 亚洲专区在线| 欧美日韩1区2区| 久久久午夜视频| 欧美午夜电影一区| 亚洲福利在线观看| 国产自产2019最新不卡| 在线综合亚洲欧美在线视频| 在线观看亚洲专区| 亚洲一区二区在线播放| 一区二区久久| 欧美国产日韩一区二区三区| 久久久久久网| 国产婷婷色一区二区三区四区| 亚洲精品视频一区二区三区| 一区二区在线免费观看| 欧美亚洲综合网| 欧美一区观看| 国产精品日韩欧美综合| 一本色道久久综合| 一本色道久久综合精品竹菊| 狼人天天伊人久久| 乱中年女人伦av一区二区| 国产日韩欧美| 亚洲午夜羞羞片| 亚洲欧美成人一区二区三区| 欧美日韩小视频| 日韩视频免费| a4yy欧美一区二区三区| 欧美精品免费观看二区| 亚洲日本欧美| 日韩西西人体444www| 欧美激情一区二区三区在线视频 | 久久久久久久综合日本| 国产日韩在线一区二区三区| 亚洲天堂网在线观看| 亚洲欧美日韩专区| 国产精品欧美日韩| 亚洲欧美日韩精品久久奇米色影视| 亚洲性色视频| 国产精品久久久久久久7电影 | 午夜精品三级视频福利| 亚洲欧美在线aaa| 国产免费观看久久黄| 欧美中文日韩| 欧美刺激性大交免费视频| 午夜视频久久久| 国产伪娘ts一区| 欧美在线看片| 免费人成精品欧美精品| 亚洲欧洲视频在线| 欧美日韩少妇| 欧美一区二区三区电影在线观看| 久久免费视频在线观看| 亚洲激情第一页| 欧美色另类天堂2015| 亚洲欧美怡红院| 欧美激情亚洲国产| 亚洲欧美在线免费观看| 一区在线视频观看| 欧美日韩性生活视频| 亚洲欧美日韩精品久久久久| 美女精品视频一区| 日韩写真在线| 国产一级揄自揄精品视频| 老司机精品久久| 亚洲欧美另类综合偷拍| 欧美高清成人| 亚洲亚洲精品三区日韩精品在线视频| 国产精品免费看久久久香蕉| 久久精品最新地址| 一本到12不卡视频在线dvd| 久久久国产视频91| 亚洲精品国产精品国自产在线 | 国产精品综合久久久| 老巨人导航500精品| 亚洲图中文字幕| 91久久国产精品91久久性色| 午夜国产不卡在线观看视频| 亚洲黄色在线观看| 国产日韩欧美亚洲一区| 欧美日韩国产综合久久| 久久精品国产2020观看福利| 99国产精品视频免费观看| 久久综合一区| 欧美亚洲视频| 一本色道久久综合亚洲精品不卡| 国色天香一区二区| 国产精品成人av性教育| 欧美肥婆bbw| 老**午夜毛片一区二区三区| 欧美在线资源| 午夜精品福利一区二区三区av| 亚洲麻豆av| 亚洲精品久久嫩草网站秘色| 欧美福利视频一区|