What exactly is a "sample" in audio/video context?
If you are working in a video editing app like Premiere or Final Cut, when you specify a sample rate, you are specifying the audio sampling rate.  This is how many times per second the audio is going to be converted into a numeric value and stored.  So typically with video, it is 48,000 times per second (a frequency of 48kHz), or 44,100 = 44.1kHz. You need two samples to correctly measure a frequency. This means that the maximum frequency you can record in an uncompressed audio recording is usually just under half the sample rate.  This is called the Nyquist frequency.  So at a sample rate of 48kHz, you cannot correctly record any frequencies about 24kHz without hearing alias frequencies (incorrectly recorded lower frequencies appearing in error in your recording).
Pixels are not commonly referred to as samples, and a frame (whether defined as an audio frame in a file format, or as a frame of video) is different to a sample.
It would improve your question to say which program your code snippet comes from - someone might be able to help directly.
Also - bit depth is not the same as sampling - sampling is how often you measure something. Bit depth is how many numbers you use to record the measurement.  So most audio is recorded at 16, 24, or 32 bits.  So each sample in a 16 bit recording could be measured between zero and 65,536 amplitude levels.