R/CRaudio_volume.R

Defines functions CRaudio_volume

Documented in CRaudio_volume

#' Set audio volume
#'
#' set audio volume

CRaudio_volume <- function(volume, channel, status = NULL) {
  
  if (!is.numeric(channel) || channel < 0 || channel %% 1 != 0) {
    
    warning("Channel must be integer.")
    
    if (isStatus(status)) {
      
      invisible( .Call("SDLset_status", status, 0, "Channel must be integer.", PACKAGE = "CREx") )
      
    }
    
  } else {
    
    if (isStatus(status)) {
        
      invisible(.Call("SDLaudio_volume", volume, channel, status, PACKAGE = "CREx"))
      
    } else {
      
      invisible(.Call("SDLaudio_volume", volume, channel, NULL, PACKAGE = "CREx"))
      
    }
  }
}
lorweiuk/CREx documentation built on March 16, 2024, 3:04 a.m.