-- | Sound File Queries
module CsoundExpr.Opcodes.Sigio.Queries
    (filelen,
     filenchnls,
     filepeak,
     filesr)
where



import CsoundExpr.Base.Types
import CsoundExpr.Base.MultiOut
import CsoundExpr.Base.SideEffect
import CsoundExpr.Base.UserDefined



-- | * opcode : filelen
--  
--  
-- * syntax : 
--  
--  >   ir filelen ifilcod, [iallowraw]
--  
--  
-- * description : 
--  
--  Returns the length of a sound file.
--  
--  
-- * url : <http://www.csounds.com/manual/html/filelen.html>
 
filelen :: [Irate] -> String -> Irate
filelen i0init s1file = opcode "filelen" args
  where args = [to s1file] ++ map to i0init


-- | * opcode : filenchnls
--  
--  
-- * syntax : 
--  
--  >   ir filenchnls ifilcod [, iallowraw]
--  
--  
-- * description : 
--  
--  Returns the number of channels in a sound file.
--  
--  
-- * url : <http://www.csounds.com/manual/html/filenchnls.html>
 
filenchnls :: [Irate] -> String -> Irate
filenchnls i0init s1file = opcode "filenchnls" args
  where args = [to s1file] ++ map to i0init


-- | * opcode : filepeak
--  
--  
-- * syntax : 
--  
--  >   ir filepeak ifilcod [, ichnl]
--  
--  
-- * description : 
--  
--  Returns the peak absolute value of a sound file.
--  
--  
-- * url : <http://www.csounds.com/manual/html/filepeak.html>
 
filepeak :: [Irate] -> String -> Irate
filepeak i0init s1file = opcode "filepeak" args
  where args = [to s1file] ++ map to i0init


-- | * opcode : filesr
--  
--  
-- * syntax : 
--  
--  >   ir filesr ifilcod [, iallowraw]
--  
--  
-- * description : 
--  
--  Returns the sample rate of a sound file.
--  
--  
-- * url : <http://www.csounds.com/manual/html/filesr.html>
 
filesr :: [Irate] -> String -> Irate
filesr i0init s1file = opcode "filesr" args
  where args = [to s1file] ++ map to i0init