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

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>
            99综合电影在线视频| 99视频一区| 免费人成网站在线观看欧美高清| 亚洲免费综合| 欧美一区二区三区免费观看视频| 欧美一区观看| 欧美高清视频www夜色资源网| 欧美激情五月| 国产精品亚洲一区| 激情成人av| 日韩亚洲欧美一区二区三区| 亚洲视频一区二区| 欧美在线免费观看视频| 免费不卡亚洲欧美| 99国内精品久久| 久久国产精品久久久久久久久久 | 99视频有精品| 欧美一级理论性理论a| 麻豆精品91| 一区二区高清在线| 久久久久久91香蕉国产| 欧美四级在线| 亚洲激情另类| 久久精品色图| 一区二区免费在线观看| 狂野欧美一区| 国产日韩欧美精品综合| 日韩天堂在线观看| 久久免费国产精品| 国产精品99久久99久久久二8 | 欧美在线观看一区| 欧美日韩在线播放| 亚洲国产1区| 久久久99爱| 中文国产成人精品久久一| 美脚丝袜一区二区三区在线观看| 国产精品久久999| 日韩一级成人av| 欧美二区不卡| 久久精品免费电影| 国产伦精品一区二区三区| 亚洲视频国产视频| 亚洲精品在线一区二区| 看片网站欧美日韩| 在线观看91精品国产麻豆| 欧美在线中文字幕| 亚洲伊人色欲综合网| 午夜欧美精品久久久久久久| 日韩一级在线| 你懂的亚洲视频| 小嫩嫩精品导航| 国产伦精品一区二区三区免费| 99精品国产99久久久久久福利| 嫩草国产精品入口| 久久人人97超碰国产公开结果| 国产视频精品va久久久久久| 小黄鸭精品密入口导航| 一区二区三区黄色| 国产精品xxxav免费视频| a4yy欧美一区二区三区| 日韩视频中文| 欧美视频在线看| 中文网丁香综合网| 一本色道久久综合狠狠躁篇怎么玩| 欧美高清在线播放| 亚洲伦伦在线| 一二三区精品| 国产精品腿扒开做爽爽爽挤奶网站| 亚洲曰本av电影| 亚洲欧美在线高清| 国产在线不卡| 免费一级欧美片在线播放| 麻豆成人在线播放| 99国产精品自拍| 亚洲色图综合久久| 国语自产精品视频在线看一大j8| 久久久久女教师免费一区| 久久亚裔精品欧美| 99re8这里有精品热视频免费 | 亚洲另类自拍| 欧美系列电影免费观看| 久久黄色级2电影| 美日韩丰满少妇在线观看| 日韩视频在线免费| 亚洲欧美影音先锋| 亚洲日本成人在线观看| 中文高清一区| 亚洲福利视频网站| 99在线|亚洲一区二区| 国产在线拍揄自揄视频不卡99| 亚洲高清在线观看一区| 欧美激情精品久久久久久黑人| 亚洲校园激情| 久久伊人精品天天| 亚洲永久精品国产| 久久亚洲精品一区二区| 午夜精品久久久久久99热软件| 久久精品亚洲国产奇米99| 一卡二卡3卡四卡高清精品视频| 亚洲一区欧美二区| 亚洲精品一区二区网址| 欧美一区二区三区免费看 | 久久疯狂做爰流白浆xx| 99精品久久久| 久久久久综合网| 麻豆国产精品777777在线| 好男人免费精品视频| 久久av一区二区三区亚洲| 久久亚洲精品视频| 亚洲综合清纯丝袜自拍| 久久午夜av| 欧美在线欧美在线| 欧美色网在线| 日韩视频国产视频| 亚洲国产经典视频| 欧美在线国产| 欧美有码在线视频| 欧美日韩亚洲系列| 91久久精品国产91性色| 樱花yy私人影院亚洲| 亚洲综合精品四区| 这里只有视频精品| 欧美激情精品| 亚洲国产精品精华液2区45| 狠狠久久亚洲欧美专区| 午夜视频一区| 久久国产一区二区| 国产日韩欧美一区二区三区四区| 99av国产精品欲麻豆| 日韩一二在线观看| 欧美精品播放| 亚洲区免费影片| 日韩视频精品在线观看| 欧美成人小视频| 亚洲国产高清一区二区三区| 亚洲福利视频网站| 欧美电影在线播放| 最新亚洲激情| 亚洲无线一线二线三线区别av| 欧美高清在线视频| 亚洲精品一区二| 亚洲欧美日韩成人高清在线一区| 欧美日韩精品一区二区三区| 最新中文字幕一区二区三区| 99精品视频一区| 国产精品啊v在线| 亚洲自拍电影| 久久综合伊人77777麻豆| 伊人久久大香线| 欧美成人精品福利| 夜夜嗨av一区二区三区网站四季av| 亚洲一级高清| 国产小视频国产精品| 久久久久久伊人| 亚洲精品国产系列| 香港成人在线视频| 精品av久久久久电影| 欧美二区在线| 亚洲一区二区三区乱码aⅴ| 久久精品在线免费观看| 亚洲风情亚aⅴ在线发布| 欧美福利视频在线观看| 亚洲先锋成人| 欧美粗暴jizz性欧美20| 亚洲视频精品在线| 狠狠色狠狠色综合日日五| 欧美高清你懂得| 香蕉国产精品偷在线观看不卡| 久久夜色精品亚洲噜噜国产mv| 亚洲欧洲日本在线| 国产精品电影在线观看| 久久久久久久综合| 在线视频你懂得一区二区三区| 久久久亚洲高清| 亚洲国产精品精华液2区45| 亚洲精品日韩在线观看| 欧美日韩在线免费| 欧美一区日韩一区| 亚洲国产婷婷香蕉久久久久久99 | 欧美日本国产一区| 欧美一区二区三区久久精品茉莉花| 欧美韩日精品| 久久av一区二区三区漫画| 亚洲精品一区二区三| 国产一区二区三区四区| 欧美日韩精品一二三区| 久久成人精品无人区| 一本色道久久精品| 亚洲国产精品久久久久| 久久免费视频在线| 先锋影音国产精品| 在线中文字幕日韩| 亚洲伦理在线观看| 伊人天天综合| 国产一区二区三区在线观看视频 | 亚洲一区二区在| 亚洲毛片一区| 亚洲国产精品视频一区| 国内精品视频久久| 国产精品一级久久久|