コード例 #1
0
ファイル: fx_man.c プロジェクト: JohnnyonFlame/jfaudiolib
/*---------------------------------------------------------------------
   Function: FX_PlayLoopedAuto

   Play a looped sound, autodetecting the format.
---------------------------------------------------------------------*/
int FX_PlayLoopedAuto( char *ptr, unsigned int length, int loopstart, int loopend,
                       int pitchoffset, int vol, int left, int right, int priority,
                       unsigned int callbackval )
{
    int handle = -1;

    if (!memcmp("Creative Voice File\x1a", ptr, 20)) {
        handle = MV_PlayLoopedVOC(ptr, length, loopstart, loopend, pitchoffset,
                                  vol, left, right, priority, callbackval);
    } else if (!memcmp("RIFF", ptr, 4) && !memcmp("WAVE", ptr + 8, 4)) {
        handle = MV_PlayLoopedWAV(ptr, length, loopstart, loopend, pitchoffset,
                                  vol, left, right, priority, callbackval);
#ifdef HAVE_VORBIS
    } else if (!memcmp("OggS", ptr, 4)) {
        handle = MV_PlayLoopedVorbis(ptr, length, loopstart, loopend, pitchoffset,
                                     vol, left, right, priority, callbackval);
#endif
    }

    if ( handle < MV_Ok )
    {
        FX_SetErrorCode( FX_MultiVocError );
        handle = FX_Warning;
    }

    return handle;
}
コード例 #2
0
ファイル: fx_man.c プロジェクト: JohnnyonFlame/RoTT
int FX_PlayLoopedWAV
   (
   char *ptr,
   long loopstart,
   long loopend,
   int pitchoffset,
   int vol,
   int left,
   int right,
   int priority,
   unsigned long callbackval
   )

   {
   int handle;

   handle = MV_PlayLoopedWAV( ptr, loopstart, loopend,
      pitchoffset, vol, left, right, priority, callbackval );
   if ( handle < MV_Ok )
      {
      FX_SetErrorCode( FX_MultiVocError );
      handle = FX_Warning;
      }

   return( handle );
   }
コード例 #3
0
ファイル: fx_man.c プロジェクト: Ellorah/chocolate_duke3D
int FX_PlayLoopedWAV
   (
   uint8_t *ptr,
   int32_t loopstart,
   int32_t loopend,
   int32_t pitchoffset,
   int32_t vol,
   int32_t left,
   int32_t right,
   int32_t priority,
   uint32_t callbackval
   )

   {
   int32_t handle;

   handle = MV_PlayLoopedWAV( ptr, loopstart, loopend,
      pitchoffset, vol, left, right, priority, callbackval );
   if ( handle < MV_Ok )
      {
      FX_SetErrorCode( FX_MultiVocError );
      handle = FX_Warning;
      }

   return( handle );
   }