Copyright (C) 2000-2012 |
GNU Info (mikmod.info)Voice FunctionsVoice Functions --------------- Voice_GetFrequency .................. `ULONG Voice_GetFrequency(SBYTE voice)' Description This function returns the frequency of the sample currently playing on the specified voice. Parameters voice The number of the voice to get frequency. Result The current frequency of the sample playing on the specified voice, or zero if no sample is currently playing on the voice. See also `Voice_SetFrequency'. Voice_GetPanning ................ `ULONG Voice_GetPanning(SBYTE voice)' Description This function returns the panning position of the sample currently playing on the specified voice. Parameters voice The number of the voice to get panning position. Result The current panning position of the sample playing on the specified voice, or `PAN_CENTER' if no sample is currently playing on the voice. See also `Voice_SetPanning'. Voice_GetPosition ................. `SLONG Voice_GetPosition(SBYTE voice)' Description This function returns the sample position (in samples) of the sample currently playing on the specified voice. Parameters voice The number of the voice to get sample position (starting from zero). Result The current play location of the sample playing on the specified voice, or zero if the position can not be determined or if no sample is currently playing on the voice. Notes This function may not work with some drivers (especially for hardware mixed voices). In this case, it returns always `-1'. See also `Sample_Play', `Voice_Play'. Voice_GetVolume ............... `UWORD Voice_GetVolume(SBYTE voice)' Description This function returns the volume of the sample currently playing on the specified voice. Parameters voice The number of the voice to get volume. Result The current volume of the sample playing on the specified voice, or zero if no sample is currently playing on the voice. See also `Voice_RealVolume', `Voice_SetVolume'. Voice_Play .......... `void Voice_Play(SBYTE voice, SAMPLE* sample, ULONG start)' Description Start a new sample in the specified voice. Parameters voice The number of the voice to be processed (starting from zero). sample The sample to play. start The starting position (in samples). Notes The sample will be played at the volume, panning and frequency settings of the voice, regardless or the sample characteristics. The sample played this way gets the same "critical" status as the sample which was previously played on this voice. See also `Sample_Play', `Voice_SetFrequency', `Voice_SetPanning', `Voice_SetVolume'. Voice_RealVolume ................ `ULONG Voice_RealVolume(SBYTE voice)' Description This function returns the actual playing volume of the specified voice. Parameters voice The number of the voice to analyze (starting from zero). Result The real volume of the voice when the function was called, in the range 0-65535, not related to the volume constraint specified with `Voice_SetVolume'. Notes This function may not work with some drivers (especially for hardware mixed voices). In this case, it always returns zero. Also note that the real volume computation is not a trivial process and takes some CPU time. See also `Sample_Play', `Voice_GetVolume', `Voice_Play', `Voice_SetVolume'. Voice_SetFrequency .................. `void Voice_SetFrequency(SBYTE voice, ULONG frequency)' Description This function sets the frequency (pitch) of the specified voice. Parameters voice The number of the voice to be processed (starting from zero). frequency The new frequency of the voice, in hertz. See also `Sample_Play', `Voice_GetFrequency', `Voice_Play', `Voice_SetPanning', `Voice_SetVolume', `Voice_Stop'. Voice_SetPanning ................ `void Voice_SetPanning(SBYTE voice, ULONG panning)' Description This function sets the panning position of the specified voice. Parameters voice The number of the voice to be processed (starting from zero). panning The new panning position of the voice. Notes Panning can vary between 0 (`PAN_LEFT') and 255 (`PAN_RIGHT'). Center is 127 (`PAN_CENTER'. Surround sound can be enabled by specifying the special value `PAN_SURROUND'. See also `Sample_Play', `Voice_GetPanning', `Voice_Play', `Voice_SetFrequency', `Voice_SetVolume', `Voice_Stop'. Voice_SetVolume ............... `void Voice_SetVolume(SBYTE voice, UWORD volume)' Description This function sets the volume of the specified voice. Parameters voice The number of the voice to be processed (starting from zero). volume The new volume of the voice, in the range 0-256. See also `Sample_Play', `Voice_GetVolume', `Voice_Play', `Voice_SetFrequency', `Voice_SetPanning', `Voice_Stop'. Voice_Stop .......... `void Voice_Stop(SBYTE voice)' Description This function stops the playing sample of the specified voice. Parameters voice The number of the voice to be processed (starting from zero). Notes After the call to `Voice_Stop', the function `Voice_Stopped' will return nonzero (true) for the voice. If you want to silence the voice without stopping the playback, use `Voice_SetVolume(voice, 0)' instead. See also `Sample_Play', `Voice_Play', `Voice_SetFrequency', `Voice_SetPanning', `Voice_SetVolume'. Voice_Stopped ............. `BOOL Voice_Stopped(SBYTE voice)' Description This function returns whether the voice is active or not. Parameters voice The number of the voice to be checked (starting from zero). Result 0 The voice is stopped or has no sample assigned. nonzero The voice is playing a sample. Notes This function may not work with some drivers (especially for hardware mixed voices). In this case, its return value is undefined. See also `Voice_Stop'. automatically generated by info2www version 1.2.2.9 |